Compiler error when including boost/asio.hpp on C++ Builder 2010
EDIT: SOLVED!
I added BOOST_ALL_NO_LIB to my Conditional defines and added the errorcode.cpp from /libs/system/src/ folder to my Project.
I recently set up C++ Builder and开发者_运维技巧 been playing around with it to get my head around C++.
I need to use boost-asio for a project I will be working on, but I have come across a bit of a problem when just trying to include and compile it. I have set up the project include path and all as it should be (I can test by removing it and the compiler complains it can't find asio.hpp, this is not the issue).
I have tried with 2 versions of Boost, 1_39 and 1_46, and I get different errors depending on the version used.
Ignore the warnings for starters, I guess. Also, if you want the full parser context from the errors, please let me know and I can post them.
1_39:
[BCC32 Warning] error_code.hpp(486): W8104 Local Static with constructor dangerous for multi-threaded apps
[BCC32 Warning] error.hpp(349): W8104 Local Static with constructor dangerous for multi-threaded apps
[BCC32 Error] auto_link.hpp(262): E2075 Incorrect pragma directive option: -v
[BCC32 Error] static_log2.hpp(51): E2451 Undefined symbol 'n'
[BCC32 Error] static_log2.hpp(55): E2451 Undefined symbol 'value'
[BCC32 Error] static_log2.hpp(55): E2230 In-line data member initialization requires an integral constant expression
[BCC32 Fatal Error] static_log2.hpp(49): F1004 Internal compiler error at 0x55a4e8d with base 0x5500000
1_46:
[BCC32 Warning] xutility(1808): W8017 Redefinition of 'NOMINMAX' is not identical
[BCC32 Warning] stdint.h(168): W8017 Redefinition of 'WCHAR_MAX' is not identical
[BCC32 Warning] win_tss_ptr.ipp(41): W8012 Comparing signed and unsigned values
[BCC32 Warning] socket_select_interrupter.ipp(138): W8012 Comparing signed and unsigned values
[BCC32 Error] strand_service.hpp(31): E2247 'strand_service::do_complete(win_iocp_io_service *,win_iocp_operation *,system::error_code,unsigned int)' is not accessible
[BCC32 Warning] strand_service.ipp(95): W8058 Cannot create pre-compiled header: initialized data in header
The source code doesn't really matter, but regardless (removing the asio include, I have no trouble, obviously):
//---------------------------------------------------------------------------
#include <boost/asio.hpp>
#include <iostream>
//---------------------------------------------------------------------------
int main ()
{
std::cout << "Test";
std::cin.ignore();
return 0;
}
//---------------------------------------------------------------------------
EDIT: SOLVED!
I added BOOST_ALL_NO_LIB to my Conditional defines and added the errorcode.cpp from /libs/system/src/ folder to my Project.
Solved as per the edit:
I added BOOST_ALL_NO_LIB to my Conditional defines and added the errorcode.cpp from /libs/system/src/ folder to my Project.
精彩评论