"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
gmake[1]: Entering directory `/home/josh/Projects/Testing grounds/kbhit'
"/usr/bin/gmake" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/kbhit
gmake[2]: Entering directory `/home/josh/Projects/Testing grounds/kbhit'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++ -c -g -Iusr/include/ -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/kbhit build/Debug/GNU-Linux-x86/main.o -L/usr/include/ncurses -L/usr/include/ncurses6 -L/usr/include/ncursesw -lncurses.h
/usr/lib64/gcc/x86_64-suse-linux/4.6/../../../../x86_64-suse-linux/bin/ld: cannot find -lncurses.h
collect2: ld returned 1 exit status
gmake[2]: *** [dist/Debug/GNU-Linux-x86/kbhit] Error 1
gmake[2]: Leaving directory `/home/josh/Projects/Testing grounds/kbhit'
gmake[1]: *** [.build-conf] Error 2
gmake[1]: Leaving directory `/home/josh/Projects/Testing grounds/kbhit'
gmake: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 477ms)
It appears it cannot find ”lcurses” but I never defined for it to look for lcurses. I actually added ncurse libraries to be linked.
I have navigated to /usr/include/ncurses and there is in fact the files there should be.
I don’t fully know what is going on through this whole compiling stuff it is a little beyond me. I just know that I was told to link the libraries I need. ncurses.h is there this is how I have my code.
#include <iostream>
#include <ncurses/ncurses.h>
using namespace std;
bool kbhit()
{
int ch = getch();
if(ch != ERR)
{
ungetch(ch);
return true;
}
return false;
}
int main() {
while(!kbhit())
{
cout << "no input";
}
cout << "Mummy, it's over.";
return 0;
}
Any help would be pleasantly welcome; I am lost.
this is not a problem with your c++ code, it’s more a problem with your build enviroment, are you using netbeans IDE?
This code as far as I can tell does not require ncruses at all, and the link directive that NetBeans? has set up for you points to a ncruses.h file where it should be something like this “-Wl,-lncurses” or only “-lncurses”. So a guess is that somewhere in netbeans where you should point out the library name you have written ncruses.h instead of only ncruses(i think, not sure)
try to ask pkg-config what parameters for ncurses should be on your machine “pkg-config –libs ncurses” and “pkg-config –cflags ncurses”