Comments (2)
I am not sure I follow your analysis here:
But building a dll or exe file might result in linker errors with unresolved externals when building a Release build of your project.
Which linker errors do you observe? How do they relate to the build-config (Release, etc.)?
CMake generates Visual studio projects that use /EHsc exception handling specification. In the project properties, under C++ in the Code Generation field, Cmake puts this /EHsc value.
This is not by accident. /EHsc
matches the expectation of the Native SDK (there are no C++ exceptions in our code base since all vendored dependencies in C++ follow the Google style guide (the sentry code itself is written in C), so there is no need to "catch" (as in C++ catch
not SEH __except
) asynchronous exceptions (we actually want them to land in our globally installed UnhandledExceptionFilter
so we can report them). How does switching to /EHa
solve your linker errors?
from sentry-native.
I am building a .dll that links to sentry using crashpad as backend.
Compiler - VS 2019 on Windows 7
I will try to illustrate this by some specifications of each scenario...
A) Use CMake to generate without specifying /EHa .This generates /EHsc in all the projects for sentry for VS2019.
- Debug Config
MyDLL = Debug /EHsc
Sentry Lib= Debug /EHsc
All works fine. - Release Config
MyDLL = Release /EHsc
Sentry Lib = Release /EHsc
ERRORS! Causes linker errors with unresolved externals. Cannot find std_find_xyz etc...
B) Use CMake to generate and specify /EHa .This generates /EHa in all the projects for sentry for VS2019.
- Debug Config
MyDLL = Debug /EHa
Sentry Lib= Debug /EHa
All works fine. - Release Config
MyDLL = Release /EHa
Sentry Lib = Release /EHa
Works fine. Linker errors go away.
In other words, I think a small documentation item is needed to mention that for VS2019 you can specify /EHa when configuring sentry, if it is the case that the default flags generated by cmake for sentry cause linker errors when building a program linked to sentry.
For example:
If VS 2019 complains with linker errors when linking to sentry, try adding -DCMAKE_CXX_FLAGS="/EHa" to the CMake command line.
This is similar to This Error
involving std_find that you have seen before. I searched for an example of it and found you in the comments! But in this case it is like std_find_trivial and one other function related to C++ exception handling. I think its a bug in VS2019. But for me I can just use slow SEH makes no difference to my requirements and sentry works fine.
from sentry-native.
Related Issues (20)
- Crashpad crash collection is not thread-safe HOT 2
- Sending captured events should honor sending fail. HOT 3
- Feature Request: Per event user-consent. HOT 12
- [windows] including only wtypes in sentry.h makes Swift fail to import sentry.h HOT 1
- Build failure with Crashpad and aarch64 HOT 2
- Inconsistency in StartHandlerAtCrash Interface Declaration Compared to Original Project HOT 1
- Is there a way to get Sentry to use the debug symbols that are compiled in to the executable? HOT 11
- Crashpad linking error on x86_64 windows HOT 9
- Incorrect issue grouping on Windows HOT 5
- Feature Request: Provide explicit timings to the Performance Monitoring API HOT 4
- Add Linux distro meta-data to OS context. HOT 4
- Qt Android integration documentation HOT 7
- [native] Add support for Sentry Metrics
- Proposal: official crashpad handler as application exe HOT 1
- Set user agent string (sdk name + version) HOT 4
- Exception not catched in sentry - how to investigate why HOT 12
- [#inc-517] Re-test repros before and after applying Google Jan 24 updates HOT 2
- [#inc-517] Document caveats of signalhandlers and sigaltstack HOT 3
- [Epic] #inc-517 Followups HOT 1
- [#inc-517] Add basic crashing test with asan (HW Asan, GWP-ASan)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sentry-native.