LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   slang linking probs in slackware (https://www.linuxquestions.org/questions/programming-9/slang-linking-probs-in-slackware-570854/)

iwasapenguin 07-20-2007 12:04 AM

slang linking probs in slackware
 
I'm an outright C/C++ newbie and have copied some code for slang & ncurses from "Linux Bible 2007" however when I go to compile the code it throws up "undefined reference to..." for all the functions that are not from stdio.h, followed by something about ld returning an error. I know that I copied the code right but the lib linking is going wrong.

gnashley 07-20-2007 06:53 AM

Since a couple of Slackware versions ago, there are two slang libraries in Slack. The oolder code you are using probably needs to be linked to -lslang1.

iwasapenguin 07-20-2007 07:15 AM

Okay, I get the bit about libs but how exactly do I implement that?

Nylex 07-20-2007 09:57 AM

When you compile your program, add "-lslang1" to the command you use to compile, which says to link the slang1 library. For example, if your source file was called slangexample.cpp, you'd use something like "g++ slangexample.cpp -o slangexample -lslang1".


All times are GMT -5. The time now is 03:09 AM.