Author Topic: Help on plugin development on Linux : missing symbols  (Read 10384 times)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Help on plugin development on Linux : missing symbols
« on: September 03, 2007, 09:43:24 pm »
Hi all !

I am quite new to Linux.
I have regularly a problem with symbols on this OS.

I have the following error message:
Code
ERROR: /media/hda3/codeblocks/trunk/src/devel/share/codeblocks/plugins/ThreadSearch.so: not loaded (missing symbols?)

I had it for a while, I tested lots of things then, suddenly, it worked (even if I didn't understand why).
I worked two days and I am back with my symbols problem. I just added one line of code with event processing.

Lots of things are present on the forums and it seems that there are several parameters that may lead to this problem.
So, my question:
How do I have to proceed to avoid this :evil: error message ?

My command to run the plugin in C::B is
Code
Executing: /media/hda3/codeblocks/trunk/src/devel/codeblocks --debug-log -ns --prefix=/media/hda3/codeblocks/trunk/src/devel (in /media/hda3/codeblocks/trunk/src/devel)

The plugin and its zip are at the right place (ThreadSearch.so or libThreadSearch.so and ThreadSearch.zip).
Debug info are present.
cbplugin.h has the right version
precompiled headers are up-to-date and have been regenerated

Thanks for any help/idea,

Dje

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help on plugin development on Linux : missing symbols
« Reply #1 on: September 04, 2007, 06:25:19 pm »
hi dje

did you run your CB from a script, which looks like this one ?

Code
#!/bin/sh

APP_DIR=/home/tiwag/CodeBlocks/working
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
$APP_DIR/codeblocks $@

it sets the LD_LIBRARY_PATH environment variable so that the dynamic libs can be found

if you have a development version running you need to update the APP_DIR to point to your working version,
where the codeblocks executable is located.
or run your CB debuggee from your working CB, then the LD_LIBRARY_PATH will be set automatically,
when you run the CB debuggee.

very confusing, isn't it ?  :P

i hope it's clear to you
brgds
tiwag

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Help on plugin development on Linux : missing symbols
« Reply #2 on: September 04, 2007, 09:19:45 pm »
did you run your CB from a script, which looks like this one ?

Both gives the same result (missing symbols) !

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help on plugin development on Linux : missing symbols
« Reply #3 on: September 04, 2007, 11:06:57 pm »
all other plugin's are working ?
but threadsearch doesn't ?

then you have most probably a home-made problem in your code rather than a library-search-path problem.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Help on plugin development on Linux : missing symbols
« Reply #4 on: September 04, 2007, 11:22:58 pm »
Both gives the same result (missing symbols) !

another problem which i had several times could be,
that you have added some methods (=symbols) to your library
and the library wasn't rebuilt properly

then a situation can happen, that your code tries to find the symbol
in your dynamic lib but it doesn't exist in the lib on your harddisk.

try deleting manually the library, rebuild everything and check,
if your rebuilt library is in the right place, where your other code
tries to locate the library.

hth, brgds
tiwag

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Help on plugin development on Linux : missing symbols
« Reply #5 on: September 05, 2007, 12:45:06 am »
Thanks for the different hints Tiwag !

Quote
then you have most probably a home-made problem in your code rather than a library-search-path problem.
What surprises me is that it worked, I added two lines of code (related to events handling) built and it did not work any more.
I cleaned/rebuilt dozens of times the plugin, looked carefully after all ThreadSearch.so files to delete them. Nothing worked  :(

I continue my investigations...

Dje

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: Help on plugin development on Linux : missing symbols
« Reply #6 on: September 13, 2007, 12:09:11 am »
Hi !

Problem solved  :D thanks to the tip of Ceniza !
On Linux, the missing symbol is displayed if logging is enabled.
To enable it, you just have to set it with wxLog::EnableLogging(true); in  bool CodeBlocksApp::OnInit()
Code
Index: /media/hda3/codeblocks/trunk/src/src/app.cpp
===================================================================
--- /media/hda3/codeblocks/trunk/src/src/app.cpp        (rĂ©vision 4466)
+++ /media/hda3/codeblocks/trunk/src/src/app.cpp        (copie de travail)
@@ -428,7 +428,7 @@
 
 bool CodeBlocksApp::OnInit()
 {
-    wxLog::EnableLogging(false);
+    wxLog::EnableLogging(true);
 
     SetAppName(_T("codeblocks"));
     s_Loading = true;

Dje

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Help on plugin development on Linux : missing symbols
« Reply #7 on: September 13, 2007, 07:44:19 am »
Code
-    wxLog::EnableLogging(false);
+    wxLog::EnableLogging(true);
To the devs: Does it make sense if we enable this in safe-mode anyway???
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Help on plugin development on Linux : missing symbols
« Reply #8 on: September 13, 2007, 08:42:11 am »
Code
-    wxLog::EnableLogging(false);
+    wxLog::EnableLogging(true);
To the devs: Does it make sense if we enable this in safe-mode anyway???

I guess, but we 'll have to first test this.
Be patient!
This bug will be fixed soon...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Help on plugin development on Linux : missing symbols
« Reply #9 on: September 13, 2007, 08:40:13 pm »
Isn't safe-mode that mode that doesn't load plugins? I think a "--enable-logging" flag would be more helpful.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Help on plugin development on Linux : missing symbols
« Reply #10 on: September 14, 2007, 06:49:02 am »
Isn't safe-mode that mode that doesn't load plugins? I think a "--enable-logging" flag would be more helpful.
Yes, but you can surely load them afterwards manually. I tried what I said and it doesn't seem to harm.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