#132 gcc -I option doesn't work

Known_bugs
closed-invalid
gcc (462)
2002-05-04
2002-05-03
James Evans
No

I am using gcc-2.95.3-20010828 (after gcc-2.95.3-
20011106 gave me the same errors) and the cygwin
environment with all of the MinGW stuff first in the
PATH (as per the website)

The error I keep getting is:
main.cpp:7: main.h: No such file or directory

given pwd='/cygdrive/c/home/src/test'

/************* begin main.h **************/
#ifndef __MAIN_H_
#define __MAIN_H_
#include <stdio.h>

const char *g_message = "Lets do the Bugaboo!!!";

#endif // __MAIN_H_

/************** end main.h ***************/
/************ begin main.cpp *************/
// a bunch of comments
#include <main.h>

int main(int argc, char *argv[])
{
printf("Message: '%s'\n", g_message);
return 0;
}
/************ end main.cpp *************/

compile cmd line (works):
$ g++ -I. -o test.exe main.cpp
or
$ g++ -I../test -o test.exe main.cpp
or
$ g++ -I../../src/test -o test.exe main.cpp
or
$ g++ -I../../../home/src/test -o test.exe main.cpp

compile cmd line (fails):
$ g++ -I../../../../c/home/src/test -o test.exe
main.cpp
or
$ g++ -I/cygdrive/c/home/src/test -o test.exe main.cpp
or
$ g++ -I`pwd` -o test.exe main.cpp
or
$ g++ -IC:\home\src\test -o test.exe main.cpp

Perhaps there is a flag I am missing specific to MinGW
gcc, but these are the results. I can reproduce them
regardless of shell and certan environment variables.
However if I use the cygwin gcc/g++ compiler, then
everything works fine.

Discussion

  • Earnie Boyd

    Earnie Boyd - 2002-05-04
    • status: open --> closed-invalid
     
  • Earnie Boyd

    Earnie Boyd - 2002-05-04

    Logged In: YES
    user_id=15438

    Not a MinGW bug.

    Although your problem may be interesting and causing you problems you wish answers to, it is not a problem with
    the MinGW runtime, w32api, GCC, binutils or msys. Your BUG report has therefore been deleted. If you feel that this
    needs further discussion then please post to mingw-users@lists.sf.net.

    Thanks for your interest in the MinGW Project,
    MinGW Project Administrators

     
  • Earnie Boyd

    Earnie Boyd - 2002-05-04

    Logged In: YES
    user_id=15438

    This isn't a bug, it's an environment problem.

    See http://www.mingw.org/msys.shtml for a minimal POSIX/BOURNE environment to execute configure and make
    from.

    The environment problem is, non-Cygwin programs don't understand Cygwin paths.

    Earnie.

     

Log in to post a comment.