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

Incorrect linking of shared libraries for gmake #5

Open
stevegee58 opened this issue Nov 10, 2015 · 2 comments
Open

Incorrect linking of shared libraries for gmake #5

stevegee58 opened this issue Nov 10, 2015 · 2 comments

Comments

@stevegee58
Copy link

With gmake, when I build a shared library and an executable that links to it, the resulting makefile uses static linking to the .so file instead of using "-l" to link to it. The resulting executable will work with the .so file but only under very specific conditions. If I hand edit the makefile to use "-l" and move the .so file somewhere in my search path the executable works then.
Sorry if this isn't clear but it's a little hard to explain.

I have a tar.gz file with a complete project with source files to demonstrate this problem. Unfortunately I can't attach it here. I'll send it via email if you want.

@starkos
Copy link
Member

starkos commented Nov 10, 2015

There has been some work done on this recently premake-core (Premake 5). If you get a chance can you try with the latest code from there and see if it behaves any better?

@stevegee58
Copy link
Author

I just tried premake5 and it does the same thing. The generated .make file for the executable is using the statically linked syntax on the ld command instead of using the "-l" switch.

Also, in my example I'm building both the shared lib and the executable in the same premake4.lua file. Each is its own project within the top level solution.

As a science experiment I split it up into 2 premake4.lua files, one for the executable and the other for the shared library. In that case the executable was linked correctly with the "-l" ld switch.

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

No branches or pull requests

2 participants