LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Link errors for Labwindows CVI.

Solved!
Go to solution

I am currently trying to implement the exer1.cws example from the Cvi sample and tutorials section.

But i get 9 Link errors while trying to generate the DLL.

I have attached the Link errors as a txt file.

Please tell me whats wrong with the program??

 

I have incorporated the RTmain as entry point function of the program.

I have initialised variables used in the main program globally.

Other user interface functions have also been defined outside the body of the Rtmain program.

 

 

Hope this info is sufficient.

Regards

 

raghu

0 Kudos
Message 1 of 6
(3,892 Views)

Hi raghu,

 

You would get this error if you had somehow specified a different linkage option for your DLL (real-time or instrument driver). That program requires the full run-time engine support. You should also replace your RTMain entry point with main.

 

Navigate to Build>>Target Settings and make sure that you specify the following setting:

 

TargetSettings.png

0 Kudos
Message 2 of 6
(3,883 Views)

Hey , Thanks for the reply.

 

The tutorial asks us to select the Option as 'Real Time Only'.

I reverted to 'Full Run-time engine' as you asked.

But there is no change.

 

Although i did debug most of the erros.

I just included the Functions in the headerfile.

But even though, i am stuck with two errors.

 

 

 

I am attaching the complete set as txt file.

Please see if you notice anything unorderly.

🙂

 

Download All
0 Kudos
Message 3 of 6
(3,878 Views)

That program cannot run with the "Real Time Only" option as this is not a real-time program. Which tutorial, exactly, are you using? Is this the Getting Started manual? If so, where does it say to use that option?

 

Do you still have the original exer1.c file that was in the tutorials\solution folder? If so, just use that file and it should build correctly.

 

If you no longer have the original, you need to modify your attached code by pulling the entire main function from inside the RTMain function and then delete what's left of RTMain. In other words, make the following change:

 

void CVIFUNC_C RTmain (void)
{
if (InitCVIRTE (0, 0, 0) == 0)
return; /* out of memory */

/* your initialization code */

while (!RTIsShuttingDown ())
{
/* your code */

int main (int argc, char *argv[]);
{
if (InitCVIRTE (0,argv,0) == 0)
return; /* out of memory */
if ((panelHandle = LoadPanel(0,"exer1.uir",PANEL)) < 0)
return;
DisplayPanel (panelHandle);
RunUserInterface ( );
DiscardPanel (panelHandle);
return;
}
/* sleep for some amount of time to give the desired loop rate */
/* if you do not sleep lower priority threads will never run */
Sleep (100);
}

/* your cleanup code */

CloseCVIRTE ();
}

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

hello Luis.

 

          I understand that the program was not meant for a real time application.

          My intention was to know if it was possible to convert it into one.

          I have done as you have asked and the errors still remain.

          Maybe something else this time.

          have attached the files.

          Regards

          Raghu

Download All
0 Kudos
Message 5 of 6
(3,851 Views)
Solution
Accepted by topic author ragraymond

You have a semi-colon at the end of line 13 that you need to remove.

 

This program uses the UI library. You cannot use the UI library in real-time programs.

 

Luis

Message 6 of 6
(3,830 Views)