LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Import Shared Library: The following symbols are not defined

Solved!
Go to solution

Hello!

I' m trying to import (with the Import Shared Library tool in LV) the libschremote.dll file attached, using the libschremote.h header file.

I have the same problem with 4 functions using the sr_pin_type varibale (which is an enum, line 140 in the header file):

"The following symbols are not defined:
sr_pin_type;"

and those functions cannot be imported.

What do i have to add in the preprocessor definitions to solve this issue?

Thank you!

Download All
0 Kudos
Message 1 of 5
(262 Views)

C++ ism in the header file!

 

Add typedef in front of the enum declaration like this and it should work:

 

 

typedef enum sr_pin_type {sr_pt_analog_in=0, sr_pt_din, sr_pt_din_pullup, sr_pt_dout_low, sr_pt_dout_high, sr_pt_dout_opendrain_open, sr_pt_dout_opendrain_short};

 

 

Also the wizard won't be able to create the correct code for handling the SR_IPLIST linked list returned by sr_discover(). That's going to be some nasty pointer woodoo you have to do in the LabVIEW diagram yourself.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 2 of 5
(202 Views)

@rolfk  ha scritto:

C++ ism in the header file!

 

Add typedef in front of the enum declaration like this and it should work:

 

 

typedef enum sr_pin_type {sr_pt_analog_in=0, sr_pt_din, sr_pt_din_pullup, sr_pt_dout_low, sr_pt_dout_high, sr_pt_dout_opendrain_open, sr_pt_dout_opendrain_short};

 

 

Also the wizard won't be able to create the correct code for handling the SR_IPLIST linked list returned by sr_discover(). That's going to be some nasty pointer woodoo you have to do in the LabVIEW diagram yourself.


Hi,

I edited the header file like so, but I still get the same problem.

0 Kudos
Message 3 of 5
(191 Views)
Solution
Accepted by palazz

Sorry but there is still a C++ ism in there.

 

Change the definition as follows:

 

typedef enum sr_pin_type {sr_pt_analog_in=0, sr_pt_din, sr_pt_din_pullup, sr_pt_dout_low, sr_pt_dout_high, sr_pt_dout_opendrain_open, sr_pt_dout_opendrain_short} sr_pin_type;

 

The first sr_pin_type is only a tag name space designator, the second is the actual ordinary or global name space designator which is used in tradtional C when refering to that type.

 

With the declaration as it was you would have to write the function declarations like:

 

SR_FUNC int sr_pin_setup(SR_HANDLE srh, int pin, enum sr_pin_type pin_type);

 

in order to be compatible with standard C (with the exception of possibly some C17 or newer standard).

 

Rolf Kalbermatter
Averna BV
Message 4 of 5
(186 Views)

@rolfk  ha scritto:

Sorry but there is still a C++ ism in there.

 

Change the definition as follows:

 

typedef enum sr_pin_type {sr_pt_analog_in=0, sr_pt_din, sr_pt_din_pullup, sr_pt_dout_low, sr_pt_dout_high, sr_pt_dout_opendrain_open, sr_pt_dout_opendrain_short} sr_pin_type;

 

The first sr_pin_type is only a tag name space designator, the second is the actual ordinary or global name space designator which is used in tradtional C when refering to that type.

 

With the declaration as it was you would have to write the function declarations like:

 

SR_FUNC int sr_pin_setup(SR_HANDLE srh, int pin, enum sr_pin_type pin_type);

 

in order to be compatible with standard C (with the exception of possibly some C17 or newer standard).

 


It worked, i edited every single function using sr_pin_type as you said and it compiles smoothly. Regarding the other issue you mentioned, I'm fine with that.

Thank you so much!

0 Kudos
Message 5 of 5
(175 Views)