라이브러리를 사용하는데 undefined reference 오류가 발생합니다.
글쓴이: liush79 / 작성시간: 월, 2007/12/03 - 8:41오후
금요일쯤 질문한번 했었는데 완료가 되지 않아 다시 정리 해서 올립니다.
퀄컴사의 한 라이브러리를 사용하려고 했는데 오류가 발생했습니다.
단지 인터페이스 선언만 했고요..소스는 다음과 같습니다.
#define QSCLGUID #include <qscl.h> #include <dlfcn.h> int main(int argc, char** argv[]) { IQsclConvertFile *cf = reinterpret_cast<IQsclConvertFile *>(QsclCreateInstance(ID_QsclFile, ID_IQsclConvertFile)); return 0; }
이걸 컴파일 했더니 오류가 나는데 (std 관련)
feanor 님이 gcc 버전을 3.3으로 낮춰야 한다고 해서 버전을 낮췄습니다.
그랬더니 std 관련 오류는 모두 해결 됐는데요..
아직.. 다음오류가 납니다.
빌드는 다음과 같이 해보았습니다. (lqscl 은 퀄컴 라이브러리)
gcc test2.cpp -lqscl -lstdc++
gcc test2.cpp -lqscl -lstdc++ -lpthread
/usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclCodecMulaw.o): In function `QsclCodecMulaw::QsclCodecMulaw[not-in-charge]()': qsclCodecMulaw.cpp:(.text+0x43): undefined reference to `Mutex::Mutex[in-charge]()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclCodecMulaw.o): In function `QsclCodecMulaw::QsclCodecMulaw[in-charge]()': qsclCodecMulaw.cpp:(.text+0xac): undefined reference to `Mutex::Mutex[in-charge]()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclCodecMulaw.o): In function `QsclCodecMulaw::~QsclCodecMulaw [not-in-charge]()': qsclCodecMulaw.cpp:(.text+0x10c): undefined reference to `Mutex::freeMutex()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclCodecMulaw.o): In function `QsclCodecMulaw::~QsclCodecMulaw [in-charge]()': qsclCodecMulaw.cpp:(.text+0x163): undefined reference to `Mutex::freeMutex()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a .... 중략 .... qsclFile.cpp:(.text+0xabc6): undefined reference to `MutexLock::lock()' qsclFile.cpp:(.text+0xabe9): undefined reference to `MutexLock::unlock()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclFile.o): In function `QsclFile::release()': qsclFile.cpp:(.text+0xac16): undefined reference to `MutexLock::lock()' qsclFile.cpp:(.text+0xac3d): undefined reference to `MutexLock::unlock()' qsclFile.cpp:(.text+0xac69): undefined reference to `MutexLock::unlock()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclFile.o):(.gnu.linkonce.d._ZTV8QsclFile+0x128): undefined reference to `ThreadedObject::workerThreadLoopCondition()' /usr/local/lib/gcc-lib/i386-redhat-linux/3.3/../../../libqscl.a(qsclFile.o):(.gnu.linkonce.d._ZTI8QsclFile+0x38): undefined reference to `typeinfo for ThreadedObject' collect2: ld returned 1 exit status
무슨 라이브러리가 빠진거 같은데..
어떤건지 모르겠습니다.
윈도버전과 리눅스 버전이 있고요..
윈도버전에서는 오류가 발생하지 않습니다.
리눅스에서 뭔가.. 링크하나가 안된거 같습니다.
좀 도와주십쇼 '_';
Forums:
이거 제가 그 쪽
이거 제가 그 쪽 배경지식이 없어서 헛소리하는 것인지는 모르겠지만...
C++ 프로그램 아닌가요? MutexLock::lock() 이런 것으로 봐서요.
그러면 g++로 빌드 해야 되지 않나 싶습니다.
이름 맹글링 때문에 레퍼런스를 못 찾지 않은지요...
reinterpret_cast도 뒤에 템플릿 인자 부분이 웹이라서 짤린 것 같은데
#include 처럼 말이죠. 그렇다면 c++ 프로그램 같네요.
블로그: http://turtleforward.blogspot.com
블로그: http://turtleforward.blogspot.com
g++ 도 해봤습니다.
gcc 에 -lstdc++ 을 링크하면 g++ 과 동일하다고 들어서 위처럼 했고요..
g++ test2.cpp -lqscl -lpthread
처럼 해도 마찬가지 결과가 나옵니다.
관심을 가져주셔서 감사합니다 ㅜㅜ
앗, 그렇군요. 이거
앗, 그렇군요. 이거 참... 뭔가 라이브러리가 빠졌을 텐데 저것이 무언지...
으.. 성공하시길 빌겠습니다. 지나가는 고수님의 답을 기다리며...
블로그: http://turtleforward.blogspot.com
블로그: http://turtleforward.blogspot.com
댓글 달기