LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Compiling this 3-line long program impossible in all IDE's (https://www.linuxquestions.org/questions/programming-9/compiling-this-3-line-long-program-impossible-in-all-ides-351960/)

seriesx4 08-10-2005 04:48 PM

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.

lowpro2k3 08-10-2005 05:25 PM

Try this for kdevelop

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

seriesx4 08-10-2005 05:29 PM

Thank you for the reply.

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

:study:

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.


All times are GMT -5. The time now is 02:52 PM.