Unresolved External using CPort in CBuilderX

Anyone have any ideas how to resolve the following errors so I can compile my program successfully.
I know this is some type of linker problem, but if someone could give details on how this should be set up please let me know!!!!

Using the CPort Library for serial communications, I obtain the errors.

ilink32 -D -ap -Tpe -x -Gn -v -LC:\CBuilderX\lib  c0x32.obj windows\Debug_Build\untitled.obj,"C:\Documents and Settings\Administrator\cbproject\motor\windows\Debug_Build\motor.exe",,cw32.lib import32.lib,,
Turbo Incremental Link 5.65 Copyright (c) 1997-2002 Borland
Error: Unresolved external '_ComClose' referenced from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\CBPROJECT\MOTOR\WINDOWS\DEBUG_BUILD\UNTITLED.OBJ
Error: Unresolved external '_ComOpen' referenced from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\CBPROJECT\MOTOR\WINDOWS\DEBUG_BUILD\UNTITLED.OBJ
Error: Unresolved external '_comopen_errno' referenced from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\CBPROJECT\MOTOR\WINDOWS\DEBUG_BUILD\UNTITLED.OBJ
Error: Unresolved external '_ComHandshake' referenced from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\CBPROJECT\MOTOR\WINDOWS\DEBUG_BUILD\UNTITLED.OBJ
Error: Unresolved external '_ComPuts' referenced from C:\DOCUMENTS AND SETTINGS\ADMINISTRATOR\CBPROJECT\MOTOR\WINDOWS\DEBUG_BUILD\UNTITLED.OBJ
 ILINK32 exited with error code:
 2 ILINK32 exited with error code: 2


Regards,Nick.
nickyppAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jkrCommented:
Have you added the related library to your project (I assume it's called 'cport.lib')? This should solve your problem.
0
nickyppAuthor Commented:
Yes I have added "cports.lib" to the project already. Any more ideas????
0
jkrCommented:
Are you sure? It does not appear in the above linker command line. It could also be a problem with the C++ name mangling - try

extern "C" {
#include "cport.h"
}

to turn that off for the functions in that header file.

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

nickyppAuthor Commented:
I really dont know what to do. I cant add the cports.lib to the linker upon compile. How do I do that?

0
jkrCommented:
You could add

#pragma link "cport.lib"

to your code.
0
nickyppAuthor Commented:
No luck on that count either! I am installing Open Watcom C++, to see if I can work with that.
0
nickyppAuthor Commented:
AAAh ok, getting somewhere. Now I have another problem!

ilink32 -D -ap -Tpe -x -Gn -v -LC:\CBuilderX\lib  c0x32.obj windows\Debug_Build\untitled.obj,"C:\Documents and Settings\Administrator\cbproject\ConsoleApp2\windows\Debug_Build\ConsoleApp2.exe",,cw32.lib import32.lib,, Turbo Incremental Link 5.65 Copyright (c) 1997-2002 Borland
Fatal: Unsupported 16-bit segment(s) in module COM


any ideas here?
0
jkrCommented:
>>Fatal: Unsupported 16-bit segment(s) in module COM

Where did you download 'CPort' from? It seems that you have a 16bit lib there...

BTW, if you don't necessarily *have* to use CPort, be sure to check out http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwbgen/html/msdn_serial.asp ("Serial Communications in Win32")
0
nickyppAuthor Commented:
downloaded from programmers heaven. I would prefer to use CPort if poss.
0
jkrCommented:
Great god, have you checked the date of the .lib file in the archive? That is 9-Apr-1993. The only 32bit systems at that time were OS/2 and NT3.1. IOW: I strongly doubt that you'll be able to use it...
0
jkrCommented:
BTW, you also might find http://www.traverse.com/people/poinsett/bcbcomm.html ("Serial Communication with Borland C++ Builder") useful
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.