This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin and gtk+ compiling problems still


On 1/22/2010 5:28 AM, Richard Dickinson wrote:
> Hi
> I am still not able to compile gtk+ or gtkmm programs in cygwin on my Vista
> machine & I would
> appreciate some advice on how to do this. I have already posted recently
> about this and I had a 
> reply but as yet no further help to my follow up
> (http://cygwin.com/ml/cygwin/2010-01/msg00850.html). 
> 
> I have been trying to get this sorted for many days now and this is becoming
> frustrating. 
> My latest attempt was this (again unsuccessful as shown):
> 
> Dad@Dad-PC
> /cygdrive/c/RPD_Programming/RPD_Gtk_Gimp_toolkit/helloworld/www_gtk_o
> rg_hw_tutorial
> $ cc `pkg-config --cflags --libs gtk+-2.0` helloworld.c -o helloworld
> : No such file or directory
> cygwin warning:
>   MS-DOS style path detected: C:/gtkmm/include/gtk-2.0
>   Preferred POSIX equivalent is: /cygdrive/c/gtkmm/include/gtk-2.0
>   CYGWIN environment variable option "nodosfilewarning" turns off this
> warning.
>   Consult the user's guide for more details about POSIX paths:
>     http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

I'm no expert at compiling GTK+ applications, but the cygwin warning you
see there tells me that you have a program in your PATH being used by
your command which is returning Windows-style paths.  Cygwin programs
won't do this, so you must have a mixed environment.  You should scrub
your PATH so that you only have Cygwin programs available, most
especially cc and pkg-config.

Resolving that issue may resolve the other issue I see:

: No such file or directory

This sort of output is usually caused by passing in a line of text with
DOS (CRLF) line endings rather than Unix (LF) line endings to a Cygwin
program.  What happens in this case is that the line is a path and the
Cygwin program tries to use it including the CR.  This is obviously not
going to work since the path doesn't really include the CR, so the
Cygwin program will complain that the path does not exist.  When it does
that the line is printed, but the carriage return character (CR) backs
up the cursor to the beginning of the line at which point the error
message, everything past and including the colon you see, is printed
which overwrites the first part of the line.

You can get a better idea of what's really being printed by running your
command as follows:

cc `pkg-config --cflags --libs gtk+-2.0` \
helloworld.c -o helloworld >compile.out 2>&1

Be sure to include the trailing backslash on the first line.  This
command will cause all of the output to be sent to compile.out which you
may then open with a text editor to see the exact text, including the
text which is being overwritten when sent to the terminal.

> I will also add that I would eventually like to set up my Vista cmd prompt
> so I can compile gtk+ and gtkmm directly from cmd prompt
> but my first step is to get this cygwin bash shell compiling to work.

You can get this to work, but you may end up spending more effort than
it's worth to be honest.  You're probably more comfortable with the cmd
shell than bash at the moment, but believe me that once you learn to use
bash, you'll wonder how Microsoft ever got away with shipping cmd as
their only shell for all these years. :-)  There are many bash resources
including howtos, FAQs, and even the full bash manual
(http://www.gnu.org/software/bash/manual/) just a quick google away.

Good luck.

-Jeremy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]