LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 08-10-2005, 04:48 PM   #1
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Rep: Reputation: 15
Compiling this 3-line long program impossible in all IDE's


I have a C++ project in Anjunta. How do I compile this code:

Code:
#include <iostream>
#include <X11/Xlib.h>
int main()
{
	Display* d = XOpenDisplay (0);
	std::cout << "Hello world" << std::endl;
	return 0;
}
Quote:
undefined reference to 'XOpenDisplay'
I know about the "-L/usr/X11R6/lib -lX11" options. What I DON'T understand where I should put them.
It's the same in all IDE's, I've tried KDevelop, Eclipse, and now Anjunta, and I don't understand how to link a library in any of them. No matter what I do it won't work.
 
Old 08-10-2005, 05:25 PM   #2
lowpro2k3
Member
 
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Try this for kdevelop

http://www.kdevelop.org/mediawiki/in....so_library.3F

Last edited by lowpro2k3; 08-10-2005 at 05:28 PM.
 
Old 08-10-2005, 05:29 PM   #3
seriesx4
Member
 
Registered: Mar 2005
Location: Sweden
Posts: 64

Original Poster
Rep: Reputation: 15
Thank you for the reply.

It worked with 'usr/X11R6/lib64' instead of 'usr/X11R6/lib'



Anyway, it was my first library link in Linux so I didn't know if I was doing it right, good thing is: I did. Except for the wrong path.

Last edited by seriesx4; 08-10-2005 at 05:32 PM.
 
  


Reply



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
BASH: read every line in the files and use the line as parameters as another program tam3c36 Programming 10 12-07-2010 01:42 PM
Impossible to use autotools to compile a MySQL client program? rylan76 Linux - Software 0 10-08-2005 08:34 AM
Write long file name in a line shadkong Linux - General 2 04-09-2005 08:52 PM
vi error - line too long ranger225 Linux - Newbie 3 11-26-2004 08:41 AM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM

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

All times are GMT -5. The time now is 08:59 PM.

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