RS232 port and wxWidgets

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

RS232 port and wxWidgets

Post by Lucky75 »

Hey all,

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

Thanks!
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post by tan »

Last edited by tan on Wed Jul 04, 2007 6:57 pm, edited 1 time in total.
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
FireMail
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Jun 10, 2005 8:34 am
Location: Austria
Contact:

Post by FireMail »

hi there,

use the libwxctb - works very well for windows and unix systems, merely not available for mac
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post 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! :)
FireMail
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Jun 10, 2005 8:34 am
Location: Austria
Contact:

Post 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
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post by Lucky75 »

No, its VC++ 2005 Express
FireMail
Earned some good credits
Earned some good credits
Posts: 122
Joined: Fri Jun 10, 2005 8:34 am
Location: Austria
Contact:

Post by FireMail »

ok maybe you can use those files - place them all in the build directory!
Attachments
build.zip
(2.33 KiB) Downloaded 190 times
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post 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)" (??0fifo@@QAE@I@Z) referenced in function "public: __thiscall wxIOBase::wxIOBase(void)" (??0wxIOBase@@QAE@XZ)
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall fifo::items(void)" (?items@fifo@@QAEIXZ) referenced in function "public: virtual int __thiscall wxSerialPort::Read(char *,unsigned int)" (?Read@wxSerialPort@@UAEHPADI@Z)
..\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 ==========
krzysiek_t
Earned a small fee
Earned a small fee
Posts: 23
Joined: Tue Jul 11, 2006 1:36 pm
Location: Poland, Warsaw
Contact:

Re: RS232 port and wxWidgets

Post 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!
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post by Lucky75 »

Just a bump. Still stuck at this problem :(
C_Bastian
Earned some good credits
Earned some good credits
Posts: 102
Joined: Thu Sep 29, 2005 3:47 pm

Post 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
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post 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)" (??0fifo@@QAE@I@Z) referenced in function "public: __thiscall wxIOBase::wxIOBase(void)" (??0wxIOBase@@QAE@XZ)
wxctb_dll_serport.obj : error LNK2019: unresolved external symbol "public: unsigned int __thiscall fifo::items(void)" (?items@fifo@@QAEIXZ) referenced in function "public: virtual int __thiscall wxSerialPort::Read(char *,unsigned int)" (?Read@wxSerialPort@@UAEHPADI@Z)
..\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.
Attachments
makefile.zip
(1.23 KiB) Downloaded 88 times
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post by Lucky75 »

ok, i'm confused again :) what do i do with the makefile?
tan
wxWorld Domination!
wxWorld Domination!
Posts: 1471
Joined: Tue Nov 14, 2006 7:58 am
Location: Saint-Petersburg, Russia

Post 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
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10
Lucky75
Super wx Problem Solver
Super wx Problem Solver
Posts: 305
Joined: Thu May 03, 2007 3:54 pm

Post 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)
Post Reply