LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 2013: OpenMP doesn't link with __stdcall

Hello,

 

Just tried OpenMP and linking fails if the default calling convention is set to "__stdcall".

 

error: Undefined symbol '__imp___omp_cvi_barrier@4' referenced in "c:\Users\Public\Documents\National Instruments\CVI2013\samples\OpenMP\cvibuild.mandel_omp\Debug\mandel_omp.obj".  
(and so on)

 

omp.h is missing the calling conventions. Is CVIFUNC_C the right one?

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 1 of 2
(3,604 Views)

You are correct. Because the calling convention is not specified, when __stdcall is set in Build Options, the default for unspecified functions becomes __stdcall. Since OpenMP was built with __cdecl, this causes linker errors. If you add CVIFUNC_C to omp.h and omp_cvi_internal.h. A simple fix would be to add it to the end of the OMP_API definition.

 

I have filed a bug report for this issue. You can track it with ID 424782.

National Instruments
0 Kudos
Message 2 of 2
(3,539 Views)