Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help needed in attempt to read from com.port!

15 views
Skip to first unread message

Haha

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
To all the kind C/C++ experts out there,

I'm trying to access the serial port using the following sample code:

#include <stdio.h>
#include <conio.h>

int main(void)
{
unsigned port = 0;
int value;
value = outp(port, 'C');
printf("Value %c sent to port number %d\n", value, port);
return 0;
}

However, the linker kept on prompting : unresolved external '_outp'.
I'm trying Borland C/C++5. Is there any parameters to be set for the linker
? Or is there any other functions recommanded instead for reading/writing to
comm ports?

Thanks a million in advance!

regards,

Toraso

Big Bamboo

unread,
Apr 11, 1999, 3:00:00 AM4/11/99
to
try
outportb(port,value)
value=inportb(port)
and set project -> platform ->dos (standart)
good luck
Haha a écrit dans le message <7epn0d$kif$1...@mawar.singnet.com.sg>...

Jack Klein

unread,
Apr 12, 1999, 3:00:00 AM4/12/99
to
On Sun, 11 Apr 1999 16:39:26 +0800, "Haha"
<dal...@mbox5.singnet.com.sg> wrote in comp.lang.c++:

> To all the kind C/C++ experts out there,
>
> I'm trying to access the serial port using the following sample code:
>
> #include <stdio.h>
> #include <conio.h>
>
> int main(void)
> {
> unsigned port = 0;
> int value;
> value = outp(port, 'C');
> printf("Value %c sent to port number %d\n", value, port);
> return 0;
> }
>
> However, the linker kept on prompting : unresolved external '_outp'.
> I'm trying Borland C/C++5. Is there any parameters to be set for the linker
> ? Or is there any other functions recommanded instead for reading/writing to
> comm ports?
>
> Thanks a million in advance!
>
> regards,
>
> Toraso

<Jack>

#1. 0 is not a valid com port address.

#2. This is all platform specific and off-topic in this newsgroup
altogether.

#3. Borland 5 can make no less than five different types of programs
and you didn't say which type you were trying to make.

#4. Open the online help page for the function you are trying to use.
Click on the Compatibility link at the top of the page. If will tell
you what types of programs the function is available in.

#5. Go to http://www.borland.com. The Developer Support link will
take you to a page where you can access FAQs and TIs (Technical
Information documents) for your compiler. The newsgroups button will
show you the Borland support groups and how to access them.

</Jack>
--
Do not email me with questions about programming.
Post them to the appropriate newsgroup.
Followups to my posts are welcome.


0 new messages