LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined symbol '_set_pts' referenced in "new.c".

Hi, this code works in other compilers such as Bloodshed, and even runs fine when I use the command line.  However I need it to work in CVI... here is where new.c references set_pts:
 
#include <stdio.h>
#include <ctype.h>
#include <spinpts.h>
#include <ansi_c.h>
int spinpts300(double frequency, int phase)
{
 PTSDevice PTS300;
 PTS300.mfreq = 300.0;
 PTS300.allowPhase = 1;
 PTS300.fullRange10MHz = 0;
 
 return set_pts(frequency, phase, &PTS300);
}
 
 
and here is where spinpts.h calls the function:
 
 #ifdef WINDOWS
 #ifdef DLL_EXPORTS
 #define SPINPTS_API  _declspec(dllexport) __stdcall
 #else
 #define SPINPTS_API  _declspec(dllimport) __stdcall
 #endif
 #else
 #define SPINPTS_API
 #endif
SPINPTS_API int  set_pts( double frequency, int phase , PTSDevice* device );
 
I have already generated DLL import libraries for the .h
 
 
0 Kudos
Message 1 of 4
(3,223 Views)

And of course you have added said libraries to the project...

JR

0 Kudos
Message 2 of 4
(3,221 Views)
Yes I generated import libraries since I am using DLL's.
0 Kudos
Message 3 of 4
(3,218 Views)

Hi smckeonn,

Jonathan brings up some other things to consider in this thread:
http://forums.ni.com/ni/board/message?board.id=180&message.id=29343&requireLogin=False

You may want to double check you calling convention, as described in this KnowledgeBase article:

Link Error When Calling a DLL in LabWindows/CVI
http://digital.ni.com/public.nsf/allkb/6A7825928D19C5318625714C006CEEC7?OpenDocument

Regards,
John B.



Message Edited by NI-Bongo on 06-26-2008 10:13 PM
Regards,
John Bongaarts
0 Kudos
Message 4 of 4
(3,180 Views)