cygwin path problem

  • Follow


Hi all,

I am doing some C / C++ programming in cygwin and I notice when I add
something to my path then try to compile, the gcc / g++ compiler
cannot find some files, even though they are in the directory I may
have just added to my path.

For example I have copied the example program from http://www.gtk.org/tutorial/c39.html
and when I compiled it, the compiler couldn't find gtk/gtk.h.

I thought to solve this I would have to add the path to gtk/gtk.h to
my path and so I did;

> PATH=$PATH:/usr/include/gtk-2.0

then I compiled again and while it found gtk.h it could not find a lot
of other gtk headers, such as gtktext.h.  However this and the other
files which were not found are also in /usr/include/gtk-2.0 and they
are included as <gtk/gtktext.h>.

I'm guessing that my path has not been set right but I'm fumbling in
the dark.  If someone could help it would be greatly appreciated.

John

0
Reply johnmmcparland 4/18/2007 10:52:33 AM

* johnmmcparland@googlemail.com [2007.04.18 10:52]:
> I am doing some C / C++ programming in cygwin and I notice
> when I add something to my path then try to compile, the
> gcc / g++ compiler cannot find some files, even though
> they are in the directory I may have just added to my
> path.

The compiler doesn't search the directories in the PATH
variable. These are searched by the *shell* to start
commands.

You tell the compiler where the include files are when you
invoke it. gcc uses the -I option. Check your compiler's
documentation otherwise.

> For example I have copied the example program from
> http://www.gtk.org/tutorial/c39.html and when I compiled
> it, the compiler couldn't find gtk/gtk.h.

That is a very bad way to describe a problem. Always include
the exact command you entered and the exact error message
you got, not *descriptions* of them.

You might also want to read this:

http://www.catb.org/~esr/faqs/smart-questions.html

-- 
JR
0
Reply Jean 4/18/2007 3:02:39 PM


1 Replies
168 Views

(page loaded in 1.117 seconds)

Similiar Articles:













7/29/2012 10:56:54 PM


Reply: