LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Glew 2.1.0 (Slackware current), weird unresolved symbol woes. (https://www.linuxquestions.org/questions/slackware-14/glew-2-1-0-slackware-current-weird-unresolved-symbol-woes-4175660533/)

Geist 09-07-2019 11:40 PM

Glew 2.1.0 (Slackware current), weird unresolved symbol woes.
 
Got a little GL pet project that used to work just fine, but after a hiatus from it, and some updates to current , this happens:

Code:

|| /usr/bin/ld: CMakeFiles/spacemen.dir/src/renderer_sdl.cpp.o: undefined reference to symbol '__glewDeleteRenderbuffers'
|| /usr/bin/ld: /usr/lib64/libGLEW.so.2.1: error adding symbols: DSO missing from command line

Says the symbol isn't defined.

However:
Code:

readelf -Ws /usr/lib64/libGLEW.so | grep -i deleteren
    60: 00000000002ab7a0    8 OBJECT  GLOBAL DEFAULT  24 __glewDeleteRenderbuffers
  475: 00000000002a9898    8 OBJECT  GLOBAL DEFAULT  24 __glewDeleteRenderbuffersEXT

Compiler is: gcc-g++-9.2.0_multilib-x86_64-1alien, and all the linker settings *should* be okay.

Am I missing something here? This has me confused enough that I'm not even sure about additional infos I could be giving right now.

Skaperen 09-08-2019 12:50 AM

something is referencing (such as a function call) the name "__glewDeleteRenderbuffers". a quick google search suggests it may be a misspelling somewhere. if it isn't your code doing that, it may be hard for you to fix it. google for it yourself and look through those results.

orbea 09-08-2019 01:42 AM

Quote:

Originally Posted by Geist (Post 6034411)
Am I missing something here? This has me confused enough that I'm not even sure about additional infos I could be giving right now.

Its hard to help without seeing some source and being able to reproduce the problem.

trite 09-10-2019 04:11 AM

Start thinking about using GLAD instead of GLEW? I think GLEW will become deprecated (?)


target_link_libraries(GLEW GL GLU)

Geist 09-10-2019 11:01 PM

Quote:

Originally Posted by orbea (Post 6034426)
Its hard to help without seeing some source and being able to reproduce the problem.

I realize this, but the only GLEW code I am calling in that project is its generale "init" procedure.
I recreated the build environment several times, no avail (cmake 3.15), and while I found some 'cmake find' code specific to NVIDIA (their shader sdk had a custom find module for the various GL things, including GLEW and added some remarks in the script about how 3.15 required some workarounds), it doesn't seem to be the source of the problem.

I'm gonna try a bit more and if it won't work then I'm just gonna write up an isolated case for GLEW without as much context as the problematic project (SDL2, CEGUI, etc).
It just all worked before and the GLEW lib does seem to export the function as written, but yeah, I'll try a bit more, thanks for the replies so far.

Also, I'll look into GLAD, too, if things don't improve, thanks.

GazL 09-11-2019 04:54 AM

You can sometimes get that error when objects are passed to the linker in the wrong order. Try reordering them and putting -lGLEW after any objects that use it.

Geist 09-20-2019 03:07 PM

It turns out that, for some reason unknown to me (cause I'm ignorant about the inner workings) that
Code:

target_link_libraries(project project ${GLEW_LIBRARY} ... )
Which previously worked, now ended up with an empty variable, but
Code:

target_link_libraries(project project ${GLEW_LIBRARIES} ... )
Works, but it only shows a single library, not a plural.

So, yeah, weird.


All times are GMT -5. The time now is 08:57 AM.