problem with the header file .h or .hpp

problem with the header file .h or .hpp

I use the Intel C++ compiler icpc, I have some problems with the following operations.

I made the compilation:

icpc -c matrix.cpp matrix.h 

I got the object file matrix.o

I then made the compilation:

icpc -c main.cpp matrix.h

I got the object file main.o

I try to make these two files together to make the executable file by the following operation:

icpc main.o matrix.o -o main

I cannot get the executable file main instead I have some warning messages from the compiler, saying on reference defined for my functions defined in the "class". I do not know why. But when I used the g++ compiler to repeat all the compilations above (All the commands are the same only change icpc with g++), everything is OK, and I got the correct executable file main and it runs well.

I repeat all the above operations and change the suffix of the header file from matrix.h to matrix,hpp.

I did the following compilation:

icpc -c matrix.cpp matrix.hpp

I got object file matrix.o and what's more I got a warning "icpc: warning #10145: no action performed for file'matrix.hpp '. "

I did the following compilation:

icpc -c main.cpp matrix.hpp

I got the object fiel main.o and the same warning again. 

I made together the two object files and got the final executable file by the following compilation:

icpc matrix.o main.o -o main

I got the final executable file main and it runs well. 

The question is that the intel C++ compiler icpc cannot recognize the header file .h?

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.