链接C代码,错误未定义引用

时间:2013-10-30 20:10:40

标签: c gcc linker

当我尝试编译c时,我收到此错误:

/opt/linux-devkit/bin/arm-arago-linux-gnueabi-gcc  -Wall -g -DVERSION_STR=\"\" -DBUILD_STR=\"\" -DARM=\"1\" -fPIC -pthread -DLINUX -DnotStandAlone -DQT_NO_DEBUG -mstructure-size-boundary=8 -I../3rdParty/uthash -I../3rdParty/cscl -I../3rdParty/include -I../3rdParty/include/libxml -I../sculib/include -I../include -Iinclude -L../arm/debug/lib/ -L../3rdParty/lib/ -lsculib -lsqlite3 Test/src/test_profile_missing.c ./bin/arm/debug/database.o ./bin/arm/debug/messageProcessor.o -o ../arm/debug/bin/test_profile_missing

Test/src/test_profile_missing.c: In function 'main':
Test/src/test_profile_missing.c:120:28: warning: unused variable 'sMessage'
./bin/arm/debug/database.o: In function `scuDbStoreMeterRegistration':
src/database.c:404: undefined reference to `sPtrMetermap'

./bin/arm/debug/messageProcessor.o: In function `processDataMsgReqThread':
src/messageProcessor.c:159: undefined reference to `scuCoreCleanDataCell'

然而,当我跑:

nm -u bin/arm/debug/database.o|grep sPtrMetermap

它表示database.o有这样的引用,代码表明声明存在。如何缩小此问题并将其链接?

0 个答案:

没有答案