LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

found '*' expecting ')' during Export

Hello dear

 

i am getting an error during Exporting a function to create my own DLL. its prototype is

 

__declspec(dllexport) WDC_DEVICE_HANDLE SP6_2008_MOD_DeviceOpen(const WD_PCI_CARD_INFO *pDeviceInfo);

 

where

typedef struct
{
    WD_PCI_SLOT pciSlot;    
    WD_CARD Card;          
} WD_PCI_CARD_INFO, WD_PCI_CARD_INFO_V30;

 

the error point has been highlighted in the above statement. i am attaching the snapshot also.

 

this code was working fine in visual studio 2008 earlier. whats wrong here in labwindows then !!!

 

thanks with regards

 

Zafar

 

 

0 Kudos
Message 1 of 7
(3,481 Views)

Hi Matrix39,

 

Do you have the definition for WD_PCI_CARD_INFO?

 

Thanks,

KyleP
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(3,453 Views)

Dear Kyle

 

the definition which i referred to in my query has been included in the header file (present in my project)

it also gives similar error for other exported function also.

i am also including my project for your reference. Some more header files which may be required are copied in to this project folder.

 

thanks and regards

 

Zafar

0 Kudos
Message 3 of 7
(3,446 Views)

Hello Matrix,

Since you mentioned that the code worked perfectly fine in Visual Studio 2008, I think that the problem lies elsewhere. Both CVI and Visual Studio should be able to compile and run C code since ANSI C hasn't changed in a very long time. Perhaps it has something to do with a difference in the Build Options in CVI. One thing that came to mind is the calling convention that was used. I think that by default VS uses cdecl calling convention. You can read some more about calling conventions here. To change the calling convention to cdecl from stdcall in LabWindows/CVI you can open up the Build Options dialog box from the Options menu.

Hope that helps.

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Message 4 of 7
(3,428 Views)

Dear Jacob

 

the point where i am getting the Error "found '*' expecting ')' " is basically a pointer to structure of structures (of a third party whose definitions have been included in the included Headers). just for checking i made another structure (ActivityFlags) in my existing structure (BCCreateMsg) and referenced it using a pointer in "BCXmtMsg" function. But this gave no Error.........This is very strange !!!

For simplicity i remarked one of the structure variable (WD_ITEMS) in the WD_CARD_PCI_INFO structure, so the other structure WD_PCI_SLOT only has simple variables now. But still i get the same error and DLL creation is aborted.

 can you please explain the difference for WHY compiler is behaving unpredictably for the very similar functions, structures and arguments.

i am attaching the project also for the above scenario.

 

i have tried by changing the calling conventions but that makes no difference in this situation.

 

hoping to have the prompt favourable solution...

 

thanks and regards..

 

ZAFAR

0 Kudos
Message 5 of 7
(3,412 Views)

Hello Matrix,

 

I have tried to replicate the error you are seeing and cannot reproduce it.

In theory everything you are doing seems to be fine. I have even tried referencing a struct that referenced a struct which had another struct in it, to immediate your code, and I was able to compile without any issues.

For some reason when I try to compile your code I get other compilation errors.

Which version of LabWindows/CVI are you using?

 

Have you tried copying the code into a new project with empty c and h files? Basically copying and pasting the text from each file into new ones to duplicate the project. It may be that something got corrupted with the code in transferring it from Visual Studio to LabWindows/CVI.

 

The compiler should work the way you are expecting it to work.

 

Jacob

 

Jacob R. | Applications Engineer | National Instruments

0 Kudos
Message 6 of 7
(3,397 Views)

Dear Jacob

 

that problem has resolved.  i was actually including the header which had the definitions oof the structure after the file having their prototypes.

thanks a lot for your guidance.

 

 

best regards

 

Zafar

0 Kudos
Message 7 of 7
(3,387 Views)