Programs linked against shared library behave wrong due to missing compile flag
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
luabind (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
If you compile the attached little program
g++ -o luatest luatest.cpp `pkg-config --cflags --libs lua5.2 luabind`
and run it, you will find the following output:
> ./luatest
function: 0x2529420
function: 0x2525f90
The correct output, though, would be
> ./luatest
42
1337
This only happens when you link against the shared library, with the static library it is working as expected.
This problem may be fixed by adding "-DLUABIND_
I can't get luabind to compile with the Jamfile in the repository, so I can't provide a patch. I made sure this fixes the problem by using a little cmake file though.
The fix is mentioned in the INSTALL file in the windows section only, although config.hpp uses this definition for compiling on linux as well:
#ifdef LUABIND_
# if defined(_GNUC_) && _GNUC_ >=4
# define LUABIND_API __attribute__ ((visibility(
# endif
#endif
Status changed to 'Confirmed' because the bug affects multiple users.