- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project that compiles and links correctly when optimization are off. When using -O3, I get the following error at link:
unresolved external symbol destr_detour322.0.1365
This is a C++ project on Windows, using the compiler 9.1 (20060324) for 64-bits (EMT64). There is no destr_detour function anywhere. I guess it's a destructor-related thing.
Any idea what code might produce function with that type of name? How to avoid it or work around it?
Thanks.
unresolved external symbol destr_detour322.0.1365
This is a C++ project on Windows, using the compiler 9.1 (20060324) for 64-bits (EMT64). There is no destr_detour function anywhere. I guess it's a destructor-related thing.
Any idea what code might produce function with that type of name? How to avoid it or work around it?
Thanks.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems that those functions were inlined destructors for a template class that was being returned by value from a function. For some reason the compiler thought the destructor were not needed, but the linker disagreed.
The work-around I found was to declare a global, use that global in a if() (which I then knew would never be taken, but the compiler didn't know unless it could track the whole program), and called rand() inside so that the compiler didn't know what would happen afterward and woul dbe forced to generate destructors in case of exception.
This is my guess as to what the compiler thinks and why the work-around works, of course.
The work-around I found was to declare a global, use that global in a if() (which I then knew would never be taken, but the compiler didn't know unless it could track the whole program), and called rand() inside so that the compiler didn't know what would happen afterward and woul dbe forced to generate destructors in case of exception.
This is my guess as to what the compiler thinks and why the work-around works, of course.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page