LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to fix function redeclaration errors

I am using someone elses DLL and header file.  The header files defines a GetKey() function.  The CVI Utilities.h file also has a declaration of a GetKey() function.  How can I fix this issue.  I can not recompile the DLL to change the name.  I was thinking of  coping the utilitiy file locally and commenting out the GetKey() function so the software would compile.  Or is it possible to redefine a function? 
 
Jon K.
 
 
0 Kudos
Message 1 of 4
(3,672 Views)

This article offers some advice for a very similar scenario, which may be of help in your circumstances.

JR

0 Kudos
Message 2 of 4
(3,665 Views)

I could not get the #undef to work.  Where do I put it in C file or header file itself?

 

#include <Utilitity.h>

#undef GetKey

#incldue <xyz.h>

#include <mydll.h>

0 Kudos
Message 3 of 4
(3,660 Views)
Hi,

as I've understand in the article,

you have two solutions :

first your code will include yourdll and then the utility.h from CVI

If it does not work, just add #undef function_name, it will undefine the CVI function

So it should be something like :

#include <yourdll>
#include <utility.h>
#undef GetKey()


0 Kudos
Message 4 of 4
(3,647 Views)