Я пытаюсь скомпилировать проект, используя общую библиотеку. Когда я компилирую, он дает мне undefined reference
. Я думаю, что в моем файле make есть проблема (ссылка на файл .so).
вот часть make-файла, используемого для вызова библиотек:
#Source Files
SOURCE = ./*.c
#LIBS to include
LIBS = -ldl
LIBS += -lpthread
LIBS += -lRTU_Module
Я использую NetBeans и, возможно, я делаю что-то не так при создании проекта.
вот код сообщения:
CLEAN SUCCESSFUL (total time: 99ms)
cd '/home/owasys/workspace/AccelTest'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/owasys/workspace/AccelTest'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU_linaro-Linux/acceltest
make[2]: Entering directory '/home/owasys/workspace/AccelTest'
mkdir -p build/Debug/GNU_linaro-Linux
rm -f "build/Debug/GNU_linaro-Linux/main.o.d"
arm-linux-gnueabihf-gcc -c -g -MMD -MP -MF "build/Debug/GNU_linaro-Linux/main.o.d" -o build/Debug/GNU_linaro-Linux/main.o main.c
mkdir -p dist/Debug/GNU_linaro-Linux
arm-linux-gnueabihf-gcc -o dist/Debug/GNU_linaro-Linux/acceltest build/Debug/GNU_linaro-Linux/main.o -L. libRTU_Module.so
make[2]: Leaving directory '/home/owasys/workspace/AccelTest'
make[1]: Leaving directory '/home/owasys/workspace/AccelTest'
Building owa4x_AN8 Object
arm-linux-gnueabihf-gcc -Wall -mthumb -mthumb-interwork -D_REENTRANT -oowa4x_AN8 main.c -ldl -lpthread -lRTU_Module
arm-linux-gnueabihf-strip owa4x_AN8
for CONF in Debug Release ; \
do \
"/usr/bin/make" -f nbproject/Makefile-${CONF}.mk QMAKE= SUBPROJECTS= .build-conf; \
done
make[1]: Entering directory '/home/owasys/workspace/AccelTest'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU_linaro-Linux/acceltest
make[2]: Entering directory '/home/owasys/workspace/AccelTest'
make[2]: 'dist/Debug/GNU_linaro-Linux/acceltest' is up to date.
make[2]: Leaving directory '/home/owasys/workspace/AccelTest'
make[1]: Leaving directory '/home/owasys/workspace/AccelTest'
make[1]: Entering directory '/home/owasys/workspace/AccelTest'
"/usr/bin/make" -f nbproject/Makefile-Release.mk dist/Release/GNU_linaro-Linux/acceltest
make[2]: Entering directory '/home/owasys/workspace/AccelTest'
mkdir -p dist/Release/GNU_linaro-Linux
arm-linux-gnueabihf-gcc -o dist/Release/GNU_linaro-Linux/acceltest build/Release/GNU_linaro-Linux/main.o
build/Release/GNU_linaro-Linux/main.o: In function `GetWakeUpreason':
main.c:(.text+0x72): undefined reference to `RTUGetWakeUpReason'
build/Release/GNU_linaro-Linux/main.o: In function `main':
main.c:(.text.startup+0xc): undefined reference to `RTUControl_Initialize'
main.c:(.text.startup+0x16): undefined reference to `RTUControl_Start'
main.c:(.text.startup+0xa6): undefined reference to `RTUEnterStandby'
main.c:(.text.startup+0xba): undefined reference to `RTUControl_Finalize'
main.c:(.text.startup+0xd2): undefined reference to `RTUEnterStop'
main.c:(.text.startup+0x16a): undefined reference to `RTUSetWakeUpTime'
main.c:(.text.startup+0x204): undefined reference to `RTUSetHWTime'
main.c:(.text.startup+0x224): undefined reference to `RTUGetHWTime'
main.c:(.text.startup+0x246): undefined reference to `RTUGetExtControllerVersion'
main.c:(.text.startup+0x284): undefined reference to `RTU_GetMovementSensor'
main.c:(.text.startup+0x2a4): undefined reference to `RTU_RemoveMovementSensor'
main.c:(.text.startup+0x2c6): undefined reference to `RTU_GetCfgMovement'
main.c:(.text.startup+0x368): undefined reference to `RTU_CfgMovementDetection'
main.c:(.text.startup+0x3cc): undefined reference to `RTU_CfgMovementSensor'
main.c:(.text.startup+0x3f4): undefined reference to `RTUGetBatteryState'
main.c:(.text.startup+0x414): undefined reference to `RTUResetMoved'
main.c:(.text.startup+0x43a): undefined reference to `RTUGetMoved'
main.c:(.text.startup+0x48c): undefined reference to `RTU_GetRawAcceleration'
collect2: error: ld returned 1 exit status
nbproject/Makefile-Release.mk:62: recipe for target 'dist/Release/GNU_linaro-Linux/acceltest' failed
make[2]: *** [dist/Release/GNU_linaro-Linux/acceltest] Error 1
make[2]: Leaving directory '/home/owasys/workspace/AccelTest'
nbproject/Makefile-Release.mk:59: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/owasys/workspace/AccelTest'
nbproject/Makefile-impl.mk:59: recipe for target '.all-impl' failed
make: *** [.all-impl] Error 2
BUILD FAILED (exit value 2, total time: 651ms)
Спасибо