Reputation: 93
When compiling a C++ Builder 10.4 project, I get the following linker error:
[ilink32 Error] Error: Unresolved external 'std::locale::id::id(unsigned int)' referenced from C:\USERS\PUBLIC\DOCUMENTS\EMBARCADERO\STUDIO\21.0\DCP\SCREEN2VIDEO.LIB|Screen2Video
This linker error happens when 'Link with dynamic RTL', and 'Link with run-time packages' are turned off. When linking with dynamic RTL, the linker error does not occur, but I want to link statically.
The SCREEN2VIDEO.LIB is from a package containing an imported ActiveX control.
Upvotes: 2
Views: 1402
Reputation: 31
Same issue here, with C++ Builder 11 though. It turned out to be a problem of the optimizer. Try disabling all optimizations. Also check out one of the related bug reports at Embarcadero: https://quality.embarcadero.com/browse/RSP-29221
Edit: I experimented a bit more and found the problematic compiler flag. It is -finline-functions which is implicitely added when using -O2 or higher. Therefore, as a workaround, you can add -fno-inline-functions to C++ compiler > Advanced > Additional Options to make it work without too much of a performance impact at least.
I also added this info to the above bug-report.
Upvotes: 2
Reputation: 93
Recompile all dependent packages (including the screen2video.bpl) with dynamic RTL turned off. This fixed the linker error.
Upvotes: 1