gcc编译mtserver Using ‘dlopen‘ in statically linked applications requires at runtime

编译mtserver

433正常
arm-none-linux-gnueabi-gcc -static mtserver.c mtsocket.c current.c  ini.c dcmscomm.c public.c sqlite3.c cjson.c config.c db.c dbcd.c dcms01dev.c power.c common.c -Wall -g -lrt -ldl -lpthread -march=armv4t -lm -liconv -o mtserver
但有告警:/tmp/ccZGgmHf.o: In function `unixDlOpen':
/home/lgl/Desktop/大连网关项目软件代码文档mtserver张初权原/mtserver/program/sqlite3.c:35228: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

去掉-static也能运行。不提示上面的。

去掉-liconv 也正常
arm-none-linux-gnueabi-gcc -static mtserver.c mtsocket.c current.c  ini.c dcmscomm.c public.c sqlite3.c cjson.c config.c db.c dbcd.c dcms01dev.c power.c common.c -Wall -g -lrt -ldl -lpthread -march=armv4t -lm -o mtserver

去掉-march=armv4t  编译正常,运行报错误Illegal instruction

看看gcc,正常
gcc -static -o mtserver mtsocket.c current.c  ini.c dcmscomm.c public.c sqlite3.c cjson.c config.c db.c dbcd.c dcms01dev.c power.c common.c mtserver.c  -lm -lrt -ldl -lpthread

你可能感兴趣的:(日志)