views:

570

answers:

2
#include <intrin.h>

The above will report:

intrin.h: No such file or directory

Which seems to be a MSVC header file,but I'm using eclipse cdt,how can I make it available?Is there some libraries needed?

cdt uses MinGW for compiling,but there is no intrin.h:

D:\Tools\MinGW\lib\gcc\mingw32\3.4.5\include>dir *intrin.h

2006-01-17  21:47            34,528 emmintrin.h
2006-01-17  21:47            22,281 mmintrin.h
2006-01-17  21:47             3,586 pmmintrin.h
2006-01-17  21:47            30,925 xmmintrin.h

Is there anyone can help?

A: 

I think the include directory is set by C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat or other .bat in the same directory depending of the architecture type when using VS.

These headers are in C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include, so you may want to include that folder or set the proper environment variable.

Xavier
+2  A: 

This is a header that declares a bunch of "intrinsics" -- functions that are built into the compiler so it can emit inline code for them. If you're using VC++ as the compiler, it should be in the same directory with its other standard headers. If you're using a different compiler, you'll need to change the intrinsics to suit the compiler you are using. gcc, for example, has a lot of similar intrinsic functions, but with slightly different names.

Edit: Given that you're using MinGW (I.e., gcc), you're pretty much stuck with porting the code (or using VC++). If you're dealing with a fairly small amount of code, one way to do that is to comment out the line that includes that header, and try to compile it. The compiler will point out errors where the intrinsic functions were used that gcc doesn't have. You can then look those up (e.g., on MSDN) and try to find something that gcc does provide that does (close enough to) the same thing. Depending on what it uses (and how much) that may be quick and easy, or it may be easier to start over producing new code to do the same things.

The *intrinsic headers you've found will (probably) contain declarations of (at least some of) gcc's counterparts to Microsoft's that you need to replace. You'll probably end up using them in the process of porting the code, so don't forget about them. At the same time, just including those headers instead of Microsoft's almost certainly isn't going to make the code work either.

Jerry Coffin
But I'm using eclipse-cdt:(
Mask
Eclipse is an editor/IDE. What matters here is what compiler you're using *with* Eclipse.
Jerry Coffin
It uses the MinGW toolchain.
Mask
@Mask: MinGW doesn't support that header. Period.
Billy ONeal