LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2012, 12:41 PM   #1
ivspman
LQ Newbie
 
Registered: Dec 2012
Location: Maryland
Distribution: RHEL 5
Posts: 4

Rep: Reputation: Disabled
Undefined Symbol BasicLogger_isPriorityEnabled


I'm using Java 1.6 JNI and C++ compiled using g++ 4.4.2 on RHEL 5. Our .so file loads another company's .so file for our required interface

I have two versions of our shared object (.so) file that we load from our Java app. The older one works but the newer one throws an undefined symbol exception. I ran the following command on both .so files and kept the output of each in a separate file:

nm lib<myLIb>.so > out-3 (on the old .so)
nm lib<myLib>.so > out-5 (on the new .so)

using 'vmdiff out-3 out-5' showed that the new file has 2 additional symbols. Here's a sample of the diff:

old .so:

U BasicLogger_configure
U BasicLogger_create
------------------
U BasicLogger_log
.
.
.
-----------------
U _Znst8ios_base4InitCIEv@@GLIBCXX_3.4

new .so:

U BasicLogger_configure
U BasicLogger_create
U BasicLogger_isPriorityEnabled
U BasicLogger_log
.
.
.
U _ZNSolsEPKv@@GLIBCXX_3.4
U _Znst8ios_base4InitCIEv@@GLIBCXX_3.4


The error from the java app when using the new .so: 'undefined symbol: BasicLogger_log' Oddly, this symbol resides just after the new symbol BasicLogger_isPriorityEnabled. The old .so works fine.

The command I'm using for g++ is:
g++ -g -Wl, --no-undefined -L/opt/<otherLibDir>/lib -o lib<myLib>.so myJni.cpp -shared -I/usr/java/jdk1.6.0_29 -I /usr/java/jdk1.6.0_29/linux /usr/java/jdk1.6.0_29/linux-shared -I/opt/<otherCompany's>/include /opt/<otherCompany's>/lib/<otherCompany's>.a

The only thing I can think to do is to use yum to remove gcc and g++ and then use yum to reinstall (thinking that maybe something is incorrectly configured on my machine).

Does anyone have any suggestions on what I might look at to fix this?

Thanks

Last edited by ivspman; 12-20-2012 at 12:49 PM.
 
Old 12-29-2012, 04:28 PM   #2
ivspman
LQ Newbie
 
Registered: Dec 2012
Location: Maryland
Distribution: RHEL 5
Posts: 4

Original Poster
Rep: Reputation: Disabled
I found that the other company had .h files in multiple directories. The solution was to include those paths when calling g++ to create the .so
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
symbol lookup error: undefined symbol , upon calling C++ executable from matlab SwagatikaPanda Linux - Newbie 0 02-28-2012 06:31 AM
[SOLVED] symbol lookup error: /usr/sbin/httpd: undefined symbol: apr_file_link bagi Slackware 3 05-17-2011 07:49 AM
symbol lookup error: /usr/lib/libavcodec.so.51: undefined symbol: av_crc04C11DB7 priceey Linux - Software 0 05-06-2009 08:14 AM
./firefox-bin :symbol lookup error:/lib/libgthread-2.0.so.0: undefined symbol: arulupsaras Linux - General 1 11-08-2008 04:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 11:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration