Debug version of GameLift for custom server

Hi,

One of the servers we are looking to run on GameLift is our own custom C++ server, I’ve managed to integrate the Release version of the SDK with our server and I’m looking to build Debug binaries as well, however I’ve run into an issue.

I’ve build the SDK with the following command lines

cmake -G "Visual Studio 14 2015 Win64" ..
msbuild ALL_BUILD.vcxproj /p:Configuration:Debug

But when I add the built libs (from prefix\lib) I’m getting the following errors

1>libboost_system.lib(error_code.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in TestGLServerCPP.obj
1>libboost_system.lib(error_code.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in TestGLServerCPP.obj
1>MSVCRTD.lib(initializers.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\Development\CG\TestGLServerCPP\x64\Debug\TestGLServerCPP.exe : fatal error LNK1319: 2 mismatches detected

I’ve added the following libraries in the debug config of my server

  • libboost_system.lib
  • libboost_random.lib
  • libprotobufd.lib
  • sioclient.lib
  • aws-cpp-sdk-gamelift-server.lib
    (For release I needed to included the release built versions of these files)

Is there anything I need to do differently to get a debug version working?

Thanks

@Alistair - we would like to sync with you offline. Unfortunately, there is no way to privately message you on these forums. To get around that, could you post a fleet-id that you have been using (and region) and make sure your email address on your AWS account is up to date? From there we can give you a quick ping to get you going.

Hi @MisterGameLift, I have fleets in us-west-2, and one of the fleets id’s is fleet-c2baddf4-c391-43ae-90ea-da2459642c80

Thanks

Sorry you are running into these issues. I’ve filed a ticket to get someone to help you with this question/issue.

Managed to get a debug version building.

Had to change the External_boost.cmake file

    list(APPEND boost_with_args
"--layout=system" "toolset=${_toolset}" variant=release)

to

    list(APPEND boost_with_args
"--layout=system" "toolset=${_toolset}" variant=$<$<CONFIG:Debug>:debug>$<$<NOT:$<CONFIG:Debug>>:release>)

So that it used the debug version of boost in debug (have not verified fix for non debug/release configs).

One other note for anyone, don’t try and reuse the VS solution for both debug and release, Socket IO outputs to the same file path whether it’s debug or release, which means you can end up linking mismatched libs in the GameLift lib. If you try to rebuild instead, boost fails due to the way it extracts from the zip to thirdparty\ex_boost1234 and then copies to thirdparty\boost but if that folder already has files the copy fails.

As a result it’s easier to build debug and release to separate folders.

Hi,

I know this is rather a necro thread, but I’ve just suffered the same issue getting debug boost libs for the 3.1.7 release of the server SDK. It looks like the external_boost.cmake has an attempt at a fix for the issue, but it didn’t seem to actually work, whereas using the above fix from the OP has resulted in getting debug boost libs which link cleanly with my server binaries, so it might be worth checking the boost libs generated on debug again.

Tim

Hi @timmers_uk, when you run cmake can you try passing through -DCMAKE_BUILD_TYPE=Debug? You’ll get the proper debug boost libs when building with that option.

Hope that helps,

Ben