This forum has been archived. All content is frozen. Please use KDE Discuss instead.

ncurses problem with kdevelop

Tags: None
(comma "," separated)
kushagra1276
Registered Member
Posts
5
Karma
0
OS

ncurses problem with kdevelop

Mon Aug 01, 2011 10:18 am
I don't know for some unknown reason i am unable to build a simple ncurses app in kdevelop.

getting the following output

/home/kushagra/projects/hello/build> make
Linking CXX executable hello
CMakeFiles/hello.dir/main.cpp.o: In function `main':
/home/kushagra/projects/C++/hello/main.cpp:4: undefined reference to `initscr'
/home/kushagra/projects/C++/hello/main.cpp:5: undefined reference to `printw'
/home/kushagra/projects/C++/hello/main.cpp:6: undefined reference to `refresh'
/home/kushagra/projects/C++/hello/main.cpp:7: undefined reference to `endwin'
collect2: ld returned 1 exit status
make[2]: *** [hello] Error 1
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2
*** Failed ***
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: ncurses problem with kdevelop

Tue Aug 02, 2011 5:15 am
Have you added the ncurses include path to the paths CMake instructs gcc/g++ to search?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
kushagra1276
Registered Member
Posts
5
Karma
0
OS

Re: ncurses problem with kdevelop

Tue Aug 02, 2011 9:21 am
I am new to kdevelop,cmake but i did that back when i was using codeblocks.By adding -lncurses to the other linker options.

How do i do that in kdevelop?

Thanks in advance. :)
kushagra1276
Registered Member
Posts
5
Karma
0
OS

Re: ncurses problem with kdevelop  Topic is solved

Wed Aug 03, 2011 10:08 am
Solved the problem thanks for advice.

Edited cmakecache in kate
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: ncurses problem with kdevelop

Sat Aug 06, 2011 4:09 am
The proper fix in this case would be to edit CMakeLists.txt, and add the following at the end:
Code: Select all
target_link_libraries(hello "-lncurses")


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]