[완료] 파이어폭스 Plugin 개발중 공유 라이브러리 설정
firefox plugin을 작성하기 위해 아래 웹페이지의 내용에 따라 npruntime이란 plugin을 빌드해봤습니다.
http://dolphinwing.blogspot.com/2008/12/ubuntunpruntime.html
빌드하는데 까지는 성공을 하였는데 npruntime 샘플에 동적라이브러리(*.so)파일을 포함시키도록 변경하고 빌드를 하면 오류가 발생됩니다.
빌드로그는 맨 아래에 붙여놨습니다.
에러메시지는 이렇습니다.
excaliburwrapper.cpp:(.text+0x5b): undefined reference to `excal_initializeSpeechRecog'
분명히 공유라이브러리에 있는 함수인데.. 링커는 모르겠다네요 ㅠ.ㅠ
추가시킨 공유라이브러리가 의심되어서 확인해봤는데 공유라이브러리의 문제는 아닌것같습니다.
간단한 라이브러리를 만들고 테스트했을 때는 잘됩니다.(main함수만 달랑 만들어서 공유라이브러리의 함수만 호출했을때는 잘되요..)
그런데 플러그인 샘플에다 붙이기만 하면 링크에러가 발생됩니다.
이것 때문에 아주 미치겠습니다. ㅠ.ㅠ 하루종일 이것만 붙잡고 삽질중입니다..
간단한 조언이라도 감사히 듣겠습니다.
많은 도움 부탁드립니다~!
PS)
-L/lib/excalibur/bin -lexcalibur 에 해당되는 libexcalibur.so는 제가 만든 동적라이브러리입니다.
이 놈만 붙이려고하면 에러를 뱉어냅니다 ㅠㅠ
아래는 빌드 로그입니다.
make -k all
/usr/bin/make export
make[1]: Entering directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
make[1]: `export'를 위해 할 일이 없습니다
make[1]: Leaving directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
/usr/bin/make libs
make[1]: Entering directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
Updating dependencies file, .deps/.all.pp
make[1]: Leaving directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
make[1]: Entering directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
excaliburwrapper.cpp
c++ -o excaliburwrapper.o -c -I../../../../../dist/include/system_wrappers -include ../../../../../config/gcc_hidden.h -DOSTYPE=\"Linux2.6\" -DOSARCH=Linux -I./.. -I./../../public -I/usr/lib/glib/include -I. -I. -I../../../../../dist/include/plugin -I../../../../../dist/include -I../../../../../dist/include/plugin -I/home/jypark/191src/dist/include/nspr -I/home/jypark/191src/dist/sdk/include -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions -finline-limit=50 -L/lib/excalibur/bin -lexcalibur -DMOZILLA_CLIENT -include ../../../../../mozilla-config.h -Wp,-MD,.deps/excaliburwrapper.pp excaliburwrapper.cpp
c++: -lexcalibur: linker input file unused because linking not done
rm -f libexcaliburplugin.so
c++ -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions -finline-limit=50 -L/lib/excalibur/bin -lexcalibur -fPIC -shared -Wl,-z,defs -Wl,-h,libexcaliburplugin.so -o libexcaliburplugin.so np_entry.o npn_gate.o npp_gate.o excaliburwrapper.o plugin.o -lpthread -Wl,-rpath-link,/home/jypark/191src/dist/bin -Wl,-rpath-link,/lib -L/lib/excalibur/bin -lexcalibur -ltest -lasound -ldl -lm
excaliburwrapper.o: In function `ExcaliburWrapper::initializeSpeechRecog(ExcCallbackEvent*)':
excaliburwrapper.cpp:(.text+0x5b): undefined reference to `excal_initializeSpeechRecog'
/usr/bin/ld: libexcaliburplugin.so: hidden symbol `excal_initializeSpeechRecog' isn't defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[1]: *** [libexcaliburplugin.so] 오류 1
make[1]: 오류로 인해 타겟 `libs'를 다시 만들지 못했습니다.
make[1]: 오류로 인해 타겟 `libs'를 다시 만들지 못했습니다.
make: *** [all] 오류 2
make[1]: Leaving directory `/home/jypark/191src/modules/plugin/sdk/samples/excaliburplugin'
에러 메시지를 잘
에러 메시지를 잘 읽어보세요.
excal_initializeSpeechRecog 가 정의되지 않았다네요.
--
오랫동안 꿈을 그리는 사람은 그 꿈을 닮아간다...
http://mytears.org ~(~_~)~
나 한줄기 바람처럼..
오랫동안 꿈을 그리는 사람은 그 꿈을 닮아간다...
http://mytears.org ~(~_~)~
나 한줄기 바람처럼..
수백번 읽은것 같습니다 ㅠㅠ
excal_initializeSpeechRecog 이 함수는 공유라이브러리에 분명히 정의되어 있습니다.
그리고 헤더파일을 include해서 타입도 알려주었고요..
그런데 왜 정의가 되지 않았다는 걸까요???? 정말 이거때문에 금쪽같은 주말이 날라갔습니다 ㅠ
npruntime의 Makefile
npruntime의 Makefile 사용상의 문제였습니다.
소스파일을 추가할때 cpp파일만 넣었었는데요.
"sourcefile.o:" 항목을 추가해서 해당 파일을 별도로 빌드방법을 지정해서 처리했습니다.
이것때문에 완전 고생했습니다~ 휴
댓글 달기