Compilation failed QT + BOOST

Compilation failed QT + BOOST

Hi,

I have a software compiled with VS 2010 64 bits + QT 5 + Boost. When I switch to Intel compiler I got :

a)  A lot of errors when I compile the QT project :

https://bugreports.qt-project.org/browse/QTBUG-31701#comment-206787

b) When I try to compile some projects related to boost I got the following error :

Error 106 error LNK1104: cannot open file 'libboost_thread-iw-mt-gd-1_49.lib'

BTW: I only have an evaluation version, so before buying I must be sure that it compile and I have a performance boost.

Thanks

http://spectralbattle.wordpress.com/
13 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

>>a) A lot of errors when I compile the QT project :
>>
>>https://bugreports.qt-project.org/browse/QTBUG-31701#comment-206787

I'll take a look at these errors.

>>b) When I try to compile some projects related to boost I got the following error :
>>
>>Error 106 error LNK1104: cannot open file 'libboost_thread-iw-mt-gd-1_49.lib'

This is Not related to Intel C++ compiler and this is a missing Boost library, or a wrong path to the library was used. Does the library exist in some folder?

There are more than 100 compilation errors and the 1st one is:

...
3>C:\Qt\qt-5.0.2-build\qtbase\include\QtCore/../../../../qt-5.0.2-src/qtbase/src/corelib/global/qglobal.h(347): error : a function declared "dllimport" may not be defined
3> Q_CORE_EXPORT const char *qVersion() Q_DECL_NOTHROW; (TaskId:73)
3> ^ (TaskId:73)
3> (TaskId:73)
...

My questions are as follows:

- How Q_CORE_EXPORT macro is declared?
- Are you sure that in case of Intel C++ compiler QT configuration macros are defined properly?

Continued...

1. Try to contact QT support and ask if Intel C++ compiler ( some version ) is supported ( especially when C++11 features are used ).

2. If QT uses some C++11 features Not currently supported by Intel C++ compiler ( some version ) then you won't be able to compile the library AS IS and porting efforts could be significant.

3. Try to be as specific as possible and start with some very-very small set of compilation errors. Don't think that somebody will try to understand all of them and you need to rely on yourself most of the time.

4. You did not provide any details on a version / update of Intel C++ compiler.

5. If 30 days for evaluation won't be enough you could request extension of Evaluation period.

6. Similar Firefox compilation reports were thrown here many times in 2012 & 2013 and in some cases authors of these posts ( software developers ) did Not cooperate and did Not follow up.

Q_CORE_EXPORT is a macro that gets expanded to different values depending on the context in which it's compiled.

It isn't an identifier. It's a platform-dependent macro, and it's used to signal a class that's intended to be used across library boundaries. In particular, it's defined by the Qt core library and used by other Qt libraries.

I've reduced the problem to the following code:

[cpp]
__declspec(dllimport) const char *qVersion() noexcept;
[cpp]

However, I cannot get Qt to expand Q_DECL_NOTHROW to noexcept. ICC on Windows does not have C++11 enabled and there does not seem to be a way to enable it (__cplusplus is always 199711L, even with /Qstd=c++11). I have no explanation as to why the build resulted in that expansion.

I've managed to reproduce the error and I've sent a fix to Qt: https://codereview.qt-project.org/59839

>>...ICC on Windows does not have C++11 enabled and there does not seem to be a way to enable it...

What version of Intel C++ compiler do you use?

- For version 12 only option c++0x can be used
- For version 13 and higher options c++0x and c++11 can be used

>>...( __cplusplus is always 199711L, even with /Qstd=c++11 )...

As far as I know __cplusplus is a pre-defined macro ( internal ) and can be only defined by a C++ compiler. For example, it can not be re-defined in a header or source files as follows:

...
#define __cplusplus 1234567
...

and I'll do a verification what values that macro has for versions 12 and 13 of Intel C++ compiler on Windows platform.

>>...I'll do a verification what values that macro has for versions 12 and 13...

Here are results for version 12:

..\Tests>icl.exe /MD /Qstd=c++0x Test16.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.7.371 Build 20120928
Copyright (C) 1985-2012 Intel Corporation. All rights reserved.

Test16.cpp
Compiler Version : [ 1210 ]
Compiler Build Date: [ 20120928 ]
__cplusplus : [ 199711L ]

Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.

-out:Test16.exe
Test16.obj

>>...( __cplusplus is always 199711L, even with /Qstd=c++11...

Could you explain why is that so important? Is there a piece of code that checks for 199711L value?

Here are source codes of my test case:

// icl.exe /MD /Qstd=c++0x Test.cpp

#include "stdio.h"

#define STRING2( x ) #x
#define STRING( x ) STRING2( x )

#define __COMPILER_VER__ 8134

int main( void )
{
// Test case 1
// #pragma message ( "Compiler Version: " "[ " STRING( __COMPILER_VER__ ) " ]" )
// #pragma message ( "Source File : " __FILE__ "[ " STRING( __LINE__ ) " ]" )

// Test case 2
#pragma message ( "Compiler Version : " "[ " STRING( __INTEL_COMPILER ) " ]" )
#pragma message ( "Compiler Build Date: " "[ " STRING( __INTEL_COMPILER_BUILD_DATE ) " ]" )

// Test case 3
#pragma message ( "__cplusplus : " "[ " STRING( __cplusplus ) " ]" )

return ( int )0;
}

[ 32-bit Intel C++ compiler v13.x ]

..\Tests>icl.exe /MD /Qstd=c++0x Test16.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version 13.1.0.149 Build 20130118
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.

Test16.cpp
Compiler Version : [ 1310 ]
Compiler Build Date: [ 20130118 ]
__cplusplus : [ 199711L ]
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:Test16.exe
Test16.obj

..\Tests>icl.exe /MD /Qstd=c++11 Test16.cpp
Intel(R) C++ Compiler XE for applications running on IA-32, Version 13.1.0.149 Build 20130118
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.

Test16.cpp
Compiler Version : [ 1310 ]
Compiler Build Date: [ 20130118 ]
__cplusplus : [ 199711L ]
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:Test16.exe
Test16.obj

[ 64-bit Intel C++ compiler v13.x ]

..\Tests>icl.exe /MD /Qstd=c++0x Test16.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.149 Build 20130118
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.

Test16.cpp
Compiler Version : [ 1310 ]
Compiler Build Date: [ 20130118 ]
__cplusplus : [ 199711L ]
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:Test16.exe
Test16.obj

..\Tests>icl.exe /MD /Qstd=c++11 Test16.cpp
Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.149 Build 20130118
Copyright (C) 1985-2013 Intel Corporation. All rights reserved.

Test16.cpp
Compiler Version : [ 1310 ]
Compiler Build Date: [ 20130118 ]
__cplusplus : [ 199711L ]
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.

-out:Test16.exe
Test16.obj

Here is a link to supported C++11 features:

software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler

Leave a Comment

Please sign in to add a comment. Not a member? Join today