Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 08-10-2005, 04:48 PM   #1
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:

#include <iostream>
#include <X11/Xlib.h>
int main()
	Display* d = XOpenDisplay (0);
	std::cout << "Hello world" << std::endl;
	return 0;
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
Registered: Oct 2003
Location: Canada
Distribution: Slackware
Posts: 340

Rep: Reputation: 30
Try this for kdevelop

Last edited by lowpro2k3; 08-10-2005 at 05:28 PM.
Old 08-10-2005, 05:29 PM   #3
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.


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
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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 PM.

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