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

DBUILD_SHARED_LIBS in Windows is broken for master #227

Closed
dashesy opened this issue Aug 8, 2017 · 4 comments
Closed

DBUILD_SHARED_LIBS in Windows is broken for master #227

dashesy opened this issue Aug 8, 2017 · 4 comments

Comments

@dashesy
Copy link

dashesy commented Aug 8, 2017

When I use this

cmake .. -Dgflags_DIR=/c/devel/gflags/tmp/ -DBUILD_SHARED_LIBS=1

To build glog shared library on Windows I get this error when I try to build the solution:

1>c:\devel\glog\src\stacktrace_windows-inl.h(42): error C2375: 'google::GetStackTrace': redefinition; different linkage

That line is this:

    GOOGLE_GLOG_DLL_DECL
    int GetStackTrace(void** result, int max_depth, int skip_count) {

During build it must be export, during usage it must be import. I think GOOGLE_GLOG_DLL_DECL definition is not complete.


This error is the current master. The release v0.3.5 compiles fine. Issue #103 is related.

@andyleejordan
Copy link
Contributor

That's odd. I was fairly certain I'd tested this scenario (and hence added that GOOGLE_GLOG_DLL_DECL to fix it), must have messed it up though somehow.

@sergiud
Copy link
Collaborator

sergiud commented Aug 8, 2017

@andschwa The GOOGLE_GLOG_DLL_DECL for GetStackTrace had to be added in stacktrace.h instead of the windows implementation header. Also, GOOGLE_GLOG_DLL_DECL is missing in a few places.

I have a patch ready which I will submit soon.

@andyleejordan
Copy link
Contributor

OH! Thank you @sergiud.

@sergiud
Copy link
Collaborator

sergiud commented Aug 9, 2017

@andschwa You're welcome.

I've submitted #227.

@shinh shinh closed this as completed in 1bfae38 Aug 9, 2017
shinh added a commit that referenced this issue Aug 9, 2017
Fix for missing exports (fixes #227)
durswd pushed a commit to durswd/glog that referenced this issue Sep 2, 2019
durswd pushed a commit to durswd/glog that referenced this issue Sep 2, 2019
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

3 participants