Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot compile with shared object #837

Closed
meydanbenm opened this issue Dec 21, 2015 · 19 comments
Closed

cannot compile with shared object #837

meydanbenm opened this issue Dec 21, 2015 · 19 comments
Labels

Comments

@meydanbenm
Copy link

Hi all,
I created a share object (.so) - libds.so.
I am trying, successfully to debug it through gdb:
gcc -g test.c -lds

However, when i am trying to debug through geany, i get an error immediately:
program existed with error 127

just to mention - everything else is working just fine (compiling with static library, makefiles etc).

@elextr
Copy link
Member

elextr commented Dec 21, 2015

How are you running the debugger "through geany" ?

@meydanbenm
Copy link
Author

Hi elextr,
Thanks for your response.
I am just trying to take advantage of geany's gui. I am uploading the target executable, marking several breakpoints and running the debugger.
Please note that all of the build is done outside (through terminal operations), because i am changing it to rapidly to update geany's build setup each time.

@b4n
Copy link
Member

b4n commented Dec 21, 2015

I am trying, successfully to debug it through gdb:
gcc -g test.c -lds

This is not a GDB command, but a GCC one, building a file named test.c, adding debugging info and linking libds.

Running under GDB would look like

$ gdb a.out
...
(gdb) run
...

BTW, note that Geany doesn't have any builtin debugger, but three plugins: debugger, scope and geanygdb, so it's unlikely to be a Geany issue.
And code 127 usually means "program not found", so maybe you just don't have GDB installed?

@meydanbenm
Copy link
Author

I probably stepped ahead too much.
What I meant is - I am compiling and linking via terminal.
I can run the executable via gdb or via geany debugger plugin.
The only time I get the error is when compilation was done with a shared object.

@elextr
Copy link
Member

elextr commented Dec 21, 2015

How are you starting Geany? If its not in the same environment as the terminal you successfully use gdb under then the loader search path for the shared object might not be the same. This often happens when starting Geany from system menus since they are not a terminal environment.

@meydanbenm
Copy link
Author

I am starting it through the terminal:
geany prog.c
the very same terminal where i later compile and use gdb.

@codebrainz
Copy link
Member

[...] geany debugger plugin

Which debugger plugin? Is the one called "Debugger"? You might try the "Scope" plugin as it has had more maintenance recently.

@meydanbenm
Copy link
Author

Hi codebrainz.
Yes, i was referring to the Debugger plugin. I'll try scope but this seems a little bit weird, why should geany behave differently when compiling with a shared object? i mean, standard c libraries, such as stdio, are working just fine...

@elextr
Copy link
Member

elextr commented Dec 21, 2015

@mbmxush nowhere have you said what system you are running on and what version of geany you are using

@meydanbenm
Copy link
Author

Sorry, i am new to bug reporting :)
I am using ubuntu 14.04 LTS 64 bit.
Geany version is 1.25.

@codebrainz
Copy link
Member

@mbmxush it could be as @elextr eluded to, that your library search paths are different. You could try to run Geany like this: LD_LIBRARY_PATH=/path/to/your/shared/lib/dir geany prog.c

@kugel-
Copy link
Member

kugel- commented Dec 22, 2015

This doesn't look like a Geany bug so I suggest closing.

@meydanbenm
Copy link
Author

My LD_LIBRARY_PATH is set correctly, as I manage to compile and link with shared object successfully. Something is going amiss whilst trying to debug such a file from geany Debugger...

@kugel-
Copy link
Member

kugel- commented Dec 22, 2015

The debugger you mention is an external plugin, perhaps there is a bug.

You could check in the integrated terminal if LD_LIBRARY_PATH is set.

@meydanbenm
Copy link
Author

Alright, i'll try to do that.

@elextr
Copy link
Member

elextr commented Dec 22, 2015

Or compile your program with RUNPATH set.

On 23 December 2015 at 05:15, Thomas Martitz notifications@github.com
wrote:

The debugger you mention is an external plugin, perhaps there is a bug.

You could check in the integrated terminal if LD_LIBRARY_PATH is set.


Reply to this email directly or view it on GitHub
#837 (comment).

@kugel-
Copy link
Member

kugel- commented Mar 6, 2016

Not a bug (?)

@elextr elextr added the plugin label Mar 6, 2016
@elextr
Copy link
Member

elextr commented Mar 6, 2016

Would appear to be plugin related, not Geany anyway.

@codebrainz
Copy link
Member

Closing since if this is a bug, it seems not to be a Geany bug as noted by @kugel- and @elextr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants