User forums > General (but related to Code::Blocks)

COM Port Programming

(1/1)

jjaco160:
I am trying to write a console application in Windows 2000 to talk to the serial port in C/C++.

I have been able to use Turbo C++ to talk to the serial ports using the dos.h inportb/outportb. I tried editing my main.cpp to include the dos.h from Turbo C, but the compiler says undefined reference to outportb/inportb.

I like the user friendliness of Codeblocks when writing code. Can someone tell me where I can get a serial/com port library that I can link to Codeblocks, or how to use the dos.h that Turbo C uses in Codeblocks?

Thanks,

JM

takeshimiya:
You can't access directly to the serial port in windows 2000 (or any windows in the post-98 era).

As for a library for accesing serial port, I don't know any multiplatform one, but just search in google.

But if you're using wxWidgets, try with wxCtb http://sourceforge.net/project/showfiles.php?group_id=51305&package_id=45182
located at wxCode http://wxcode.sourceforge.net

rudin:
CTB (or wxCTB) is a multiplatform library, and actually doesn't need any wxWidgets component. See more detail explanation at http://www.iftools.com/ctb.en.html. In Windows platform, it will be easier if we use MinGW compiler + MSYS (http://www.mingw.org) to build CTB as a static library.

HTH.

tiwag:
i've made a CB project file, just copy it in the root-ctb directory and change your pathes to wx-2.4.2 (this is needed as i know)

[attachment deleted by admin]

takeshimiya:
Thanks for the clarification, I'll take a look for my electronic projects then. :D

Navigation

[0] Message Index

Go to full version