none
error LNK2001: unresolved external

    Question

  • Hello, I am migrating a desktop app to windows CE, compiling it with VisualStudio2005. I have solved many compilation and linking errors, but I still have the followings. I really appreciate any advise:


    1>almsrv.obj : warning LNK4217: locally defined symbol _strlwr
    imported in function _getAlarmInfoTable
    1>database.obj : warning LNK4217: locally defined symbol _strnicmp
    imported in function _fillinFecName
    1>toolkit.obj : warning LNK4049: locally defined symbol _strrev
    imported
    1>client.obj : error LNK2019: unresolved external symbol
    __imp____iob_func referenced in function _dumpConnectionList
    1>srvip.obj : error LNK2001: unresolved external symbol __imp__perror
    1>clnip.obj : error LNK2019: unresolved external symbol __imp__close
    referenced in function _doUDPConsumer
    1>syslib.obj : error LNK2001: unresolved external symbol __imp__getenv
    1>dblib.obj : error LNK2019: unresolved external symbol __imp__isspace
    referenced in function _strtrm
    1>syslib.obj : error LNK2001: unresolved external symbol
    __imp___localtime64
    1>iplib.obj : error LNK2019: unresolved external symbol __imp__read
    referenced in function _getUnixTime
    1>ntcmd.obj : error LNK2019: unresolved external symbol __imp__putch
    referenced in function _GetCommand
    1>ntcmd.obj : error LNK2019: unresolved external symbol __imp__getch
    referenced in function _GetCommand
    1>ntcmd.obj : error LNK2019: unresolved external symbol __imp__kbhit
    referenced in function _GetCommand
    1>ntcmd.obj : error LNK2019: unresolved external symbol __imp__exit
    referenced in function _quit
    1>toolkit.obj : error LNK2001: unresolved external symbol
    __imp___ctime64
    1>tine32.obj : error LNK2001: unresolved external symbol
    __imp___ftime64
    1>syslib.obj : error LNK2019: unresolved external symbol __imp__tzset
    referenced in function __SystemInit
    1>tine32.obj : error LNK2019: unresolved external symbol
    _CreateTineCycleWindow referenced in function _SystemSetCycleTimer
    1>LINK : error LNK2001: unresolved external symbol
    __DllMainCRTStartup@12

    Thank you very much,
    Andres
    Monday, August 27, 2007 9:48 AM

Answers

  • I think that some of the linking errors are because WindowsCE doens't support all time.h functions and also perror and getenv... but I don't know yet how to solve it.

    I guess you guessed right, some functions are just not supported, see: time.h On Windows CE

    It is still not clear how you migrated a desktop project to windows CE, but you can try to create a new smart device project and add your existing source files in, this way will save a lot of time to set settings and reduce potential problems. /MT may also helps but it is not recommended. Things turns to win ce side may completely different, maybe you can get better help in smart device related forums: http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=11&SiteID=1

     

    hope it helps

    rico

    Thursday, August 30, 2007 9:18 AM
    Moderator

All replies

  • Looks like a CRT clash. Perhaps you are using different CRT linkage in your exe and dll (assuming there's one) ?

     

    Monday, August 27, 2007 11:23 AM
    Moderator
  • As run time library I am using Multi-threaded DLL (/MD). This is the command line for the compilation:

     

    /Od /Ob1 /Os /I "..\lib" /I "..\.." /I "C:\Program Files\Microsoft Visual Studio 8\VC\include\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "MAKE_TINE32_DLL" /D "LINK_TINECLN32_DLL" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D "_MBCS" /GF /FD /EHsc /MD /GS- /Gy /fp:fast /GR /Fp".\Release/tine32.pch" /Fo".\Release/" /Fd".\Release/" /W0 /nologo /c /TC

     

    and the linking line:

     

    /VERBOSE /OUT:"DLL_Release/tine32.dll" /INCREMENTAL:NO /NOLOGO /DLL /MANIFEST:NO /NODEFAULTLIB:"oldnames.lib" /PDB:".\Release/tine32.pdb" /IMPLIB:".\Release/tine32.lib" /MACHINE:X86 /ERRORREPORTStick out tongueROMPT winsock.lib commctrl.lib aygshell.lib coredll.lib "C:\Program Files\Microsoft Visual Studio 8\VC\lib\kernel32.lib" "C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib\user32.lib"

     

    The configuration manager I have choosen is Release for STANDARSDK_500 (x86). I think that some of the linking errors are because WindowsCE doens't support all time.h functions and also perror and getenv... but I don't know yet how to solve it.

     

    Thank you for your advise,

    Andres

    Monday, August 27, 2007 12:27 PM
  • I guess you need to add crt library "libcmt.lib" in you link line.

    Wednesday, August 29, 2007 1:08 AM
  • I think that some of the linking errors are because WindowsCE doens't support all time.h functions and also perror and getenv... but I don't know yet how to solve it.

    I guess you guessed right, some functions are just not supported, see: time.h On Windows CE

    It is still not clear how you migrated a desktop project to windows CE, but you can try to create a new smart device project and add your existing source files in, this way will save a lot of time to set settings and reduce potential problems. /MT may also helps but it is not recommended. Things turns to win ce side may completely different, maybe you can get better help in smart device related forums: http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=11&SiteID=1

     

    hope it helps

    rico

    Thursday, August 30, 2007 9:18 AM
    Moderator
  • Wrong /MD  means using  MSVCRT.LIB    :)

    I am having the same srupid problem with  ZLIB  and  my compiler and linker options are correct

    So whats up with that ???? 

     

     

    Thursday, July 14, 2011 11:33 PM