-
make, gcc path issue.
I feel retarded asking this, but I've never really written code under windows before, and I'm a little confused.
If I run this command:
Code:
gcc -o flasher flasher.c -IC:\cygwin\usr\include\mingw
I get a linking error. (I'm a little confused as to why that happens since I have all of the directories in question in my path, but that's a separate issue.)
However, if I run that exact same command inside of a makefile:
Code:
all:
gcc -o flasher flasher.c -IC:\cygwin\usr\include\mingw
it tells me that it can't find conio.h and doesn't get to the linking at all.
Can anyone point me to how I might resolve this?
Thanks.
-
I use something like:
Code:
gcc.exe file.c -lshlwapi -lgdi32 -I"C:/Program Files/Dev-Cpp/include" -L"C:/Program Files/Dev-Cpp/lib"
Note that the paths are quoted and that a library directory is also provided. The required import libraries are listed after the file.
-
I'm guessing that you run the command from cmd.exe, i.e. the Windows command shell, whereas make uses sh.exe, i.e. the port of the Bourne shell. They behave differently. sh probably can't handle the backslashes. (Or rather, it sees them as escape characters.)