> **Possible Duplicate:**
> [Linking apache libraries](https://stackoverflow.com/questions/2102821/linking-apache-libraries)
gcc 4.4.2 c89
I am trying to link some headers and libraries in my header file. But for some reason my program doesn't seem to link.
I have in my directory src/include/apr src/libs
I have compiled the libraries and placed them in my libs and I have put the headers in the include directory.
My executable is in the src directory.
In my makefile I have specified this:
LIBS = -libapr-1
So the current directory to where the executable is executed from.
In my lib folder I have the following library called:
And in my include/apr folder I have the following header file:
The program is getting the header files. But I don't think it is linking the library as I don't get any errors saying that it can't find the header file.
In the file where I include the header I have done this
I do get this following error message:
In file included from include/apr.h:17,
./include/apr/apr.h:285: error: expected â€˜=â€™, â€˜,â€™, â€˜;â€™, â€˜asmâ€™ or â€˜__attribute__â€™ before â€˜apr_int32_tâ€™
Many thanks for any suggestions and advice,
LIBS = -lapr
/usr/bin/ld: cannot find -lapr
OBJECT_FILES = dlg_fsm.o
CFLAGS = -ggdb -Wall
FLATFORM = -DLINUX
CC = gcc
LIBS_PATH = -L./lib
INC_PATH = -I./include
LIBS = -lapr
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECT_FILES) $(FLATFORM) $(INC_PATH) $(LIBS_PATH) $(LIBS) -o dlg
Do you get any prior error messages about missing header files?
以上就是linking libaries and specifying path in makefile的详细内容，更多请关注web前端其它相关文章！