Linux compilation help -- vcpkg configuration

Heyo,

I’m looking to compile beammp for linux following the docs here: docs.beammp.com - getting started But I’m getting caught up on the cmake compilation using vcpkg.

The furthest I’ve gotten is cmake configuring with a warning, and failing to build. I have installed a vcpkg entry to /usr/local/apps/vcpkg, and as far as I can tell configured it? I’m mostly just used to building on rhel without vcpkg, so I’m a bit out of my depth here.

I’ve used vcpkg to provide httplib, which cmake was complaining about. I did this by setting VCPKG_ROOT appropriately and running vcpkg install cpp-httplib, that issue seems to have been resolved. At this point it seems to be a makefile issue, and I don’t really know how to fix that.

I’m building v2.4.0 on popos 22.4 LTS, vcpkg is just running latest per Microsoft’s docs*. The output of the (slightly modified as I don’t have any vcpkg in my home dir) commands from the docs is below.

*As a new user I can only put one link, but I’m using their " Install and use packages with CMake" which has a vcpkg installation section at the top.

zulu@pop-os:/usr/local/apps/beammp$ cmake -DCMAKE_BUILD_TYPE=Release . -B bin -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE

-- Build files have been written to: /usr/local/apps/beammp/bin
zulu@pop-os:/usr/local/apps/beammp$ cmake --build bin --parallel --config Release
Consolidate compiler generated dependencies of target Launcher
[  5%] Linking CXX executable BeamMP-Launcher
/usr/bin/ld: ../vcpkg_installed/x64-linux/lib/libcurl.a(openssl.c.o): in function `ossl_connect_step2':
openssl.c:(.text+0x2b6e): undefined reference to `SSL_get0_group_name'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/Launcher.dir/build.make:344: BeamMP-Launcher] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/Launcher.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
zulu@pop-os:/usr/local/apps/beammp$ 

Any help as to how to configure vcpkg, or any installation dependencies I could be missing would be appreciated.

in my personal experience, installing vcpkg as a package was a pain in the ■■■■■■■ ■■■ - it didnt work or told me to ■■■■ off, basically

instead, use the path for “DCMAKE_TOOLCHAIN_FILE=” of where you cloned vcpkg to, e.g. ~/Downloads/

but first, install all the necessary build packages:

NOTE: updated info + nixOS specific can be found here (click)

autoconf
automake
make
cmake
glibc
gcc
pkg-config

(names may vary)

cd Downloads
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh --disableMetrics

^ your vcpkg is now ready

cd to BeamMP-Launcher (that you also cloned)

cmake . -B bin -DCMAKE_TOOLCHAIN_FILE=~/Downloads/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux

^ toolchain path must be to your freshly cloned vcpkg!

cmake --build bin --parallel --config Release

^ final binary build

it’s pretty sneaky, this one, i had the same situation. frantically googling “how to setup vcpkg for compiling” and ■■■■. were you to try to blindly follow the instructions from beamMP’s github or the beamMP on linux guides:

CMake Error at /usr/share/cmake/Modules/CMakeDetermineSystem.cmake:152 (message):
  Could not find toolchain file: ~/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:3 (project)


CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

the official instructions DO need to be more precise, though. it’s a miracle that we even have a linux userbase for a game that runs only on X11. but that’s a story for another time…

EDIT: months later i realise that OP had a different problem this whole time, but i say, i roll with this one anyway, cos its still kinda relevant, right, but ■■■■, no one told me that i messed up, haha =) ahh, its alright, anyway… it looks like a misconfigured vcpkg anyway, cos ld couldnt symlink some openssl ■■■■, looks like, and yeah, when you clone vcpkg, its supposed to download a bunch of other stuff with it (so that it doesnt use system/host’s packages), including openssl, but when you install vcpkg as a package from the repository, you use your own openssl, so yeah. sorry, i just had to doublecheck myself from the future, cos people read and follow these, apparently

Those are the same instructions I gave (short adding vcpkg as an environment variable) and in turn the same as the official docs.

Edit:

Nvm I was fixated on the vcpkg command and missed the difference in the cmake command.

1 Like