473,326 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

gtk in cygwin

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

Apr 18 '07 #1
6 8861
johnmmcparland wrote:
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 [..]

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.
Somebody in 'gnu.g++.help' should be able to.
Apr 18 '07 #2

johnmmcparland wrote:
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
Not sure if this helps, but if you are trying to compile from an
application outside a Cygwin shell (i.e. Eclipse or other IDE), you
may need to add the path to your windows environment variables...
You'll need to add the to the windows directory where the executable
lives, not the directory structure used by Cygwin.

Apr 18 '07 #3
On Apr 18, 2:55 pm, johnmmcparland <johnmmcparl...@googlemail.com>
wrote:
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 fromhttp://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.
This is really somewhat platform specific, but on Unix and
Windows platforms, $PATH (or %PATH% in a Windows shell)
specifies where the system should look for executables (and
dynamically linked objects under Windows), and has nothing to do
with include files. The de facto standard for specifying
include file paths is the compiler option -I (or /I under
Windows); depending on the compiler you may or may not need a
space between the -I and the path name. (I think g++ accepts it
both ways, but other Unix compilers don't accept the space.)
Some compilers will also have a special environment variable
which will be added to the list---I think $INCLUDE (or
%INCLUDE%, if you're using the standard Windows shell) works
with VC++, for example---but this is not universal. The normal
procedure is to add the -I options to the flags passed to the
compiler in the makefile.

Note that having done this, you may need something similar for
the libraries. Here, systems differ more; under Unix, it is
generally possible to specify library paths using a -L option,
but I don't think this works under Windows. A more portable
solution is to just specify the library path completely.f

Finally, if the library is in fact a dynamically loaded object
(.DLL or .so), you might have to add something to a path
variable so that the executable will find it: Unix generally
uses a separate variable, LD_LIBRARY_PATH (and puts such objects
in a separate directory), whereas Windows just uses the standard
$PATH (and puts such objects in the same directory as the
executables).

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Apr 19 '07 #4
On Wed, 18 Apr 2007 05:55:11 -0700, johnmmcparland wrote:
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.
Don't know about Cygwin, but on other unix-like systems it is common to
use a utility called pkg-config:

http://pkgconfig.freedesktop.org/wiki/

to set up compiler/linker options for (amongst other libraries) gtk+. For
instance on my (linux) system, I get:

$ pkg-config --cflags gtk+
-I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/glib-1.2 -I/usr/lib64/glib/include

$ pkg-config --libs gtk+
-L/usr/X11R6/lib64 -lgtk -lgdk -lXi -lXext -lX11 -lm -lglib

so you can compile a program accessing gtk+ with something like:

g++ ... `pkg-config --cflags gtk+` ...

(note the back quotes) and link with:

g++ ... `pkg-config --libs gtk+` ...

(you may need to specify gtk+-2.0 if you have multiple versions of gtk+)

See also:

http://www.gtk.org/faq/#AEN409

HTH,

--
Lionel B
Apr 19 '07 #5
On 04/18/2007 07:55 AM, johnmmcparland wrote:
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
You would have to add /usr/include/gtk-2.0 to the compiler's include
path. For g++, that might be done by setting the -I option, e.g.:

g++ -I /usr/include/gtk-2.0 myprogram.cc -o myprogram

For other compiler's, the methods will be different. You should ask in a
newsgroup dedicated to your compiler.
--
Count the YOYOs:
http://home.earthlink.net/~mumia.w.18.spam/games_fever/
Apr 19 '07 #6
"johnmmcparland" <jo************@googlemail.comwrote in message
news:11*********************@o5g2000hsb.googlegrou ps.com...
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.
Off topic, but I believe it's because you're using a colon : instead of a
semi-colon ;

Try changing from
PATH=$PATH:/usr/include/gtk-2.0
to
PATH=$PATH;/usr/include/gtk-2.0
Apr 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jörg Maier | last post by:
Hey guys, i have a big problem using Tkinter and pexpect in cygwin. i try to program an winscp-like rsync Program for all posix Platforms (linux, macosx, cygwin). i got a class SslConnection...
4
by: Andreou Giannis | last post by:
Allthough it is possible to build modules in Python2.3.3 and distutils with cygwin, by running: setup.py build --compiler=cygwin (after i created the libpython23.a) running: setup.py install...
0
by: dw | last post by:
Pehaba, does anyone knows how to install MySQLdb on cygwin? - test device: MySQLdb 0.9.2.0 targz + cygwin 1.5.7-cr-0x9e + python 2.3.3 on cygwin + mysql 4.0.17 win32 - modified setup.py's...
6
by: Steve Holden | last post by:
Does anyone know the workaround for this error, encountered when trying to build PIL 1.1.4 from source under cygwin (Python 2.3.3)? running build_ext building '_imaging' extension gcc...
9
by: Mayer | last post by:
Hello: I'm running python under cygwin and need to find the drive letter. Cygwin has a way of calling my drives by a name relative to the Cygwin directory, so I get things like /home/user rather...
4
by: goberle | last post by:
I have installed the Cygwin package under WinXP. I am trying to insure that I have a reasonable development environment, and that things are working properly, by trying to compile and run the...
2
by: 63q2o4i02 | last post by:
Hi, I'm using python 2.4 and windows XP. I have two packages in the windows version of python in site-packages. They are PyVisa and ctypes, and both live in c:\python24\lib\site-packages ...
4
by: reachsamdurai | last post by:
Hello, Can you please let me know the procedure to reach db2 command prompt from a cygwin window (hence without using Start-> Run -> db2cmd method). I'm planning to write shell scripts which...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
8
by: Ale | last post by:
Hi! I need to compile with "Make" a source written for linux that I need to execute under a Win32 system. I tried to launch Make under cygwin, and it works fine, but it doesn't run under Win32...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.