This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Porting from Win C++ to linux slash vs backslash
- From: "Donald A. Dade" <ddade at digitalstatecraft dot com>
- To: barryg <bandegee at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 14 Nov 2006 16:56:27 -0800
- Subject: Re: Porting from Win C++ to linux slash vs backslash
- References: <7347745.post@talk.nabble.com>
Hi Barry,
I think you should change your source files. IIRC, the slashes are not
directory separators; that is merely how they happen map onto a
filesystem. The spec calls for forward slashes, regardless of how
directories are separated on a particular OS.
Don
barryg wrote:
> Our extensive C++ library that in the past was compiled using windows has the
> following type of #include statments ...
>
> #include <dir1\dir2\dir3\file.h>
>
> however the gcc command line expects slashes in the other direction...
> (Assume that the path is set to /home/yo and the file is in
> /home/yo/dir1/dir2/dir3/)
>
> gcc -I/home/yo/
>
> In our example gcc will not find the file.h unless we switch the \ to / in
> the #include. We'd have to change countless files to do this.
>
> We have tried
> -I'\home\yo\'
> -I"\home\yo\"
> -I\\home\\yo
> -I\\home\\yo\\
>
> We also looked through the gcc options for an option that says to flatten
> all directories.
>
> Is there a way to do this without changing all our source files?
>