LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

error Undefined symbol

Solved!
Go to solution

Hello,

 

I'm using CVI2013 on Win7. 

I have a DLL project proj1.dll where I declared a function "GetExxotestList" like this : 

 

int __attribute__((overloadable)) GetExxotestList (int *NbCardUSB, int *NbCardPCI, struct DEVICE *Device[8])

DEVICE is a struct declared in the same .c file like this : 

struct DEVICE 
{
	unsigned long d;
....
};

In the .h file of this project, I declared only the function prototype like this :

int __attribute__((overloadable)) GetExxotestList (int *NbCardUSB, int *NbCardPCI, struct DEVICE *Device[8]);

And I compile it with no errors.

 

Now, in the Main project (executable) I wanted to call this function inside a callback function, so I did like this : 

int CVICALLBACK Refresh_Exxotest_Panel_CB (int panel, int control, int event,
			void *callbackData, int eventData1, int eventData2)
{
	int NbExxoCardUSB = 0;
	int NbExxoCardPCI = 0;
	struct DEVICE *Device[8];
	
	switch (event)
	{
		case EVENT_COMMIT:
			//Update exxotest list
			GetExxotestList (&NbExxoCardUSB, &NbExxoCardPCI, Device[8]);
			
			break;
	}
	return 0;
}

In the Main project, I added the .lib and .h files of the dll project. 

 

The problem is when I try to compile the Main, I have this link error :

error: Undefined symbol '__Z15GetExxotestListPiS_PP6DEVICE' referenced in "c:\ProjectX\Sources\Main\cvibuild.Main\Debug\Main.obj".

I can't undrestund why ! 

 

What is weird too, is that "Z15" and "PiS_PP6" labels are added automatically in the error message, I don't know what is it.

 

Please advice,

 

best regards, 

Houssam

 

 

 

 

 

0 Kudos
Message 1 of 6
(2,995 Views)

Hi Houssam,

 

You need to define the struct definition in the header file so that the external code module, or your main program can see that struct definition.

 

 

0 Kudos
Message 2 of 6
(2,940 Views)
Solution
Accepted by topic author BlueAnaconda

Hello 

 

int DLLAPI __stdcall GetExxotestList (int *NbCardUSB, int *NbCardPCI, struct DEVICE *Device[8]);

int __declspec(dllexport) __stdcall GetExxotestList (int *NbCardUSB, int *NbCardPCI, struct DEVICE *Device[8])

 

 

 

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

Hello houssam;

i have the same probleme when i compil without error but whene i debug i have this error i dont know why im using labwindows cvi 2017

error :

Build Status (OCR.prj - Debug)
 Link OCR Example_dbg.exe
  error: Undefined symbol '_DisplayError' referenced in "c:\Users\i87278\Desktop\OCR exp\cvibuild.OCR\Debug\OCR.obj".  
Build failed.

 

do you have any idea of this problem

thks

0 Kudos
Message 4 of 6
(2,117 Views)

Hello Rose, 

 

You may have to change the function declaration of "DisplayError" as I did. 

If this function is declared in another project, make sure that you included the header file (.h) and the object (.lib) in the OCR project. 

0 Kudos
Message 5 of 6
(2,113 Views)

Hello,

i include all the floder header but there are no object .lib what is it exactly

thks

0 Kudos
Message 6 of 6
(2,105 Views)