[solved] linker issue (enet, VS, LNK2001)

[solved] linker issue (enet, VS, LNK2001)

Postby dimproject » 19 Nov 2013, 12:04

I have Visual Studio 2010 Express.
I thinking enet.lib (Release) built wrong way.
{l Code}: {l Select All Code}
1>------ Build started: Project: StuntRally, Configuration: Release Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(990,5): warning MSB8012: TargetPath(C:\stuntrally\proj\.\Release\StuntRally.exe) does not match the Linker's OutputFile property value (C:\stuntrally\proj\StuntRally.exe). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>  BulletCollision.lib(btStridingMeshInterface.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>     Creating library .\Release\StuntRally.lib and object .\Release\StuntRally.exp
1>main.obj : error LNK2001: unresolved external symbol __imp__enet_initialize
1>main.obj : error LNK2001: unresolved external symbol __imp__enet_deinitialize
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_peer_disconnect
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_peer_disconnect
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_peer_disconnect_now
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_destroy
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_destroy
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_service
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_service
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_packet_destroy
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_packet_destroy
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_connect
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_connect
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_address_set_host
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_address_set_host
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_broadcast
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_broadcast
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_packet_create
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_packet_create
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_peer_send
1>gameclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_create
1>masterclient.obj : error LNK2001: unresolved external symbol __imp__enet_host_create
1>StuntRally.exe : fatal error LNK1120: 13 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
dimproject
 
Posts: 212
Joined: 18 Jul 2013, 13:51

Re: Compiling issue

Postby CryHam » 19 Nov 2013, 18:14

Did you use Cmake ? or my vcproj file ?
I have in preprocessor defines this ENET_DLL
(full line is: WIN32;NDEBUG;_WINDOWS;ENET_DLL;_USE_MATH_DEFINES;)
this is in Project properties, Configuration, C/C++, Preprocessor.

But I'm building all dependencies as dll's for my vcproj.
I think in CMake they are build as static libs.

Enet in his Project properties has also ENET_DLL defined there.
And of course is using Runtime Library: Multi-threaded DLL (/MD) under Code generation.
User avatar
CryHam
SR Moderator
 
Posts: 1047
Joined: 25 Nov 2012, 08:40

Re: Compiling issue

Postby dimproject » 19 Nov 2013, 23:43

And AdditionalLibraryDirectories
(C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.0A\Lib;%(AdditionalLibraryDirectories))

AdditionalDependencies
(ws2_32.lib;WinMM.Lib;%(AdditionalDependencies))

Thanks! :)
dimproject
 
Posts: 212
Joined: 18 Jul 2013, 13:51

Who is online

Users browsing this forum: No registered users and 1 guest