I’m trying to use AppWeb, and i wrote a very simple program to embed AppWeb into my application, it’s using a function in AppWeb library.
#include <appweb/appweb.h>
int main(int argc, char** argv)
{
return maRunWebServer("appweb.conf");
}
I dont know when I compile with gcc (or cc), it compiled successful. But, when I cross compile to Arm architecture, is have been getting error.
This is my Makefile:
CC = gcc
LIBS = lib
FLAG = -lappweb -lmpr
TEST_TARGET = embed-appweb
OBJS = embed-appweb
all: clean compile
compile: run
$(CC) -Wall -L$(LIBS) $(FLAG) -o $(TEST_TARGET) $(OBJS).o
run:
$(CC) -Wall -L$(LIBS) $(FLAG) -c $(OBJS).c
clean:
@rm -rf $(TEST_TARGET) $(TEST_TARGET).trc *.o *~
@echo "Clean complete"
I was replace “CC = gcc” to “CC = arm-linux-gcc” in oder to cross compile.
The error in my problem is:
arm-linux-gcc -Wall -Llib -lappweb -lmpr -c embed-appweb.c
embed-appweb.c:1:27: error: appweb/appweb.h: No such file or directory
embed-appweb.c: In function 'main':
embed-appweb.c:4: warning: implicit declaration of function 'maRunWebServer'
make: *** [run] Error 1
and i’m sure that the library “libappweb.so” was exist in my folder “lib”
Someone may tell me, why it got error? and give me some advice?
Thanks,
Do you know how to use the -I option of gcc?
The error you are getting is due to the fact that the compiler (gcc) can find the files you wanted to include.
Simplest solution would be to change the FLAG in your Makefile:
to
Of course you must change /path/to/my/headers to the true path where your headers reside.