Quantcast
Channel: Intel® Software - Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1175

how to solve the compiling error of misusing wrong header

$
0
0

Hi,

I use gcc to build some project on centos 6, where 'icc (ICC) 14.0.2 20140120' has been installed.

I add the following script to ~/.bash_profile to set some environment:

export CC=icc
export CXX=icpc
export LD=xild
export CFLAGS="-std=gnu99 -O3 -ip -restrict -xSSE3 -axSSE3,SSSE3,SSE4.1,SSE4.2"
export CXXFLAGS=" -O3 -ip -restrict -xSSE3 -axSSE3,SSSE3,SSE4.1,SSE4.2"
export CPPFLAGS="-I/opt/intel/include"
export LDFLAGS="-L/opt/intel/lib -L/opt/intel/composer_xe_2013_sp1.2.144/compiler/lib/intel64"
source /opt/intel/composer_xe_2013_sp1/bin/compilervars.sh intel64
source /opt/intel/ipp/bin/ippvars.sh intel64

 

But gcc is used to build some project by using ./configure CC=gcc, and then 'make' will report error as shown below:

gcc -DHAVE_CONFIG_H -I. -I../..   -I/opt/intel/include  -std=gnu99 -O3 -MT file1.o -MD -MP -MF .deps/file1.Tpo -c -o file1.o file1.c
In file included from file2.h:6,
                 from file1.c:2:
/opt/intel/include/math.h:29:3: error: #error "This Intel <math.h> is for use with only the Intel compilers!"

 

It seems gcc building system will use Intel's math.h instead of system's math.h. How to build project by using gcc under the environment where icc is installed?

Thanks!

Andrew

 

 

Thread Topic: 

How-To

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>