Page 1 of 2

RS232 port and wxWidgets

Posted: Wed Jul 04, 2007 6:32 pm
by Lucky75
Hey all,

Anyone know if there is a way of grabbing rs232 data through wxWidgets?

Thanks!

Posted: Wed Jul 04, 2007 6:48 pm
by tan

Posted: Wed Jul 04, 2007 6:52 pm
by FireMail
hi there,

use the libwxctb - works very well for windows and unix systems, merely not available for mac

Posted: Wed Jul 04, 2007 7:27 pm
by Lucky75
Thanks guys!

Where would I find libwxctb? Is it included in wxctb 0.9?

Any ideas on how to install this? I got a little lost with the instructions. I am using VC++ 2005 express.

I went into the VC cmd prompt and typed this, but got the following error:

Code: Select all

c:\documents and settings\<user>\my documents\wxctb\build>n
make -f makefile.vc DEBUG=1 GPIB=1

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.

        if not exist debug mkdir debug
        cl /c /nologo /TP /Fodebug\wxctb_lib_expect.obj /MTd /DWIN32  /Zi  /D_DE
BUG /Fd..\lib\wxctbd-gpib-0.9.pdb /O2  /I..\include /GR /EHsc   .\..\src\expect.
cpp
expect.cpp
c:\documents and settings\<user>\my documents\wxctb\include
\wx\ctb\win32/timer.h(13) : fatal error C1083: Cannot open include file: 'window
s.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\BIN\c
l.EXE"' : return code '0x2'
Stop.


Thanks! :)

Posted: Wed Jul 04, 2007 7:35 pm
by FireMail
libwxctb is the same as wxctb ;)

do you have VC++ 6.0? then you could import the .mak file and compile it this way

Posted: Wed Jul 04, 2007 7:45 pm
by Lucky75
No, its VC++ 2005 Express

Posted: Wed Jul 04, 2007 7:54 pm
by FireMail
ok maybe you can use those files - place them all in the build directory!

Posted: Wed Jul 04, 2007 8:00 pm
by Lucky75
Tried compiling that and got the following errors:

Code: Select all

------ Build started: Project: ctb, Configuration: Debug Win32 ------
Performing Makefile project actions
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.
 cl /c /nologo /TP /Fowxctb_lib_expect.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\expect.cpp
expect.cpp
.\..\src\expect.cpp(51) : warning C4996: 'strcat' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
        Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
 cl /c /nologo /TP /Fowxctb_lib_getopt.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\getopt.cpp
getopt.cpp
 cl /c /nologo /TP /Fowxctb_lib_iobase.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\iobase.cpp
iobase.cpp
 cl /c /nologo /TP /Fowxctb_lib_match.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\match.cpp
match.cpp
 cl /c /nologo /TP /Fowxctb_lib_serport.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\win32\serport.cpp
serport.cpp
c:\documents and settings\<user>\my documents\downloads\wxctb\include\wx\ctb\win32\../serportx.h(161) : warning C4996: '_snprintf' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(339) : see declaration of '_snprintf'
        Message: 'This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\..\src\win32\serport.cpp(119) : warning C4996: '_snprintf' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(339) : see declaration of '_snprintf'
        Message: 'This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\..\src\win32\serport.cpp(205) : warning C4996: 'strncpy' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(156) : see declaration of 'strncpy'
        Message: 'This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
 cl /c /nologo /TP /Fowxctb_lib_timer.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\win32\timer.cpp
timer.cpp
 if exist ..\lib\wxctb-0.8.lib del ..\lib\wxctb-0.8.lib
 link /LIB /NOLOGO /OUT:..\lib\wxctb-0.8.lib @C:\DOCUME~1\JORDAN~1\LOCALS~1\Temp\nm1BBF.tmp
 cl /c /nologo /TP /Fowxctb_dll_expect.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\expect.cpp
expect.cpp
.\..\src\expect.cpp(51) : warning C4996: 'strcat' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
        Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
 cl /c /nologo /TP /Fowxctb_dll_getopt.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\getopt.cpp
getopt.cpp
 cl /c /nologo /TP /Fowxctb_dll_iobase.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\iobase.cpp
iobase.cpp
 cl /c /nologo /TP /Fowxctb_dll_match.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\match.cpp
match.cpp
 cl /c /nologo /TP /Fowxctb_dll_serport.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\win32\serport.cpp
serport.cpp
c:\documents and settings\<user>\my documents\downloads\wxctb\include\wx\ctb\win32\../serportx.h(161) : warning C4996: '_snprintf' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(339) : see declaration of '_snprintf'
        Message: 'This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\..\src\win32\serport.cpp(119) : warning C4996: '_snprintf' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\stdio.h(339) : see declaration of '_snprintf'
        Message: 'This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
