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
Windows 10 Store App - C++ - how to configure project to use Sentry crash reporting? #170
Comments
Looks like the solution was to do this in my app: #define SENTRY_BUILD_STATIC 1 |
My project requires multithreaded runtime library (/MT) - but the configuration of sentry is multithreaded DLL (even though I have configured as static library!) Is there any way to fix that via Cmake? Otherwise, I can't link it... Pete |
Finally, having manually changed the flags in the Sentry projects to /MT, and rebuilding... 1>sentry.lib(sentry_crashpad_backend.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in ABC.obj Thanks, Pete |
@sseyod can you try this again with the latest |
Hi @Swatinem, Many thanks for getting back to me. I'll give it a go and report back! Question for you: what is the best URL to look at, with regard to build instructions; some concrete examples of how to make the build in various configurations would be very helpful (see my above comments!) :) For the record, I'm using VS2019 Community Edition, and C++17. Best, Pete |
Hi @Swatinem, OK, this has improved things, in that I then just see one missing symbol reported, which is __GSHandlerCheck_EH4. 1>mini_chromium.lib(rand_util.obj) : error LNK2001: unresolved external symbol __GSHandlerCheck_EH4 I was able to fix that, by further modifying the build configuration for sentry native. Note that my app is a Windows 10 Store app - that might explain why I needed to work around the __GSHandlerCheck_EH4 problem ... see the FH4 flags for compiler and linker. My build notes are here, I hope they help you and others.
|
Thanks for investigating @sseyod! This helps me a lot actually ;-) I will try to find out how I can add these options directly to the library instead of globally, which would also need changes to our crashpad fork. |
@Swatinem that is great news, many thanks for letting me know. Always good to help :) Pete |
Note that in #190 we found out that Crashpad will likely not work for Windows 10 Store Apps since those can only consist of a single executable. To support that use case, we will need to add a Windows inproc backend, or the Breakpad backend. |
Followed it to use sentry for my cpp app till this step:
and built the sentry .sln file in release mode after that made a project in cpp then tried including sentry to it but it says "No such directory" for sentry or issues with sentry.h library....how to resolve it. |
@Swatinem if you're updating the Windows 10 build/configuration documentation, can you also please consider updating your CMakeLists.txt along the lines of my above suggested changes?
|
@Swatinem just wanted to thank you again for all your work on this - had my first usable crash report come through for Windows 10, and it was an easy fix! |
Just a tip for others: once you've build the release version of you app, and you've built the package - here is how to upload all you need for the crash reports. Make sure you do this before trying to provoke a crash, or you won't get a usable crash report.
|
I think #283 should have fixed this, as it adds the |
Hi!
Now that you've just released updated the Native / C++ version (thanks!), I've been able to download it, install Make for Windows 10, and start trying to integrate with one of my C++ projects for Windows 10.
cmake . -DBUILD_SHARED_LIBS=OFF
extern "C" {
#include <sentry.h>
}
int main(void) {
...
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "https://blah/blah");
sentry_init(options);
/* ... */
// make sure everything flushes
sentry_shutdown();
}
I've updated my project to import the same .lib files that your test project (sentry_example) uses, including sentry.lib (and all the other ones).
However, I'm getting this:
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_value_new_message_event
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_init
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_shutdown
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_options_set_dsn
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_capture_event
1>Main.obj : error LNK2001: unresolved external symbol __imp_sentry_options_new
1>C:...blah...\myapp.exe : fatal error LNK1120: 6 unresolved externals
Can you please advise?
Pete
The text was updated successfully, but these errors were encountered: