Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: cannot find -lsfml-main:  (Read 136 times)

0 Members and 1 Guest are viewing this topic.

kelbon

  • Newbie
  • *
  • Posts: 1
    • View Profile
cannot find -lsfml-main:
« on: November 25, 2023, 11:53:13 pm »
I use vcpkg and trying to create github CI script, i install ALL libraries,

    steps:
      - uses: actions/checkout@v2

      - name: Install dependencies
        run: |
          sudo apt-get update                                  # SFML libs just for sure its installed
          sudo apt-get install ninja-build lld clang-15 libsfml-dev libx11-dev libxrandr-dev libxcursor-dev libxi-dev libudev-dev libgl1-mesa-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
          sudo ln -sf /usr/local/bin/ld /usr/bin/lld
      - name: Install vcpkg
        run: |
          git clone https://github.com/microsoft/vcpkg
          sudo ./vcpkg/bootstrap-vcpkg.sh
          sudo vcpkg install
      - name: Configure CMake
        run: |
          cmake . --preset ${{matrix.preset}}_ci
      - name: Build
        run:
          cmake --build build_${{matrix.preset}}

In CMake i found SFML package and add

set(GAME_LINK_LIBRARIES <...>
                        sfml-main sfml-system sfml-network sfml-graphics sfml-window sfml-audio
                        <...>)

And for some reason sfml-main not found. I dont understand anything. I even saw full command from ninja to clang, i dont understand why sfml-main here in such way, not like all other libs


/usr/bin/clang -g  CMakeFiles/game_main.dir/main.cpp.o -o game_main  libgamelib.a  -lsfml-main  vcpkg_installed/x64-linux/debug/lib/libsfml-network-s-d.a  vcpkg_installed/x64-linux/debug/lib/libsfml-graphics-s-d.a  vcpkg_installed/x64-linux/debug/lib/libfreetyped.a  vcpkg_installed/x64-linux/debug/lib/libbz2d.a  vcpkg_installed/x64-linux/debug/lib/libpng16d.a  vcpkg_installed/x64-linux/debug/lib/libz.a  -lm  vcpkg_installed/x64-linux/debug/lib/libbrotlidec.a  vcpkg_installed/x64-linux/debug/lib/libbrotlicommon.a  vcpkg_installed/x64-linux/debug/lib/libsfml-window-s-d.a  /usr/lib/x86_64-linux-gnu/libX11.so  /usr/lib/x86_64-linux-gnu/libXrandr.so  /usr/lib/x86_64-linux-gnu/libXcursor.so  /usr/lib/x86_64-linux-gnu/libGL.so  /usr/lib/x86_64-linux-gnu/libudev.so  -ldl  vcpkg_installed/x64-linux/debug/lib/libsfml-audio-s-d.a  vcpkg_installed/x64-linux/debug/lib/libsfml-system-s-d.a  -lpthread  -lrt  vcpkg_installed/x64-linux/debug/lib/libopenal.a  vcpkg_installed/x64-linux/debug/lib/libvorbisfile.a  vcpkg_installed/x64-linux/debug/lib/libvorbisenc.a  vcpkg_installed/x64-linux/debug/lib/libvorbis.a  vcpkg_installed/x64-linux/debug/lib/libogg.a  vcpkg_installed/x64-linux/debug/lib/libFLAC.a  vcpkg_installed/x64-linux/debug/lib/libBullet3Common.a  vcpkg_installed/x64-linux/debug/lib/libBulletInverseDynamics.a  vcpkg_installed/x64-linux/debug/lib/libBulletDynamics.a  vcpkg_installed/x64-linux/debug/lib/libBulletCollision.a  vcpkg_installed/x64-linux/debug/lib/libBulletSoftBody.a  vcpkg_installed/x64-linux/debug/lib/libLinearMath.a && :

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10782
    • View Profile
    • development blog
    • Email
Re: cannot find -lsfml-main:
« Reply #1 on: November 27, 2023, 03:09:02 pm »
sfml-main doesn't exist on Linux

On Windows it's created as a wrapper to fix the entry point when compiling for the window subsystem.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/