Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bringing Ncurses library problem to your attention. #370

Open
killrpenguin opened this issue Jan 29, 2025 · 0 comments
Open

Bringing Ncurses library problem to your attention. #370

killrpenguin opened this issue Jan 29, 2025 · 0 comments

Comments

@killrpenguin
Copy link

I am a newer developer and am not sure I understand enough about what is going on with your cmake setup to make a pull request for solving this very minor problem. I had a linking issue while trying to install glslViewer on my Gentoo Linux laptop and after researching and solving the problem I thought I'd bring it to your attention.

Ncurses is sometimes split in two libraries, llibncurses and libtinfo. During linking -lncurses was not enough to link the libraries to the glslViewer executable. This is the verbose output of the linking error I got during installation:

/usr/bin/cmake -E cmake_link_script CMakeFiles/glslViewer.dir/link.txt --verbose=1
/usr/lib/llvm/19/bin/clang++ -rdynamic CMakeFiles/glslViewer.dir/src/main.cpp.o
CMakeFiles/glslViewer.dir/src/core/sandbox.cpp.o
CMakeFiles/glslViewer.dir/src/core/sceneRender.cpp.o
CMakeFiles/glslViewer.dir/src/core/uniforms.cpp.o
CMakeFiles/glslViewer.dir/src/core/tools/console.cpp.o
CMakeFiles/glslViewer.dir/src/core/tools/record.cpp.o
CMakeFiles/glslViewer.dir/src/core/tools/text.cpp.o
CMakeFiles/glslViewer.dir/src/core/tools/tracker.cpp.o -o glslViewer
deps/vera/src/libvera.a -lncurses -lpthread -ldl deps/liblo/cmake/liblo.a -latomic -lavdevice -lavfilter -lavformat -lswscale -lavcodec -lswresample -lavutil deps/vera/deps/glfw/src/libglfw3.a -Wl,-Bstatic -lrt -Wl,-Bdynamic -lm
/usr/lib64/libGLX.so /usr/lib64/libOpenGL.so -ldl -lm
/usr/bin/x86_64-pc-linux-gnu-ld.bfd: CMakeFiles/glslViewer.dir/src/core/tools/console.cpp.o: undefined reference to symbol 'stdscr'
/usr/bin/x86_64-pc-linux-gnu-ld.bfd: /usr/lib64/libtinfo.so.6: error adding symbols: DSO missing from command line
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [CMakeFiles/glslViewer.dir/build.make:227: glslViewer] Error 1
make[2]: Leaving directory '/home/david/Programming/glslViewer/build'
make[1]: *** [CMakeFiles/Makefile2:234: CMakeFiles/glslViewer.dir/all] Error 2
make[1]: Leaving directory '/home/david/Programming/glslViewer/build'
make: *** [Makefile:156: all] Error 2

Some Linux distros include both libncurses and libtinfo automatically, apparently. On Gentoo Linux libtinfo was behind a useflag. https://stackoverflow.com/questions/51924114/ncurses-compiling-stdscr-lib64-libtinfo-so-6-error-adding-symbol stackoverflow post is what helped me solve my issue and apparently this was also the case at one time on Centos.

I found this:

NCURSES_LDFLAGS:INTERNAL=-lncurses;-ltinfo\

In my CMakeCache.txt file after failing to link the executable. I am guessing that this is a ncurses cmake variable that calls both linker flags when the -lncurses flag is called? I don't understand exactly what it means. In my specific case, this was not enough to get the project to link.

To get glslViwer to compile I added the -ltinfo linker flag to link.txt after the -lncurses flag. Hopefully this is helpful in some small way.

Thanks for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant