LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI RT Missing Export Error when using a DLL from VS2008

I am using CVI Real-Time 9.0.  I have an DLL that generates the following error when compiled in VS2008:

 

     "Error loading "test.dll": Missing export 'InitailizeCriticalSectionAndSpinCount' from 'KERNEL32.DLL'

 

However, if I build this dll in VS2005 everything work fine.  Is there something I am missing with the compiler or linker options?

 

 

0 Kudos
Message 1 of 6
(4,650 Views)

Tedoyle,

 

From what I understand you are compiling a DLL in visual studio that you plan on calling by CVI, and placing on a Real Time system. Are you getting this error durring compile time of your DLL in visual studio 2008 but not in 2005? Also were you previously able to call this compiled DLL in CVI 9.0 and place on a real-time system? What type of system is your real-time running on? Also have you put the compiled DLL through the Real Time DLL Checker ? This utility will verify that InitailizeCriticalSectionAndSpinCount can be called on your Real-Time system.

 

 

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 2 of 6
(4,612 Views)

Richard,

 

Sorry for the late reply.  I've been out of the office and not able to test this issue further.  What I have been able to do is create a DLL in VS2005 and install it into a CVI-RT app successfully.  However, if I migrate the app to VS2008 (no changes) I get the error I listed above at run-time.  Everything compiles fine in VS2008.  The error I get with the VS2008 version occurs at run-time since I usually manually install the DLL via manage RT files utility in CVI.  Also, as of yet I have not tried the Real Time DLL Checker.  This is next on my list.

 

 

0 Kudos
Message 3 of 6
(4,513 Views)

Richard,

 

I downloaded the LabView RT DLL Checker.  First I checked the DLL I created with VS2005 with the following results:

 

"DLL is good, but uses some stubbed imports."

 

Then I checked the DLL created with VS2008 (no code changes) with the following results:

 

"DLL is bad.  Check the imports." (2 bad imports: GetModuleHandleW & InitializeCriticalSectionAndSpinCount)

 

Any suggestions regarding this issue?

 

0 Kudos
Message 4 of 6
(4,483 Views)

Tedoyle,

 

It sounds like a difference in the compiler. Are you manually calling InitializeCriticalSectionAndSpinCount ? If so, is it possible for you to take that out of your project? If you aren't explicitly calling it, you may need to walk through your dependencies, and see what exactly is calling that function from the Kernel32.lib , and then figure out a way to not include those dependencies. Have you tried posting in any Visual Studio forums about the compiler differences? 

Richard S -- National Instruments -- (former) Applications Engineer -- Data Acquisition with TestStand
0 Kudos
Message 5 of 6
(4,463 Views)

Tedoyle,

 

The problem is that the real-time operating system included with the CVI 9.0 Real-Time Module does not include all the necessary Win32 API function implementations needed by the VC9 run-time (which is used by VS2008).  The CVI 9.0 Real-Time Module does work with VS2003 and VS2005, however.  A future version of the CVI Real-Time Module should contain the additional entry points that you mentioned and will then work with VS2008-built DLLs.

 

-Jeff

National Instruments

 

Message 6 of 6
(4,428 Views)