'Unresolved External with boost in C++Builder 11 Alexandria

I have a simple program, it has a VCL form, and in the constructor there is this code:

__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    using namespace boost::locale;
    using namespace std;
    generator gen;
}

Plus these include lines

#include <boost/locale.hpp>
#include <iostream>

Basically, I'm trying to test my boost installation! Well, I'm getting several linker errors:

[ilink32 Error] Error: Unresolved external 'std::exception::exception()' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\22.0\LIB\WIN32C\RELEASE\LIBBOOST_LOCALE-BCB32C-MT-D-X32-1_70.LIB|codepage
[ilink32 Error] Error: Unresolved external 'boost::locale::impl_win::create_convert(std::locale&, boost::locale::impl_win::winlocale&, unsigned int)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\22.0\LIB\WIN32C\RELEASE\LIBBOOST_LOCALE-BCB32C-MT-D-X32-1_70.LIB|win_backend
[ilink32 Error] Error: Unresolved external 'boost::locale::impl_win::create_collate(std::locale&, boost::locale::impl_win::winlocale&, unsigned int)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\22.0\LIB\WIN32C\RELEASE\LIBBOOST_LOCALE-BCB32C-MT-D-X32-1_70.LIB|win_backend
[ilink32 Error] Error: Unresolved external 'boost::locale::impl_win::create_formatting(std::locale&, boost::locale::impl_win::winlocale&, unsigned int)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\22.0\LIB\WIN32C\RELEASE\LIBBOOST_LOCALE-BCB32C-MT-D-X32-1_70.LIB|win_backend
[ilink32 Error] Error: Unresolved external 'boost::locale::impl_win::create_parsing(std::locale&, boost::locale::impl_win::winlocale&, unsigned int)' referenced from C:\PROGRAM FILES (X86)\EMBARCADERO\STUDIO\22.0\LIB\WIN32C\RELEASE\LIBBOOST_LOCALE-BCB32C-MT-D-X32-1_70.LIB|win_backend
[ilink32 Error] Error: Unable to perform link

I first thought there is something wrong with my boost installation, which I installed via GetIt. But then it appears everyone is having some kind of linker issue with boost. After looking all over, I did not find a valid solution for my particular problem.

So, what gives? How to make this thing work, so it boosts my productivity, instead of being a buggy piece of code?



Solution 1:[1]

I had similar error with boost. I fixed the problem by setting both the options to true(but I have to deploy some dependecies too) else I got these error:

"Link with Dynamic RTL" = false give this error: [ilink32 Error] Error: Unresolved external 'std::locale::~locale()' referenced from

"Link with the Delphi Runtime Library" = false give this error: [ilink32 Error] Error: Unresolved external '__Atomic_fetch_sub_4' referenced from

Hope this helps

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1