이건 무엇 때문에 나타나는 에러일까요?

gnoygnas의 이미지

이렇게 하면 에러는 생기지 않고 오브젝트 파일만 생성합니다.
이를 실행시키기 위해서 해 주어야 할 일이 뭐가 있을까요?

$ g++ -I /usr/local/orbacus/include -c Client.cpp -o Client.o

예전에 컴파일 하던 방법대로 하니(실행시킬수는 있더군요..) 아래와 같은 에러가 잔뜩 발생합니다.

$ g++ -o Client Client.cpp -I /usr/local/orbacus/include

gnoygnas@ns2 orbacus.ex $ g++ -o Client Client.cpp -I /usr/local/orbacus/include

/tmp/ccEhtxYU.o(.text+0x3f): In function `main':
: undefined reference to `CORBA::ORB_init(int&, char**, char const*, char const*)'
/tmp/ccEhtxYU.o(.text+0x19b): In function `run(CORBA::ORB*)':
: undefined reference to `Hello::_narrow(CORBA::Object*)'
/tmp/ccEhtxYU.o(.gcc_except_table+0x24): undefined reference to `typeinfo for CORBA::Exception'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZN2OB6ObjVarIN5CORBA6ObjectEED1Ev+0xf): In function `OB::ObjVar<CORBA::Object>::~ObjVar()':
: undefined reference to `OBRelease(CORBA::Object*)'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZN2OB6ObjVarIN5CORBA3ORBEEaSEPS2_+0x1d): In function `OB::ObjVar<CORBA::ORB>::operator=(CORBA::ORB*)':
: undefined reference to `OBRelease(CORBA::ORB*)'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZNK2OB6ObjVarIN5CORBA3ORBEEptEv+0x20): In function `OB::ObjVar<CORBA::ORB>::operator->() const':
: undefined reference to `OB::NCA(OB::NCAReason, char const*, char const*, unsigned int)'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZN2OB6ObjVarI5HelloED1Ev+0xf): In function `OB::ObjVar<Hello>::~ObjVar()':
: undefined reference to `OBRelease(Hello*)'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZNK2OB6ObjVarI5HelloEptEv+0x20): In function `OB::ObjVar<Hello>::operator->() const':
: undefined reference to `OB::NCA(OB::NCAReason, char const*, char const*, unsigned int)'
/tmp/ccEhtxYU.o(.gnu.linkonce.t._ZN2OB6ObjVarIN5CORBA3ORBEED1Ev+0xf): In function `OB::ObjVar<CORBA::ORB>::~ObjVar()':
: undefined reference to `OBRelease(CORBA::ORB*)'
collect2: ld returned 1 exit status

도움 주시면 감사하겠습니다...

IsExist의 이미지

ORB 라이브러리를 링크하셔야 겠네요.

-l(소문자 L)옵션을 주고 라이브러리를 지정해 주세요.

대략보니 orbacus가 ORB 같은데 이쪽 라이브러도 가지고 계시죠?

Unix에선 스탠다드 라이브러리가 아니면 명시적으로 지정해 줘야 라이브러리가 링크 됩니다.

---------
간디가 말한 우리를 파괴시키는 7가지 요소

첫째, 노동 없는 부(富)/둘째, 양심 없는 쾌락
셋째, 인격 없는 지! 식/넷째, 윤리 없는 비지니스

이익추구를 위해서라면..

다섯째, 인성(人性)없는 과학
여섯째, 희생 없는 종교/일곱째, 신념 없는 정치

gnoygnas의 이미지

IsExist wrote:
ORB 라이브러리를 링크하셔야 겠네요.

-l(소문자 L)옵션을 주고 라이브러리를 지정해 주세요.

대략보니 orbacus가 ORB 같은데 이쪽 라이브러도 가지고 계시죠?

우선 관심 감사드립니다. ^^

아래와 같이 해줬더니 이젠 라이브러리를 찾지 못한다는 에러메시지가 뜨네요..
디렉토리를 지정하는 방법과 특정 파일을 지정하는 두가지 방법 모두 시도해 보았습니다..(어느게 옳은 방법인지는 확실치 않지만..)

gnoygnas@ns2 orbacus.ex $ g++ -o Client Client.cpp -I /usr/local/orbacus/include -l /usr/local/orbacus/lib/libOB.so.4.2.0
/usr/lib/gcc-lib/i386-pc-linux-gnu/3.3.4/../../../../i386-pc-linux-gnu/bin/ld: cannot find -l/usr/local/orbacus/lib/libOB.so.4.2.0
collect2: ld returned 1 exit status

Quote:
Unix에선 스탠다드 라이브러리가 아니면 명시적으로 지정해 줘야 라이브러리가 링크 됩니다.

위와 같이 말씀하셨는데, 그러면 명시적으로 지정하지 않고 스탠다드 라이브러리처럼 사용하는 방법은 없을까요?

혹시 LD_LIBRARY_PATH에 지정하면 되지 않은가요?

exprot LD_LIBRARY_PATH="/usr/local/orbacus/lib" 라고 현재 bash_profile에 셋팅되어 있고요...^^

그럼 다시한번 부탁드리겠습니다.. ^^;;

One must, In fact, Love your pursuit
My home is below...Well, just go own your gait!

doldori의 이미지

이럴 줄 알고 전에 알려드렸건만...

http://bbs.kldp.org/viewtopic.php?p=183495&highlight=#183495

gnoygnas의 이미지

doldori wrote:
이럴 줄 알고 전에 알려드렸건만...

http://bbs.kldp.org/viewtopic.php?p=183495&highlight=#183495

전에 올리신 글을 유심히 보질 않았네요...한방 먹어도 쌉니다...ㅋ

말씀하신대로 아래와 같이 해 주었는데, 여전히 문제가 많이 뜹니다.
오브젝트 파일까지는 잘 생성해 주었는데, 링크에서 문제가 생기네요..
뒤에 -lOB는 libOB.so 파일에 대한 라이브러리 링크가 맞나요?

암튼 더이상 진전이 없으니 답답하네요...

gnoygnas@ns2 orbacus.ex $ g++ Client.o -L /usr/local/orbacus/lib -lOB

Client.o(.text+0x19b): In function `run(CORBA::ORB*)':
: undefined reference to `Hello::_narrow(CORBA::Object*)'
Client.o(.gnu.linkonce.t._ZN2OB6ObjVarI5HelloED1Ev+0xf): In function `OB::ObjVar<Hello>::~ObjVar()':
: undefined reference to `OBRelease(Hello*)'
/usr/local/orbacus/lib/libOB.so: undefined reference to `dlerror'

중간 생략...

/usr/local/orbacus/lib/libOB.so: undefined reference to `JTCMonitor::unlock() const'
/usr/local/orbacus/lib/libOB.so: undefined reference to `JTCInitialize::initialized()'
/usr/local/orbacus/lib/libOB.so: undefined reference to `JTCThreadGroup::JTCThreadGroup(JTCHandleT<JTCThreadGroup> const&, char const*)'
/usr/local/orbacus/lib/libOB.so: undefined reference to `JTCMonitorBase::JTCMonitorBase()'
/usr/local/orbacus/lib/libOB.so: undefined reference to `JTCInitialize::JTCInitialize()'
collect2: ld returned 1 exit status

읽어주셔서 감사합니다..

One must, In fact, Love your pursuit
My home is below...Well, just go own your gait!

doldori의 이미지

gnoygnas wrote:
뒤에 -lOB는 libOB.so 파일에 대한 라이브러리 링크가 맞나요?

예, 맞습니다.
링크 에러 메시지는 Hello::_narrow(CORBA::Object*), JTCMonitor::unlock() const
같은 함수를 호출했는데 함수 정의가 없다는 뜻입니다.
다른 오브젝트 파일이나 라이브러리가 추가로 필요한 것 같군요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.