🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

yay linker errors

Started by
2 comments, last by Mr_Fhqwhgads 17 years, 5 months ago
I'm trying to embed AngelScript into my program, but I'm getting these linker errors. I compiled the debug version using VC++ 05 express. Added the angelscriptd.lib to my project, added angelscript.h to my project and put the #define angelscript_dll_library_import and #include "angelscript.h" in my code. I tried to ignore LIBCMT.lib but I started getting problems with my other code. Sorry for the haste thread. 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: __wassert already defined in LIBCMT.lib(wassert.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtol already defined in LIBCMT.lib(strtol.obj) 1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _strtoul already defined in LIBCMT.lib(strtol.obj) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1>MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj) 1> Creating library c:\Projects\soc\soc\Debug\server\Server.lib and object c:\Projects\soc\soc\Debug\server\Server.exp 1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library 1>c:\Projects\soc\soc\Debug\server\Server.exe : fatal error LNK1169: one or more multiply defined symbols found
Blupix Games
Advertisement
Try to recompile AS with 05.
You need to check the project settings for code generation.

When creating a project with MSVC the default is single threaded statically linked runtime library, whereas for AngelScript the setting is multi threaded dynamically linked runtime library.

This is what is causing the conflicts. The setting must be the same for both the AngelScript project and your application project.

Also, don't define ANGELSCRIPT_DLL_LIBRARY_IMPORT unless you're using AngelScript from a DLL. If you're linking with AngelScript statically, you don't have to make any defines.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Sweet, thanks!
Blupix Games

This topic is closed to new replies.

Advertisement