Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
Taylor Kidd
Total Points:
200
Status Points:
150
Green Belt
June 10, 2009 3:14 PM PDT
winnt.h declaration incompatible with func declared in emmintrin.h
I assume that this forum is trolled by the Intel C++ experts for answers the communal mind doesn't have.

I'm using Visual C++ 2008 (9.0.21022.8). And IC C++ 11.0.066.

I'm working on a module that uses old SSE 2 code. It compiles fine with VS but gets the following error using the IC:

1>Getblk_sse2.cpp
1>C:\Program Files\Microsoft SDKs\Windows\v6.0A\\include\winnt.h(3332): error #147: declaration is incompatible with "void __cdecl _mm_pause()" (declared at line 375 of "C:\Program Files\Intel\Compiler\11.0\066\cpp\include\emmintrin.h")
1> _mm_pause (
1> ^
1>


The only thing I can find is that errors similar to this can occur if you're using an older version of the IC with a newer version of VS. But I'm not.

Any ideas? I'm using Vista SP2.

Jennifer Jiang (Intel)
Total Points:
19,627
Status Points:
19,127
Brown Belt
June 10, 2009 4:17 PM PDT
Rate
 
#1
did you use "__cdecl (/Gd)"? Try to add it.

Jennifer



Taylor Kidd
Total Points:
200
Status Points:
150
Green Belt
June 10, 2009 5:51 PM PDT
Rate
 
#2 Reply to #1
did you use "__cdecl (/Gd)"? Try to add it.

Jennifer


Jennifer,

Thanks. It worked.

MSDN has an explanation of the calling conventions (http://msdn.microsoft.com/en-us/library/46t77ak2.aspx), but I have to admit that I'm not sure about their advantages and disadvantages outside of __fastcall.

So I'm guessing that the problem was that winnt.h uses a __stdcall convention which didn't match with the __cdecl convention used in emmintrin.h. (Hey, if I'm wrong, correct me.)

--Taylor



Jennifer Jiang (Intel)
Total Points:
19,627
Status Points:
19,127
Brown Belt
June 10, 2009 6:27 PM PDT
Rate
 
#3 Reply to #2
Quoting - Taylor Kidd

So I'm guessing that the problem was that winnt.h uses a __stdcall convention which didn't match with the __cdecl convention used in emmintrin.h. (Hey, if I'm wrong, correct me.)
It's the mixmatch of winnt.h and emmintrin.h. If you do not use winnt.h, you can still use _stdcall with emmintrin.h. The icl knows what to do.

Jennifer




Intel Software Network Forums Statistics

8285 users have contributed to 31229 threads and 99107 posts to date.
In the past 24 hours, we have 7 new thread(s) 35 new posts(s), and 47 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member tvinni