编译错误汇总

error: undefined reference to 'vtable for TTrace'

解决:虚函数没有全部实现,仔细再检查一遍


D:/android_NDK/android-ndk-r10e/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o:crtbrand.c:function _start: error: undefined reference to 'main'

解决:如何是NDK编译成库时要加上LOCAL_LDFLAGS += -shared


error: 'pthread_cancle' was not declared in this sope

解决:pthread的cancle函数NDK不支持,

使用pthread_kill()或者return NULL

pthread_exit(): 可以指定返回值,以便宜其它线程通过pthread_join()函数获取该线程的返回值


error: undefined reference to 'Json::Value::operator=(Json::Value)'

解决:可能是没有jsoncpp的库,而不是json库


commands commence before first target 

解决:1.上一行换行符号\后面有空格 2.本行前面空白有非法字符 3.换行时缺少\

error: experccted initializer before '函数名'

解决:函数没有定义,可能定义出末尾没有加分号;


error: no rule to make target  ' *e.cpp', needed by *.o'. Stop.

解决:千万要注意.cpp的路径是否正确。吃不少亏


error: undefined reference to "*"

解决:http://blog.csdn.net/aiwoziji13/article/details/7330333/


-WI,-rpath

解决:编译时找不到库,和运行时找不到库是两码事


猜你喜欢

转载自blog.csdn.net/sinat_32596537/article/details/60598200