B Thomas <[EMAIL PROTECTED]> wrote: > I am trying to compile a simple program that use a static library in > ~/lib with corresponding include file in ~/include. My LD_LIBRARY_PATH > includes ~/lib.
I don't think that gcc cares about LD_LIBRARY_PATH when it searches for static libs. LD_LIBRARY_PATH is used by ld.so to find dynamics libs. > Here is the Makefile > GLTKPATH=/home/bt > GLTKLIB=-L$(GLTKPATH)/lib -lgltk > GLTKINC=-I$(GLTKPATH)/include So you have pointed out where to search for libraries and header files, you have also told gcc to search for a library named libgltk.a. > However the compilation fails even though all the paths in this makefile > are correct, gcc can not find symbols defined in libgltk.a . Is libgltk.a really a static library? What does nm /home/bt/lib/libgltk.a and ar t /home/bt/lib/libgltk.a give? > Also if I try to change the gcc command line and then run make again it > does not run the changed version of the command !!! That is because it has never run your command. Instead make has been using a built in command in lack of any useful rule: > SRCFILES=$(wildcard *.c) > OBJFILES=$(patsubst %.c,%.o, $(SRCFILES)) > PROGRAMS=$(patsubst %.c,%, $(SRCFILES)) > build: $(PROGRAMS) > $(CC) $(CFLAGS) $(LDFLAGS) -o "$@" "$<" Say that you have a single file called "myfile.c". If so, above you have a rule that expands to: build: myfile $(CC) $(CFLAGS) $(LDFLAGS) -o build myfile I don't think the above rule was what you intended. Instead of using the rule above make will do its best to find a way to build "myfile" as that is needed by "build". This could also explain your problem with the static library, are the flags to find the library used when gcc tries to compile your file? regards Henrik -- The address in the header is only to prevent spam. My real address is: hc1(at)poolhem.se Examples of addresses which go to spammers: [EMAIL PROTECTED] [EMAIL PROTECTED] _______________________________________________ help-gnu-utils mailing list help-gnu-utils@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-utils