.\..\src\win32\serport.cpp(205) : warning C4996: 'strncpy' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(156) : see declaration of 'strncpy'
        Message: 'This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
 cl /c /nologo /TP /Fowxctb_dll_timer.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\win32\timer.cpp
timer.cpp
 link /DLL /NOLOGO /OUT:..\lib\wxctb-0.8.dll    /LIBPATH:..\lib @C:\DOCUME~1\JORDAN~1\LOCALS~1\Temp\nm1BC0.tmp
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: __thiscall fifo::fifo(unsigned int)" ([email protected]@[email protected]@Z) referenced in function "public: __thiscall wxIOBase::wxIOBase(void)" ([email protected]@[email protected])
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall fifo::items(void)" ([email protected]@@QAEIXZ) referenced in function "public: virtual int __thiscall wxSerialPort::Read(char *,unsigned int)" ([email protected]@@[email protected])
..\lib\wxctb-0.8.dll : fatal error LNK1120: 2 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 8\VC\bin\link.EXE"' : return code '0x460'
Stop.
Project : error PRJ0019: A tool returned an error code from "Performing Makefile project actions"
Build log was saved at "file://c:\Documents and Settings\<user>\My Documents\Downloads\wxctb\build\Debug\BuildLog.htm"
ctb - 5 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Re: RS232 port and wxWidgets

Posted: Thu Jul 05, 2007 8:22 am
by krzysiek_t
Hi,
Some time ago I wanted the same thing, but I wanted a solution to create a RS-232 connection with automatic transmission speed negotiation :lol: So I've started to create one. Due to lack of time - it's still not finished.

Lucky75 wrote:Hey all,

Anyone know if there is a way of grabbing rs232 data through wxWidgets?

Thanks!

Posted: Mon Jul 30, 2007 2:02 pm
by Lucky75
Just a bump. Still stuck at this problem :(

Posted: Mon Jul 30, 2007 2:59 pm
by C_Bastian
Althought this is an old (semi-dead :wink: ) thread, I was asked in another thread to write something about this problem.

You have a linker problem. I think you forgot to link a library. Have a look in the project options. (I do not know VC++ Express) I think in the linker options you have to add another .lib. I do not know, which one, but maybe somebody else can answer this.

Sebastian

Posted: Mon Jul 30, 2007 3:18 pm
by tan
Hi,
Lucky75 wrote:Tried compiling that and got the following errors:

Code: Select all

------ Build started: Project: ctb, Configuration: Debug Win32 ------
Performing Makefile project actions
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation.  All rights reserved.
 cl /c /nologo /TP /Fowxctb_lib_expect.obj /MT /DWIN32 /DNDEBUG /O2    /Fd..\lib\wxctb-0.8.pdb  /I..\include /GR /EHsc   .\..\src\expect.cpp
expect.cpp
.\..\src\expect.cpp(51) : warning C4996: 'strcat' was declared deprecated
        C:\Program Files\Microsoft Visual Studio 8\VC\include\string.h(78) : see declaration of 'strcat'
        Message: 'This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.'
well, it is just a warning, don't pay attention :)
Lucky75 wrote:

Code: Select all

[skipped]
 link /DLL /NOLOGO /OUT:..\lib\wxctb-0.8.dll    /LIBPATH:..\lib @C:\DOCUME~1\JORDAN~1\LOCALS~1\Temp\nm1BC0.tmp
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: __thiscall fifo::fifo(unsigned int)" ([email protected]@[email protected]@Z) referenced in function "public: __thiscall wxIOBase::wxIOBase(void)" ([email protected]@[email protected])
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall fifo::items(void)" ([email protected]@@QAEIXZ) referenced in function "public: virtual int __thiscall wxSerialPort::Read(char *,unsigned int)" ([email protected]@@[email protected])
..\lib\wxctb-0.8.dll : fatal error LNK1120: 2 unresolved externals
Really you have only 2 errors. You just forgot to include file fifo.cpp in the project. I have attached fixed makefile.

Posted: Mon Jul 30, 2007 3:49 pm
by Lucky75
ok, i'm confused again :) what do i do with the makefile?

Posted: Mon Jul 30, 2007 3:54 pm
by tan
Lucky75 wrote:ok, i'm confused again :) what do i do with the makefile?
OK, you don't use makefiles :)
Do you have a VC project? Just add this file to the project:
CTB_ROOT/src/fifo.cpp

Posted: Mon Jul 30, 2007 4:11 pm
by Lucky75
Ok, I don't know why I am so confused, but lets start over. Assume I just downloaded wxctb. What do I do?

Thanks (Sorry for being slow today)