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

CMake Shared Library Quirk on 64 bit Linux #9

Open
jceipek opened this issue Nov 21, 2012 · 1 comment
Open

CMake Shared Library Quirk on 64 bit Linux #9

jceipek opened this issue Nov 21, 2012 · 1 comment
Assignees

Comments

@jceipek
Copy link

jceipek commented Nov 21, 2012

Not sure whether this is a bug or not.

As I mentioned, I'm in the process of creating python wrappers for ShivaVG. While building these, I discovered a strange problem that only affects 64 bit Linux (I also tested this on 64 bit OS X and 32 bit Linux)

/usr/bin/ld: ../ShivaVG/src/libOpenVG.a(shPath.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
../ShivaVG/src/libOpenVG.a: could not read symbols: Bad value

I got around this by adding the following to the bottom of CMakeLists.txt in the src directory:
SET_TARGET_PROPERTIES( OpenVG PROPERTIES COMPILE_FLAGS -fPIC)

based on http://www.cmake.org/pipermail/cmake/2006-September/011316.html

I haven't done much linking before, so I'm not very familiar with the process of making and using static and shared libraries. Is the -fPIC flag a silly thing to add in this case? Should I be linking against a shared library instead (which the current system doesn't generate)? Should it be part of the CMake system, and if so, where should it be?

@ghost ghost assigned landswellsong Nov 22, 2012
@landswellsong
Copy link
Member

Will look into it, thank you.

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