News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Help on plugin development on Linux : missing symbols

Started by dje, September 03, 2007, 09:43:24 PM

Previous topic - Next topic

dje

Hi all !

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

I have the following error message:
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
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

tiwag

hi dje

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

#!/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

dje

Quote from: tiwag on September 04, 2007, 06:25:19 PM
did you run your CB from a script, which looks like this one ?

Both gives the same result (missing symbols) !

tiwag

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.

tiwag

Quote from: dje on September 04, 2007, 09:19:45 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

dje

Thanks for the different hints Tiwag !

Quotethen 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

dje

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()
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

MortenMacFly

Quote from: dje on September 13, 2007, 12:09:11 AM

-    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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mandrav

Quote from: MortenMacFly on September 13, 2007, 07:44:19 AM
Quote from: dje on September 13, 2007, 12:09:11 AM

-    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...

Ceniza

Isn't safe-mode that mode that doesn't load plugins? I think a "--enable-logging" flag would be more helpful.

MortenMacFly

Quote from: Ceniza 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.
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]