Boost logo

Boost-Build :

Subject: [Boost-build] [HELP] fatal error LNK1120: 5 unresolved externals
From: Seow Hui, Saw (sseowhui_at_[hidden])
Date: 2012-09-07 22:19:34


Dear Sir/ Madam,

A very good day to you.
I installed boost 1.50 installer (32-bit) which downloaded from
http://www.boostpro.com/download/ and did the appropriate settings
(including CGAL) in Microsoft Visual Studio 2010.
I would like to run the following sample code:

----------------------------------------------------------------------------------------------------------------------------------------------------------
#include <iostream>
#include <CGAL\Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL\convex_hull_2.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;

int main()
{
Point_2 points[5] = { Point_2(0, 0), Point_2(10, 0), Point_2(10, 10),
Point_2(6, 5), Point_2(4, 1) };
Point_2 result[5];

Point_2 *ptr = CGAL::convex_hull_2( points, points+5, result );
std::cout << ptr - result << " points on the convex hull" << std::endl;

return 0;
}

----------------------------------------------------------------------------------------------------------------------------------------------------------

There are no errors during compilation but there are errors during the
build as shown below:

1>------ Build started: Project: Cgal_Hello, Configuration: Debug Win32
------
1>libboost_system-vc100-mt-gd-1_50.lib(error_code.obj) : error LNK2005:
"public: __thiscall std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char>
>::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)"
(??0?$basic_string_at_DU?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QAE_at_ABV01@@Z)
already defined in msvcprtd.lib(MSVCP90D.dll)

1>libboost_system-vc100-mt-gd-1_50.lib(error_code.obj) : error LNK2019:
unresolved external symbol "__declspec(dllimport) void __cdecl
std::_Xout_of_range(char const *)" (__imp_?_Xout_of_range_at_std@@YAXPBD_at_Z)
referenced in function "public: void __thiscall
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> >::_Xran(void)const " (?_Xran@?$basic_string_at_DU
?$char_traits_at_D@std@@V?$allocator_at_D@2@@std@@QBEXXZ)

1>D:\Cgal_Hello\Debug\Cgal_Hello.exe : fatal error LNK1120: 5 unresolved
externals

Can anyone help to solve this issues?
In addition, if I have installed the installer, do I still have to use
bjam.exe to build the libraries?
Hope to hear from you soon.
Thank you very much.

-- 
Best Regards,
Saw


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk