From: Keith M. <kei...@us...> - 2011-06-17 20:23:32
|
On 17/06/11 20:48, LRN wrote: > On 17.06.2011 23:32, Greg Chicares wrote: >> On 2011-06-17 19:07Z, William Lewis wrote: >>> So far I created a makefile to compile my code but for some reason it is >>> acting like my Include directories are not being found. >> MSYS emulates posix, while MinGW gcc is a native compiler that >> doesn't understand posix paths. >> >>> INCDIRS = -I/c/MinGW/include -I/c/libs/freeglut-2.6.0/include >> Here, MinGW gcc looks for something like "C:\c\MinGW\include", >> which doesn't exist. You can use a relative path if convenient; >> otherwise, you'll need to specify a full msw path. >> > Wait a sec. He said he made a _msys_ makefile. Which suggests that > msys-make is being used (the one that is used when you invoke `make', > since mingw-make is called mingw32-make). Msys make should know how to > convert -I/c/libs/freeglut-2.6.0/include to > -Ic:/libs/freeglut-2.6.0/include , shouldn't it? Absolutely correct; I doubt very much if this is the explanation of the OP's problem. More likely is this glaring error in his makefile: >>> CFLAGS = -c Hmm. -c in CFLAGS? Compile only; do not link, so... >>> $(MAIN) : $(MAIN).o >>> $(CC) $(INCDIRS) $(CFLAGS) -o $(MAIN) $(LIBDIRS) $(MAIN).cpp $(LIBS) ...this will compile $(MAIN).cpp to object code, but will not even attempt to link an executable. If you aren't linking an executable, libraries will not be searched, period -- nothing to do with their paths not being resolved. Never specify -c in CFLAGS. Also, use $(CC) for the C compiler, not the C++ compiler, for which convention prefers $(CXX), i.e. CC = gcc CXX = g++ (and even CXXFLAGS in preference to CFLAGS with $(CXX)). -- Regards, Keith. |