LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-28-2005, 12:19 PM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
dynamic class loading doesn't find my functions!?


hiho@ll

i'm using dlopen and dlsym to load a class dynamically

everything works fine, but my main prog doesn't recognize the functions included by dlsym!!

compileerror:
/tmp/cchUTQgK.o(.text+0x185a): In function `main':
: undefined reference to `myserv::init(int, int, int, int, int, int, int, int)'
/tmp/cchUTQgK.o(.text+0x1977): In function `main':
: undefined reference to `myserv::start()'
collect2: ld returned 1 exit status


i understand why it doesn't find the functions (http://www.linuxjournal.com/article/3687), but although i'm using extern "C" directive
(in my server.cpp class (not the main app class) i have extern "C"{ function codings })

anyone knows what the problem could be?

maybe it's a compilerflag i don't know
or do i have to use extern "C" in the server.h too?

thx@ll
 
Old 07-28-2005, 02:12 PM   #2
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Original Poster
Rep: Reputation: 30
Lightbulb

the compiler option -shared was missing
 
  


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
dynamic class instantiation in c++? Thinking Programming 3 07-28-2005 08:59 AM
Dynamic Class Loading Problems dmnc Programming 11 07-22-2004 04:06 PM
problem on dynamic function call inside a class! antony_csf Programming 0 06-29-2004 10:15 PM
Need help with C++ class functions :( starla827 Programming 4 03-26-2004 07:43 PM
dynamic array in class help PTBmilo Programming 6 03-09-2003 02:35 AM

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

All times are GMT -5. The time now is 08:57 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