awneil
December 12, 2007, 2:55pm
1
Building a custom library is easy - just check the appropriate box in the Project Wizard.
But actually using this Library seems to be virtually impossible!
See: viewtopic.php?f=19&t=1436
Even having struggled through all the slings & arrows of Wavecom’s outrageous scripts, so that the project compiles and the Linker looks to the correct library, the Remote Mode Link fails abysmally with loads of warnings & errors; eg,
Linking…
LIBCD.lib(isctype.obj) : error LNK2005: __isctype already defined in MSVCRT.lib(MSVCR71.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in MSVCRT.lib(MSVCR71.dll)
LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib(MSVCR71.dll)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
LIBCD.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR71.dll)
LIBCD.lib(atox.obj) : error LNK2005: _atoi already defined in MSVCRT.lib(MSVCR71.dll)
LIBCD.lib(isctype.obj) : warning LNK4006: __isctype already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _malloc already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(dbgheap.obj) : warning LNK4006: _free already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCD.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in MSVCRT.lib(cinitexe.obj); second definition ignored
LIBCD.lib(winxfltr.obj) : warning LNK4006: ___CppXcptFilter already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
LIBCD.lib(atox.obj) : warning LNK4006: _atoi already defined in MSVCRT.lib(MSVCR71.dll); second definition ignored
Creating library ./rte/vc71/Debug/imei_chk_plugin_tst_rte.lib and object ./rte/vc71/Debug/imei_chk_plugin_tst_rte.exp
imei_chk_plugin_tst_rte.exp : warning LNK4070: /OUT:OATAPP.dll directive in .EXP differs from output filename ‘./rte/vc71/Debug/imei_chk_plugin_tst_rte.dll’; ignoring directive
LINK : warning LNK4098: defaultlib ‘MSVCRT’ conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib ‘LIBCD’ conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup
./rte/vc71/Debug/imei_chk_plugin_tst_rte.dll : fatal error LNK1120: 1 unresolved externals
Build log was saved at “file://c:\OpenAT\try\imei_chk_plugin_tst\rte\vc71\Debug\BuildLog.htm”
imei_chk_plugin_tst_rte - 11 error(s), 12 warning(s)
It seems that the Library has included all the runtine support, and the application is trying to include them all again!
The result is the same whether the library is included with full source, or via the plug-in hack…
The linker can be forced to ignore all these errors and warnings with the /FORCE option - but that seems rather rash!
So, what am I missing here?
This only applies to the Remote Mode (MSVS) build - the Target build (GCC) is fine.
I’m using Open-AT v3.12/3.13.