LINUX.ORG.RU

Господа, помогите разобраться.


0

0

Господа, есть такая проблема. Существуют библиотеки libnodave. Аналог Prodave под винду для связи с Сименсами S300-S400.Подключаю в проект хидеры #include "/lib/libnodave/nodaveCommon". Встает вопрос о том, как сообщить линкеру, где находяться библиотеки *.so и заставить его линковать их. Он выдает ошибку, при попытке компиляции.

make[2]: Entering directory `/home/andrey/Projects/tect_new/src' gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -c tect_new.c /bin/sh ../libtool --mode=link gcc -g -O2 -o tect_new tect_new.o mkdir .libs gcc -g -O2 -o tect_new tect_new.o tect_new.o(.text+0xf3): In function `main': /home/andrey/Projects/tect_new/src/tect_new.c:106: undefined reference to `setPort' tect_new.o(.text+0x11a):/home/andrey/Projects/tect_new/src/tect_new.c:109: undefined reference to `daveNewInterface' tect_new.o(.text+0x132):/home/andrey/Projects/tect_new/src/tect_new.c:111: undefined reference to `daveInitAdapter' tect_new.o(.text+0x151):/home/andrey/Projects/tect_new/src/tect_new.c:115: undefined reference to `daveNewConnection' tect_new.o(.text+0x167):/home/andrey/Projects/tect_new/src/tect_new.c:117: undefined reference to `daveConnectPLC' tect_new.o(.text+0x199):/home/andrey/Projects/tect_new/src/tect_new.c:120: undefined reference to `daveReadBytes' tect_new.o(.text+0x270):/home/andrey/Projects/tect_new/src/tect_new.c:156: undefined reference to `daveDisconnectPLC' tect_new.o(.text+0x27d):/home/andrey/Projects/tect_new/src/tect_new.c:157: undefined reference to `daveDisconnectAdapter' tect_new.o(.text+0x296):/home/andrey/Projects/tect_new/src/tect_new.c:85: undefined reference to `daveDebug' tect_new.o(.text+0x374):/home/andrey/Projects/tect_new/src/tect_new.c:106: undefined reference to `setPort' tect_new.o(.text+0x3be):/home/andrey/Projects/tect_new/src/tect_new.c:131: undefined reference to `_daveInitPDUheader' tect_new.o(.text+0x3ce):/home/andrey/Projects/tect_new/src/tect_new.c:132: undefined reference to `_daveAddParam' tect_new.o(.text+0x3d7):/home/andrey/Projects/tect_new/src/tect_new.c:133: undefined reference to `daveExchange' tect_new.o(.text+0x404):/home/andrey/Projects/tect_new/src/tect_new.c:136: undefined reference to `_daveSetupReceivedPDU' tect_new.o(.text+0x40d):/home/andrey/Projects/tect_new/src/tect_new.c:137: undefined reference to `daveDebug' tect_new.o(.text+0x41d):/home/andrey/Projects/tect_new/src/tect_new.c:138: undefined reference to `_daveDumpPDU' tect_new.o(.text+0x451):/home/andrey/Projects/tect_new/src/tect_new.c:144: undefined reference to `_daveInitPDUheader' tect_new.o(.text+0x461):/home/andrey/Projects/tect_new/src/tect_new.c:145: undefined reference to `_daveAddParam' tect_new.o(.text+0x46a):/home/andrey/Projects/tect_new/src/tect_new.c:146: undefined reference to `daveExchange' tect_new.o(.text+0x497):/home/andrey/Projects/tect_new/src/tect_new.c:149: undefined reference to `_daveSetupReceivedPDU' tect_new.o(.text+0x4a0):/home/andrey/Projects/tect_new/src/tect_new.c:150: undefined reference to `daveDebug' tect_new.o(.text+0x4b0):/home/andrey/Projects/tect_new/src/tect_new.c:151: undefined reference to `_daveDumpPDU' collect2: ld returned 1 exit status make[2]: *** [tect_new] Ошибка 1 make[2]: Leaving directory `/home/andrey/Projects/tect_new/src' make[1]: *** [all-recursive] Ошибка 1 make[1]: Leaving directory `/home/andrey/Projects/tect_new' make: *** [all-recursive-am] Ошибка 2


Re: Господа, помогите разобраться.

-L/usr/lib/path_to_lib -l_libname_without_lib

например

-L/usr/lib/abc -labc

для того, чтобы включить

/usr/lib/abc/libabc.so

anonymous ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.