From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-09-2020 02:39 AM
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!
Solved! Go to Solution.
11-10-2020 06:28 AM - edited 11-10-2020 06:32 AM
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.
11-10-2020 07:46 AM
@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.
11-10-2020 08:06 AM - edited 11-10-2020 08:22 AM
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).
11-10-2020 08:48 AM
@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!