question

Jaime Ruiz-Borau Vizarraga avatar image
Jaime Ruiz-Borau Vizarraga asked

Error building C++ SDK in Linux

Hello

I'm following this Getting Started Guide for the C++ SDK on Linux and I got a bit stuck on the "Set up your first API call" section.

I cloned the XPlatCppSdk on a folder in my computer, and I created inside that same folder a "main.cpp" file and a "CMakeLists.txt" file just like the guide says. At first, the main.cpp file only had to print "Hello World", and I compiled and run that and worked.

But then I modified the contents inside "main.cpp" to match what the "Set up your first API call" section says, then I ran the command

cmake .

And afterwards, when i run the command

make

I get the following error

[ 50%] Building CXX object CMakeFiles/PlayFab_Test.dir/main.cpp.o

/home/xxx/src/XPlatCppSdk/main.cpp:3:10: fatal error: playfab/PlayFabClientDataModels.h: File or directory does not exist
 #include "playfab/PlayFabClientDataModels.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

make[2]: *** [CMakeFiles/PlayFab_Test.dir/build.make:63: CMakeFiles/PlayFab_Test.dir/main.cpp.o] Error 1

make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/PlayFab_Test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

What am I doing wrong? I think that maybe I put the main.cpp file in the wrong directory... This is what my cloned directory looks like right now (with all the files I created following the guide and created by cmake and make):

/home/xxx/src/XPlatCppSdk
├── build
├── CMakeCache.txt
├── CMakeFiles
├── cmake_install.cmake
├── CMakeLists.txt
├── code
├── com.playfab.xplatcppsdk.v141.autopkg
├── com.playfab.xplatxboxsdk.v141.autopkg
├── external
├── LICENSE
├── licenses
├── main.cpp
├── Makefile
├── PlayFab_Test
├── README.md
├── set-gitmodules.bat
└── test

Thanks in advance for the help


EDIT: I cannot either build from XPlatCppSdk/build/linux using the command

make all

after following the steps described in this file

Running "make all" gives me the following error on Ubuntu:

[...]
g++ -I ../../code -I ../../code/include -I ../../external/aria/lib/include/public -I ../../external/aria/lib -I ../../external/aria/bondlite/include/bond_lite -I ../../external/aria/bondlite/generated -include ../../test/TestApp/TestAppPch.h -D ENABLE_PLAYFABADMIN_API -D ENABLE_PLAYFABSERVER_API -o XPlatSocket.o -c ../../code/source/playfab/QoS/XPlatSocket.cpp
g++ -I ../../code -I ../../code/include -I ../../external/aria/lib/include/public -I ../../external/aria/lib -I ../../external/aria/bondlite/include/bond_lite -I ../../external/aria/bondlite/generated -include ../../test/TestApp/TestAppPch.h -D ENABLE_PLAYFABADMIN_API -D ENABLE_PLAYFABSERVER_API -o main.o -c ../../test/TestApp/TestApp.cpp
../../test/TestApp/TestApp.cpp: In static member function ‘static void PlayFabUnit::TestApp::Log(const char*, ...)’:
../../test/TestApp/TestApp.cpp:118:9: error: ‘_vsnprintf_s’ was not declared in this scope
         _vsnprintf_s(message, sizeof(message), format, args);
         ^~~~~~~~~~~~
../../test/TestApp/TestApp.cpp:118:9: note: suggested alternative: ‘vsnprintf’
         _vsnprintf_s(message, sizeof(message), format, args);
         ^~~~~~~~~~~~
         vsnprintf
make: *** [makefile:125: main.o] Error 1

I really don't know what to do, it seems that nothing works for building the SDK on Linux, any suggestions?

sdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
franklinchen avatar image
franklinchen answered

Hi @Jaime Ruiz-Borau Vizarraga, I saw Vicodex replied your issue:

Hello, our Linux build from makefile is currently broken and we are working on bringing it back, while also refactoring its test application and making it similar to one used in Windows build. The ETA for this is about two weeks.

We will track this issue and update news here. Thanks for reporting

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.