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

Position-independent code flag needed in some cases #45

Open
gussmith23 opened this issue Dec 24, 2017 · 0 comments
Open

Position-independent code flag needed in some cases #45

gussmith23 opened this issue Dec 24, 2017 · 0 comments

Comments

@gussmith23
Copy link

When linking against a debug, static version of JsonBox, I needed to add the setting set(CMAKE_POSITION_INDEPENDENT_CODE ON) in JsonBox's CMakeLists.txt before making and installing it to my system. Otherwise, I get the linker error described in this SO question.

I'm not necessarily asking that this setting be added into JsonBox in all cases, nor am I asking that it even be added in any case; I am just bringing to light a problem I faced and making sure others are aware of it. (This is the first time I've hit this issue, but if it's a common problem, feel free to chalk it up to my ignorance 😄)

Note that for any users running into this issue, another solution (I suspect) is to add JsonBox as a target within your CMake-managed project, instead of depending on an installed version on your system. You can then add the CMAKE_POSITION_INDEPENDENT_CODE ON setting to the JsonBox target.

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

1 participant