Page 1 of 1

POLINK: error: Unresolved external symbol '__imp____iob_func

Posted: Thu Feb 25, 2010 7:38 am
by IceSoft
Created a staticlib from the Chipmunk 2D physic engine 5.2.0 with VisualStudio 2008.

Using with PB I got this POLINK: error: Unresolved external symbol '__imp____iob_func'.

Re: POLINK: error: Unresolved external symbol '__imp____iob_func

Posted: Thu Feb 25, 2010 9:38 am
by Fred
This is not a PureBasic error, you need to patch the lib to remove the iob_func stuff. PB links with an old CRT to be compatiable with former Windows version which doesn't support that. To fix it, add this preprocessor line to your compiler (only on x86):

Code: Select all

/D__iob_func=__p__iob

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Fri Jun 11, 2010 12:42 pm
by zxtunes.com
Fred wrote:This is not a PureBasic error, you need to patch the lib to remove the iob_func stuff. PB links with an old CRT to be compatiable with former Windows version which doesn't support that. To fix it, add this preprocessor line to your compiler (only on x86):

Code: Select all

/D__iob_func=__p__iob

Somebody could solve this problem? :|

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Fri Jun 11, 2010 11:20 pm
by IceSoft
zxtunes.com wrote:
Fred wrote:This is not a PureBasic error, you need to patch the lib to remove the iob_func stuff. PB links with an old CRT to be compatiable with former Windows version which doesn't support that. To fix it, add this preprocessor line to your compiler (only on x86):

Code: Select all

/D__iob_func=__p__iob

Somebody could solve this problem? :|
What want you read?
There are two solutions:
1. The answer from Fred before
2. Or: Fred, dont use any longer outdated/older libs/dll. In this case: an old CRT.

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Sat Jun 12, 2010 10:56 am
by Fred
It's not going to change, just recompile your lib.

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Mon Jun 21, 2010 2:57 pm
by cas
I have similar problem. I compiled Lua 5.1.4 as static library (with __stdcall calling convention) and almost everything works fine. I get this error when calling luaopen_os() module:
---------------------------
PureBasic - Linker error
---------------------------
POLINK: error: Unresolved external symbol '__imp___difftime64'.

POLINK: error: Unresolved external symbol '__imp___gmtime64'.

POLINK: error: Unresolved external symbol '__imp___localtime64'.

POLINK: error: Unresolved external symbol '__imp___mktime64'.

POLINK: error: Unresolved external symbol '__imp___time64'.

POLINK: fatal error: 5 unresolved external(s).


---------------------------
OK
---------------------------
Does anyone know how to solve this?

Thanks

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Mon Nov 29, 2010 10:53 pm
by IceSoft
@Fred,
Will we get a up-to-date CRT lib with the next PB version?

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Fri May 06, 2011 9:15 am
by IceSoft
Short info (done with PB 4.60 Beta2):
I updated msvcrt.lib on the Purebasic\PureLibraries\Windows\Libraries and it works now.

It looks for me: Developer which are no longer supporting Win98 should update all old libs and polink.exe after release of PB 4.60 but better: The nativ 4.60 should be switch to the actual libs/exe/etc.

@PureBasic welcome on 2011 ;-) 1998 is past ;-)

Re: POLINK: error: Unresolved external symbol '__imp____iob_

Posted: Sat Mar 05, 2016 11:04 pm
by Keya
Fred wrote:This is not a PureBasic error, you need to patch the lib to remove the iob_func stuff. PB links with an old CRT to be compatiable with former Windows version which doesn't support that. To fix it, add this preprocessor line to your compiler (only on x86):

Code: Select all

/D__iob_func=__p__iob
I confirm this works! :) In Visual Studio i added it as Additional Commandline:
Image

So that got rid of the __iob_func error. :)

I was also experiencing two __security errors of the same nature. These were resolved by turning off Buffer Security Checks:
Image

All good then! :)

Thanks Fred for .LIB support and the whole world of possibilities it opens up!

Re: POLINK: error: Unresolved external symbol '__imp____iob_func

Posted: Sun Jan 22, 2023 6:45 pm
by superadnim
i know this is an old thread but i am also trying to get rid of this error in x64 any advice?
pb 5.7lts because right now i cannot port my code to the latest version too many changes for my project

using the commandline options in x64 doesnt seem to work in visual studio.

Re: POLINK: error: Unresolved external symbol '__imp____iob_func

Posted: Sun Jan 22, 2023 8:31 pm
by mk-soft
They have changed the parameters for the command line pbcompiler. You have to adjust these in Visual Studio.

Constants '-o, --constant,/CONSTANT Name=Value' -> '-co, --constant,/CONSTANT Name=Value'
Output '-e, --executable, /EXE' -> '-o, --output, /OUTPUT "filename"'

See PB-Help