Link error.

Hi,
I am building some excel import/export functions into a library. I get these link error message when I compiled the library:
[ilink32 Error] Error: Unresolved external 'InternetOpenW' referenced from C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils
[ilink32 Error] Error: Unresolved external 'InternetOpenUrlW' referenced from C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils
[ilink32 Error] Error: Unresolved external 'HttpQueryInfoW' referenced from C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils
[ilink32 Error] Error: Unresolved external 'InternetReadFile' referenced from C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils
[ilink32 Error] Error: Unresolved external 'InternetCloseHandle' referenced from C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils

It is weird for me, Anything I did wrong?

Thanks in advance!

Gene.

Hi,

This doesn't seem to be FlexCel related? The errors are in file C:\TMS\TMS COMPONENT PACK\BUILDER103RIO\WIN32\RELEASE\TMSDXE12.LIB|AdvUtils  which is not a part of FlexCel.

I don't really know much about tms pack, so it is probably best if we move this to the group where people developing it is, but fro a quick glance:

Those symbols are defined in Winapi.Wininet.pas:


function InternetOpen;                 external winetdll name 'InternetOpenW';

where winetdll is wininet.dll

So my guess is that you should link with "wininet.lib"  (or wininet.a if using clang compilers)

Can you try adding
#pragma link "wininet.lib"
somewhere in your code?  It should fix it.
You might also try to manually add wininet.lib as a linker dependency, as explained here: https://stackoverflow.com/questions/3956252/lnk2019-error-unresolved-external-symbol-in-c-program-using-internetopen-int

That #pragma link "wininet.lib" works for this.

I am wondering why I need to link this wininet.lib for a package I am building, but I don't need to link to this lib when building a exe.

Thanks!