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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gamaray

Pages: [1]
1
General / Re: CMake - SFML dependency issues
« on: March 26, 2023, 03:50:27 pm »
I see - so there is no way to omit this? It would be nice if people could just run the cmake script without any other steps - I could make a bash script I guess - would the CMAKE run fine on windows?

2
General / CMake - SFML dependency issues
« on: March 26, 2023, 12:38:16 pm »
I've started to word on the build scripts for one of my SFML projects - but I keep running into dependency problems with the modules: OpenAL, Vorbis and Flac - here is the error I get for a given dependency:

Code: [Select]
CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find FLAC (missing: FLAC_LIBRARY FLAC_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  build/_deps/sfml-src/cmake/Modules/FindFLAC.cmake:16 (find_package_handle_standard_args)
  build/_deps/sfml-src/cmake/Macros.cmake:279 (find_package)
  build/_deps/sfml-src/src/SFML/Audio/CMakeLists.txt:71 (sfml_find_package)

To fix these I need to install the lib[module]-dev packages for each dependency with apt, but is there a way I could integrate the installation of such dependencies into the cmake build files. Here is a basic CMakeLists.txt file which should just compile a simple "hello world" SFML project, what could I add to resolve these problems? :

 1 cmake_minimum_required(VERSION 3.18)
 2 project(SfmlBasic VERSION 1.0)
 3 include(FetchContent)
 4 set(BUILD_SHARED_LIBS ON)
 5 FetchContent_Declare(
 6  SFML
 7  GIT_REPOSITORY https://github.com/SFML/SFML.git
 8  GIT_TAG 2.5.1
 9 )
10 FetchContent_MakeAvailable(SFML)
11 set(CMAKE_CXX_STANDARD 11)
12 set(CMAKE_CXX_STANDARD_REQUIRED true)
13 add_executable(
14  SfmlBasic
15  main.cpp
16 )
17 target_link_libraries(
18  SfmlBasic
19  sfml-graphics
20 )


3
General / Re: Why does this link chain not work (SFML static link)
« on: October 24, 2022, 09:40:13 pm »
Ah thanks so much.
I'm surprised I never came across that page you linked before now.

4
General / Why does this link chain not work (SFML static link)
« on: October 24, 2022, 05:22:58 pm »
I'm having issues statically linking a program on windows 10.
I have built SFML with cmake and now need to statically compile my code.
To do this I am using a Makefile that looks like this:

all:
    g++ main.cpp -o wampus.exe -DSFML_STATIC -I C:\lib\SFML\include -L C:\lib\SFML\lib -lsfml-window-s -
    lsfml-system-s -lopengl32 -lwinmm -lgdi32 -lsfml-graphics-s -lfreetype -lsfml-audio-s -lopenal -lflac
    -lvorbisenc -lvorbisfile -lvorbis -logg

When I run mingw32-make all,  I get a pretty massive chain of errors, presumably because this link chain is not in the correct order. It there a way I can fix this?

Error snippet:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(SoundFileFactory.cpp.obj):SoundFileFactory.cpp:(.text+0x890): undefined reference to `sf::FileInputStream::FileInputStream()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(SoundFileFactory.cpp.obj):SoundFileFactory.cpp:(.text+0x89b): undefined reference to `sf::FileInputStream::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(SoundFileFactory.cpp.obj):SoundFileFactory.cpp:(.text+0x8d3): undefined reference to `sf::FileInputStream::seek(long long)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(SoundFileFactory.cpp.obj):SoundFileFactory.cpp:(.text+0x8ea): undefined reference to `sf::FileInputStream::~FileInputStream()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(SoundFileFactory.cpp.obj):SoundFileFactory.cpp:(.text+0xa2d): undefined reference to `sf::FileInputStream::~FileInputStream()'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:2: all] Error 1

5
General / Re: Why does this link chain not work (SFML static link)
« on: October 22, 2022, 07:49:46 pm »
Ah thank you!
Still the same issue however.
Though this time the error is shorter and only talks about graphics and audio.

6
General / Why does this link chain not work (SFML static link)
« on: October 22, 2022, 02:50:51 pm »
I'm having issues statically linking a program on windows 10.
I have built SFML with cmake and now need to statically compile my code.
To do this I am using a Makefile that looks like this:

all:
    g++ main.cpp -o wampus.exe -DSFML_STATIC -I C:\lib\SFML\include -L C:\lib\SFML\lib -lsfml-window-s -
    lsfml-system-s -lopengl32 -lwinmm -lgdi32 -lsfml-graphics-s -lfreetype -lsfml-audio-s -lflac -lvorbisenc
    -lvorbisfile -lvorbis -logg

When I run mingw32-make all,  I get a pretty massive chain of errors, presumably because this link chain is not in the correct order. It there a way I can fix this?

Error snippet:

C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(AudioDevice.cpp.obj):AudioDevice.cp:(.text$_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev[_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev]+0x11): undefined reference to `__imp_alcMakeContextCurrent'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(AudioDevice.cpp.obj):AudioDevice.cp:(.text$_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev[_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev]+0x23): undefined reference to `__imp_alcDestroyContext'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\lib\SFML\lib/libsfml-audio-s.a(AudioDevice.cpp.obj):AudioDevice.cp:(.text$_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev[_ZNSt8auto_ptrIN2sf4priv11AudioDeviceEED1Ev]+0x35): undefined reference to `__imp_alcCloseDevice'
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:2: all] Error 1



Pages: [1]
anything