Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

boost/asio compilation errors

Christopher_Pisz
Beginner
668 Views
I am getting several errors when trying to compile a precompiled header that includes boost/asio.hpp

1>Compiling with Intel C++ Compiler XE 12.1.4.325 [IA-32]... (Intel C++ Environment)
1>precompiled-header.cpp
1>39442.cpp
1>39442.cpp
1>39442.cpp
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(74): error: the global scope has no "signal"
1> ::signal(signal_number, asio_signal_handler);
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(247): error: the global scope has no "signal"
1> if (::signal(signal_number, asio_signal_handler) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(247): error: identifier "SIG_ERR" is undefined
1> if (::signal(signal_number, asio_signal_handler) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(317): error: the global scope has no "signal"
1> if (::signal(signal_number, SIG_DFL) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(317): error: identifier "SIG_DFL" is undefined
1> if (::signal(signal_number, SIG_DFL) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(317): error: identifier "SIG_ERR" is undefined
1> if (::signal(signal_number, SIG_DFL) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(371): error: the global scope has no "signal"
1> if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(371): error: identifier "SIG_DFL" is undefined
1> if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR)
1> ^
1>
1>T:\\vendor\\boost_1_49_0\\boost/asio/detail/impl/signal_set_service.ipp(371): error: identifier "SIG_ERR" is undefined
1> if (::signal(reg->signal_number_, SIG_DFL) == SIG_ERR)
1> ^
1>
1>compilation aborted for .\\precompiled-header.cpp (code 2)
1>Build Time: 0:00:50
1>Build log was saved at "file://C:\\Perforce\\trunk\\ATMS2\\Server\\TssIf\\Debug\\BuildLog.htm"
1>TssIf - 9 error(s), 0 warning(s), 0 remark(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


Here is my precompiled header:



// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif

#pragma warning (disable:4503) // Decorated name length exceeded, name was truncated
#pragma warning (disable:4251) // Class '' needs to have dll-interface to be used by clients of class ''
#pragma warning (disable:4275) // NonDLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'

// Xerces Includes
#include
#include
#include
#include
#include
#include

// Log4Cxx Includes
#include "log4cxx/logger.h"
#include "log4cxx/propertyconfigurator.h"
//#include "log4cxx/xml/domconfigurator.h"

// Boost Includes
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include

// Windows Includes
#include

// Standard Includes
#include
#include
#include
#include
#include
#include
#include
#include
#include


0 Kudos
4 Replies
Judith_W_Intel
Employee
668 Views

I'm not completely sure what the problem is here, but if you are using #import (see my previous note) and precompiled headers simultaneously I don't think that will work, because the Microsoft compiler and Intel compiler can't understand each other's precompiled header format.
0 Kudos
SergeyKostrov
Valued Contributor II
668 Views
...
1>T:\vendor\boost_1_49_0\boost/asio/detail/impl/signal_set_service.ipp(74): error: the global scope has no "signal"
1> ::signal(signal_number, asio_signal_handler);
1> ^
...


ACRT-function 'signal' is declared in a'signal.h' header file. Did you try to include it?

...
// Standard Includes
...
#include
...

I don't see any relation to '#import' directive in that case. There are 9 compilation errors and ALL of them are
related to'signal.h' header file.

Best regards,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
668 Views
I'm not completely sure what the problem is here, but if you are using #import (see my previous note) and
precompiled headers simultaneously I don't think that will work, because the Microsoft compiler and Intel compiler
can't understand each other's precompiled header format.


I don't see any relation to '#import' directive, or precompiled headers, or precompiled headers format of
MSC and ICC C++ compilers, in that case.

There are 9 compilation errors and ALL of them are related to 'signal.h' header file.

Judith, please takelook atthe first compilation error carefully and you will see thata character'^' points to a'::signal(...)' CRT-function.

Best regards,
Sergey

0 Kudos
Christopher_Pisz
Beginner
668 Views
I think this was some kind of mismatch between boost headers. I was able to reproduce it using MSVC compiler yesterday. Disregard. I'll take it up on the boost forums if I see it again after a fresh grab of boost.
0 Kudos
Reply