Linking Conio functions in Cygwin

466 views Asked by At

I am working on a shared lib that uses a third party library which uses calls to conio lib, when I try to build it using cygwin/g++ I get errors to undefined references to

__cprintf
__stricmp
__splithpath
etc..

I link my lib againts,

kernel32
wsock32
gdi32

which lib should i link so that those references are found?

PS. Third party lib I am using is built using Dev-Cpp

1

There are 1 answers

0
JimR On

That looks like code from an old Borland library.

cprintf can be directly replaced with printf. It was an implementation of printf that printed directly to video memory in the DOS and OS/2 days.

stricmp is a case insensitive string compare. Use strcasecmp instead.

I do not know of a replacement for splitpath in Cygwin/Linux.

You might be able to find an implementation of it in findutils. You may also find a implementation of splitpath in the port of Turbovision to Linux or BSD.

With that said, splitpath on *nix like platforms should be nothing more than splitting the path string at the slashes (/) and verifying whether or not the last item in the path is a file/link/directory before setting the filename and extension parts of the path.