This is the mail archive of the cygwin@sourceware.cygnus.com 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]

RE: Weird behavior when using "-I" with gcc-2.95.2


Well, I am not actually trying to use "-I./" as a search path for
<sys/cdefs.h>.  I realize that the standard, default include path for the
compiler includes "/usr/i686-pc-cygwin/include".  That is where
<sys/cdefs.h> will/should be found.  However, when I try to use
"-Isomething" to find include files that my application needs that are not
located in the standard (i.e. POSIX, Ansi C, etc...), that is when I have
problems.

For instance, I may have a file "hello.h" which resides in the subdirectory
"./include".  In order to compile the source "hello.cpp" in the current
directory I would need to say:  g++ -I./include -c hello.cpp.  Any standard
headers like iostream.h, stdio.h, stdlib.h, etc... are found in the default
search path and non-standard headers like hello.h are found in my ./include
directory.  However, when I use "-I./include" as an option to the compiler I
begin getting strange errors such as the "invalid argument" error.  The only
way to correct this problem is to compile with: g++ -I/usr/include
-I/usr/i686-pc-cygwin/include -I./include -c hello.cpp.

I am tempted to grab the gcc-2.95.2 source and build a new version from
scratch.  I can't believe that should make a difference, but what else
should I try?

Larry


	-----Original Message-----
	From:	Bernard Dautrevaux [SMTP:Dautrevaux@microprocess.com]
	Sent:	Wednesday, April 26, 2000 11:29 AM
	To:	'Fontenot Larry A DLVA'; 'cygwin@sourceware.cygnus.com'
	Subject:	RE: Weird behavior when using "-I" with gcc-2.95.2

	> -----Original Message-----
	> From: Fontenot Larry A DLVA [mailto:FontenotLA@NSWC.NAVY.MIL]
	> Sent: Tuesday, April 25, 2000 9:04 PM
	> To: 'cygwin@sourceware.cygnus.com'
	> Cc: Fontenot Larry A DLVA
	> Subject: RE: Weird behavior when using "-I" with gcc-2.95.2
	> 
	> 
	> 
	> Well, the only solution I could come up with was to compile with
the
	> following:
	> 	g++ -I /usr/i686-pc-cygwin/include -I./ -c hello.cpp
	> 

	And what happens if you use -I. instead of -I./; "-Isomething" is
used to
	search "#include <file>" as "something/file", so using "-I./" to get
	"<sys/cdefs.h>" will try to look at ".//sys/cdefs.h" which is an
invalid
	path as "//" should only occur at the beginning of a path name under
	Losedows :-)

	HTH

			Bernard


	--------------------------------------------
	Bernard Dautrevaux
	Microprocess Ingéniérie
	97 bis, rue de Colombes
	92400 COURBEVOIE
	FRANCE
	Tel:	+33 (0) 1 47 68 80 80
	Fax:	+33 (0) 1 47 88 97 85
	e-mail:	dautrevaux@microprocess.com
			b.dautrevaux@usa.net
	-------------------------------------------- 

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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