Include paths

Posted on 1998-06-05
Last Modified: 2013-11-18
I'm using g++ to compile OpenGL apps, but because our system doesn't have GL I had to compile and install it into my user directory. The problem is that although the -L option works OK for the libs, I can't specify the path to the include files which need to be called as <Xm/Xm.h> or <GL/gl.h> in the code to be portable to my home linux system.

I've tried doing "-Ipath" and "-I- -Ipath" in the Makefile as it says on the man page for g++, but the compiler still can't find the includes.

Thansk for any help,
Question by:jhubbard
  • 3
  • 2

Accepted Solution

laeuchli earned 100 total points
ID: 1165285
Hi, James. I think I can help if you post what your includes path is. Bye.
LVL 11

Expert Comment

ID: 1165286
>> I can't specify the path to the include files which need to be called as <Xm/Xm.h> or <GL/gl.h> in the code [...]

You have to set your include path to one directory above the Xm.h and gh.l files.  You also may need to use multiple include paths, e.g., /foo/bar;/googoo/gigi;/and/another/one.

laeuchli, locking the question before providing a valid answer is EXTREMELY bad form and usually results in complaints to EE administration.

Expert Comment

ID: 1165287
Sorry, but I thought it was a good practice. I have seen many experts do it so I thought it was ok. Well sorry.
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 11

Expert Comment

ID: 1165288
>> I have seen many experts do it so I thought it was ok.
Not really.  Most of the experts that lock a question before providing an answer follow up with a really long and detailed explanation in a comment after 5-15 minutes (which is the time that takes them to type it in an organized way).

jhubbard, I don't know what the behavior of the "-I" argument of your compiler is but I guess it is cumulative.  In that case try: "-I<path-to-GL> -I<path-to-Xm> ..."

Author Comment

ID: 1165289
Thanks, I just found out that this system actually has OpenGL, but hidden in some obscure and arbitrary directory. You'd think experienced sysops could organise where to put libraries, but noooo......

Oh well, thanks anyway.
LVL 11

Expert Comment

ID: 1165290
You could have gotten your points back (since you found the answer yourself).  Too late now...

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question