stuck when trying to combine the api with my game engine.

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

yvanvds
Posts: 1
Joined: 30 Jul 2013, 13:08

stuck when trying to combine the api with my game engine.

Postby yvanvds » 30 Jul 2013, 17:14

Hello.

I'm trying to get started with the C++ api in VS2012. I can compile a program with the libs and header files included, but as soon as I add the libs for my game engine (Esenthel) I get these errors:

1>stdafx.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "public: static void __cdecl boost::asio::detail::op_queue_access::destroy<class boost::asio::detail::win_iocp_operation>(class boost::asio::detail::win_iocp_operation *)" (??$destroy@Vwin_iocp_operation@detail@asio@boost@@@op_queue_access@detail@asio@boost@@SAXPAVwin_iocp_operation@123@@Z)
1>stdafx.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'errno_ecat''(void)" (??__Eerrno_ecat@system@boost@@YAXXZ)
1>client.exe : fatal error LNK1120: 2 unresolved externals

I know this won't be an error in smartfoxserver as such, but perhaps something similar has come up with other engines? Anyway, I've tried comparing project settings and such, but I got a bit stuck here.

Thanks,

yvan
MBagnati
Posts: 126
Joined: 12 Feb 2013, 10:57

Re: stuck when trying to combine the api with my game engine

Postby MBagnati » 05 Aug 2013, 15:21

Hello,
I have prepared a test environment where:
  • I have installed the demo version of Esenthel.
  • I have used Esenthel Editor to export a sample Esenthel project towards Visual Studio 2012.
In this way, I have reproduced your problem.
I think that the issue is about the settings of Visual Studio project...seems that Esenthel project needs of static linkage for additional libraries.

To solve the issue I have done these steps:
  • Recompiled the Boost library using the command

    Code: Select all

          b2 -a toolset=msvc-11.0 threading=multi link=static runtime-link=static --with-system stage


    In folder [API path]\Core\BoostAsio\Windows\stage\lib will be created the files:

    libboost_system-vc110-mt-s-1_52.lib
    libboost_system-vc110-mt-sgd-1_52.lib

    These new couple of files is only a different build of already existing:

    libboost_system-vc110-mt-1_52.lib
    libboost_system-vc110-mt-gd-1_52.lib

    that were been created when you have compiled required libraries by command

    Code: Select all

    b2 -a toolset=msvc-11.0 threading=multi link=static runtime-link=shared --with-system stage


    as described by SmartFoxServer API documentation


  • Added the file libboost_system-vc110-mt-s-1_52.lib as Additional dependencies into Input section of Linker project settings

Please, can you try to follow the same path to check if it resolves your question?

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 34 guests