boost compiling problem [message #753942] |
Mon, 31 October 2011 04:07 |
Missing name Mising name Messages: 28 Registered: November 2010 |
Junior Member |
|
|
Hello, I tried to use boost in Eclipse on Windows. My testing program:
#include <iostream>
#include <boost/filesystem.hpp>
using namespace boost::filesystem;
int main(int argc, char* argv[])
{
if (argc < 2)
{
std::cout << "Usage: tut1 path\n";
return 1;
}
std::cout << argv[1] << " " << file_size(argv[1]) << '\n';
return 0;
}
Thanks for help.
The build error message:
-------------------------
**** Rebuild of configuration Debug for project hello ****
**** Internal Builder is used for build ****
g++ -IC:\boost_1_47_0 -O0 -g3 -Wall -c -fmessage-length=0 -o src\hello.o ..\src\hello.cpp
g++ -o hello.exe src\hello.o
src\hello.o: In function `_static_initialization_and_destruction_0':
C:/boost_1_47_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
C:/boost_1_47_0/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
C:/boost_1_47_0/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
src\hello.o: In function `ZN5boost11filesystem311path_traits7convertEPKcRSbIwSt11char_traitsIwESaIwEERKSt7codecvtIwciE':
C:/boost_1_47_0/boost/filesystem/v3/path_traits.hpp:113: undefined reference to `boost::filesystem3::path_traits::convert(char const*, char const*, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&, std::codecvt<wchar_t, char, int> const&)'
src\hello.o: In function `ZN5boost11filesystem34path7codecvtEv':
C:/boost_1_47_0/boost/filesystem/v3/path.hpp:388: undefined reference to `boost::filesystem3::path::wchar_t_codecvt_facet()'
src\hello.o: In function `ZN5boost11filesystem39file_sizeERKNS0_4pathE':
C:/boost_1_47_0/boost/filesystem/v3/operations.hpp:366: undefined reference to `boost::filesystem3::detail::file_size(boost::filesystem3::path const&, boost::system::error_code*)'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1422 ms.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03780 seconds