Having trouble linking curses library with CodeBlocks.

I'm not sure why this is giving me so much trouble. I originally worked on a project that linked the curses library, reformatted my computer and I cannot get it to link again.

http://i.imgur.com/5JQlCp3.png

Under Project Build Options > Linker Settings I have clearly linked to the library. But I get the error messages 'undefined reference to initscr'. What more is there that I can do? If it's not seeing the library I don't see what more I can do.
Not familiar with C::B.

The only thing I might suggest is making sure your search paths have the correct linker search paths in there (equivalent to the -L flag on most compilers).

I don't think I'd typically expect to see the path in the libs like that.
For e.g., I'd not have:
clang++ -std=c++11 myProg.cpp -o myProg -lsomeLib/someLib -I someLib

(I'm not even sure that works).

I'd have:
clang++ -std=c++11 myProg.cpp -o myProg -LsomeLib -lsomeLib -I someLib


If there's some way that you could see the actual compiler/linker calls (say, in a console output) then that'd help.

Other than that, I'm not sure. Perhaps use a nametool to make sure the symbol exists. Oh, I rarely code on Windows, but I remember way back using SFML and that required compiler flags for linking to static versions of the lib. May be another thing worth checking.

Good luck.
Actually I tried it straight through a compiler instead of codeblocks and ran in to the same issue with the library but a bit more info.

1
2
3
4
5
6
D:\HDD Documents\HDD Users\Stefan\Documents\Programming\C++\Side Projects\testproj>g++ -std=c++11 test.cpp -Iinclude -Llib -lpdcurses
C:/Program Files/mingw-w64/x86_64-6.1.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib/pdcurses.lib when searching for -lpdcurses
C:/Program Files/mingw-w64/x86_64-6.1.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib/pdcurses.lib when searching for -lpdcurses
C:/Program Files/mingw-w64/x86_64-6.1.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible lib\pdcurses.lib when searching for -lpdcurses
C:/Program Files/mingw-w64/x86_64-6.1.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lpdcurses
collect2.exe: error: ld returned 1 exit status


The library seems to be incompatible for some reason. When I reformatted my computer I upgraded from Windows 7 to 10, could there be an incompatibility issue with the OS?
Last edited on
Topic archived. No new replies allowed.