我正在开发一个使用第三方库的共享库,该库使用对 conio lib 的调用,当我尝试使用 cygwin/g++ 构建它时,我收到未定义引用的错误
__cprintf
__stricmp
__splithpath
etc..
我链接我的库,
kernel32
wsock32
gdi32
我应该链接哪个库以便找到这些引用?
PS。我使用的第三方库是使用 Dev-Cpp 构建的
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.