Skip to main content
15-Moonstone
August 24, 2017
Solved

Can this Toolkit linking nightmare be solved?

  • August 24, 2017
  • 1 reply
  • 2106 views

For any project using these convert functions like itoa I get LNK2019  unresolved external symbol __imp_itoa referenced in ...my programs.obj   So far the only solution I have found is not to use the functions gcvt, _ftoa, itoa, etc.  Thats hardly realistic.

 

I have stdlib.h included in the program.  My project settings for linker include the following. 

protk_dll_nu.lib
ucore.lib
udata.lib
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
comdlg32.lib
advapi32.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
odbc32.lib
odbccp32.lib
ws2_32.lib
mpr.lib
netapi32.lib
psapi.lib

 

I have several Toolkit programs that do not contain these functions that do number to string type conversions, and they seem to compile/link and run fine as DLL's.

Does anyone have any advice to offer?   I have literally spent DAYS looking into this!

 

Best answer by PARTHIBAN_K

Hello @msteffke I'm using following code to convert to string

 

  1. Convert integer to string
    ProCharLine iVal;
    int i = 15;
    ProTKSprintf(Val,"%d",i);
  2. Convert double to string
    ProCharLine dVal;
    double d = 15.5555;
    ProTKSprintf(Val,"%f",d);

 

 

 

 

1 reply

16-Pearl
August 29, 2017

Hello @msteffke I'm using following code to convert to string

 

  1. Convert integer to string
    ProCharLine iVal;
    int i = 15;
    ProTKSprintf(Val,"%d",i);
  2. Convert double to string
    ProCharLine dVal;
    double d = 15.5555;
    ProTKSprintf(Val,"%f",d);

 

 

 

 

msteffke15-MoonstoneAuthor
15-Moonstone
August 29, 2017

Thank You JK.   Yes as it turns out itoa and ftoa are not standard C functions.  They are available in MSDN stdlib.h, but they cannot link with our toolkit Dlls.   I guess I got used to using them in VB.   My C programs have successfully compiled for many years using itoa and ftoa, prior to my moving to Visual Studio Professional 2012.  Even in 2012 Studio Express they compiled.    So for my solution here I have changed to using the sprintf functions like you show.   Thanks!