LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2007, 12:04 AM   #1
iwasapenguin
Member
 
Registered: Jul 2007
Posts: 110

Rep: Reputation: 15
Unhappy 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.
 
Old 07-20-2007, 06:53 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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.
 
Old 07-20-2007, 07:15 AM   #3
iwasapenguin
Member
 
Registered: Jul 2007
Posts: 110

Original Poster
Rep: Reputation: 15
Okay, I get the bit about libs but how exactly do I implement that?
 
Old 07-20-2007, 09:57 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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".

Last edited by Nylex; 07-20-2007 at 09:58 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking two hard drives, one formatted with Slackware 10.2 the other Windows XP mrzack Linux - Software 9 08-07-2006 12:46 AM
Xlib linking probs nobby_trussin Programming 2 06-11-2005 06:03 AM
Some internet slang you may not know dave_starsky General 8 11-10-2004 04:06 PM
slackware rc.local probs Jamesn Linux - Newbie 3 09-08-2004 05:27 PM
Re:Running Maya in Slackware, linking problem... MunCH Slackware 4 02-10-2004 04:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration