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 - lightspot21

Pages: [1]
1
General / OpenGL errors when statically linking SFML 2.5.1
« on: January 10, 2019, 03:49:06 pm »
Hello everyone,

I'm trying to link SFML statically for my project and when trying to compile I get errors that look like they're OpenGL's fault. The library is compiled from source (latest version of git repo's master branch)

What I'm talking about is this:

Scanning dependencies of target SFMLTest
[ 50%] Building CXX object CMakeFiles/SFMLTest.dir/main.cpp.o
[100%] Linking CXX executable SFMLTest
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::~GlxContext()':
GlxContext.cpp:(.text+0x2b): undefined reference to `glXGetCurrentContext'
GlxContext.cpp:(.text+0x3d): undefined reference to `glXDestroyContext'
GlxContext.cpp:(.text+0x71): undefined reference to `glXDestroyPbuffer'
GlxContext.cpp:(.text+0xa9): undefined reference to `glXMakeCurrent'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::makeCurrent(bool)':
GlxContext.cpp:(.text+0x129): undefined reference to `glXMakeCurrent'
GlxContext.cpp:(.text+0x150): undefined reference to `glXMakeContextCurrent'
GlxContext.cpp:(.text+0x168): undefined reference to `glXMakeCurrent'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::~GlxContext()':
GlxContext.cpp:(.text+0x19b): undefined reference to `glXGetCurrentContext'
GlxContext.cpp:(.text+0x1ad): undefined reference to `glXDestroyContext'
GlxContext.cpp:(.text+0x1f1): undefined reference to `glXDestroyPbuffer'
GlxContext.cpp:(.text+0x221): undefined reference to `glXMakeCurrent'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::selectBestVisual(_XDisplay*, unsigned int, sf::ContextSettings const&)':
GlxContext.cpp:(.text+0x537): undefined reference to `glXGetConfig'
GlxContext.cpp:(.text+0x55b): undefined reference to `glXGetConfig'
GlxContext.cpp:(.text+0x570): undefined reference to `glXGetConfig'
GlxContext.cpp:(.text+0x585): undefined reference to `glXGetConfig'
GlxContext.cpp:(.text+0x59d): undefined reference to `glXGetConfig'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o):GlxContext.cpp:(.text+0x5b5): more undefined references to `glXGetConfig' follow
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::createSurface(sf::priv::GlxContext*, unsigned int, unsigned int, unsigned int)':
GlxContext.cpp:(.text+0xc8b): undefined reference to `glXQueryVersion'
GlxContext.cpp:(.text+0xcba): undefined reference to `glXChooseFBConfig'
GlxContext.cpp:(.text+0xce0): undefined reference to `glXGetVisualFromFBConfig'
GlxContext.cpp:(.text+0xd6a): undefined reference to `glXCreatePbuffer'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::createContext(sf::priv::GlxContext*)':
GlxContext.cpp:(.text+0xf50): undefined reference to `glXQueryDrawable'
GlxContext.cpp:(.text+0xf97): undefined reference to `glXChooseFBConfig'
GlxContext.cpp:(.text+0x1071): undefined reference to `glXQueryVersion'
GlxContext.cpp:(.text+0x115c): undefined reference to `glXChooseFBConfig'
GlxContext.cpp:(.text+0x1180): undefined reference to `glXGetVisualFromFBConfig'
GlxContext.cpp:(.text+0x1290): undefined reference to `glXGetVisualFromFBConfig'
GlxContext.cpp:(.text+0x12fb): undefined reference to `glXMakeCurrent'
GlxContext.cpp:(.text+0x1318): undefined reference to `glXCreateContext'
GlxContext.cpp:(.text+0x1685): undefined reference to `glXMakeCurrent'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::GlxContext(sf::priv::GlxContext*)':
GlxContext.cpp:(.text+0x1a93): undefined reference to `glXQueryVersion'
GlxContext.cpp:(.text+0x1acb): undefined reference to `glXChooseFBConfig'
GlxContext.cpp:(.text+0x1aff): undefined reference to `glXGetVisualFromFBConfig'
GlxContext.cpp:(.text+0x1b74): undefined reference to `glXCreatePbuffer'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::GlxContext(sf::priv::GlxContext*, sf::ContextSettings const&, unsigned int, unsigned int)':
GlxContext.cpp:(.text+0x1f8b): undefined reference to `glXQueryVersion'
GlxContext.cpp:(.text+0x1fc3): undefined reference to `glXChooseFBConfig'
GlxContext.cpp:(.text+0x1ff1): undefined reference to `glXGetVisualFromFBConfig'
GlxContext.cpp:(.text+0x206d): undefined reference to `glXCreatePbuffer'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::display()':
GlxContext.cpp:(.text+0xdd): undefined reference to `glXSwapBuffers'
/usr/local/lib/libsfml-window-s.a(GlxContext.cpp.o): In function `sf::priv::GlxContext::getFunction(char const*)':
GlxContext.cpp:(.text+0x3f1): undefined reference to `glXGetProcAddressARB'
/usr/local/lib/libsfml-window-s.a(GlxExtensions.cpp.o): In function `sfglx_LoadFunctions':
GlxExtensions.cpp:(.text+0x1d8): undefined reference to `glXQueryExtensionsString'
collect2: error: ld returned 1 exit status
CMakeFiles/SFMLTest.dir/build.make:101: recipe for target 'SFMLTest' failed
make[3]: *** [SFMLTest] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/SFMLTest.dir/all' failed
make[2]: *** [CMakeFiles/SFMLTest.dir/all] Error 2
CMakeFiles/Makefile2:84: recipe for target 'CMakeFiles/SFMLTest.dir/rule' failed
make[1]: *** [CMakeFiles/SFMLTest.dir/rule] Error 2
Makefile:118: recipe for target 'SFMLTest' failed
make: *** [SFMLTest] Error 2


I'm trying to compile the first sample script from "SFML and Linux" tutorial at the Learn section of the site. It works correctly when linking dynamically.

My CMakeLists.txt if anyone's interested:

cmake_minimum_required(VERSION 3.13)
project(SFMLTest)

set(CMAKE_CXX_STANDARD 11)
set(SFML_STATIC_LIBRARIES true)

find_package(SFML REQUIRED window audio graphics system network)

set(SFML_LINKS sfml-audio sfml-window sfml-graphics sfml-system sfml-network)

add_executable(SFMLTest main.cpp)
target_link_libraries(SFMLTest ${SFML_LINKS})


Thanks in advance.

2
General / Re: Linking the SFML modules in Code::Blocks Linux
« on: July 07, 2018, 10:16:29 am »
Well, here's a screenshot of what appears to be available on my distro's repos:


Any ideas on what packages should I be looking to install?

3
General / Linking the SFML modules in Code::Blocks Linux
« on: July 06, 2018, 10:58:15 am »
Hello,

I've been trying to link the SFML 2.4 modules via Project - Build Options - Debug tab - Linker options, but all I get when compiling is 'cannot find -lsfml-graphics-d', 'cannot find -lsfml-window-d', 'cannot find -lsfml-system-d', 'error: ld returned 1 exit status'.

The same happens with the 's'-suffixed ones under the Release tab, for which I've linked all dependencies and defined the SFML_STATIC macro in #defines.

The project compiles correctly if I don't use any suffixes. Could someone help me on this, as the Code::Blocks guide is for Windows and library linking is not the same?

Thanks in advance.

PS: If it's any help, I'm using BunsenLabs Helium (Debian derivative) as my distro. The library is installed from Debian's repos.

Pages: [1]
anything