LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Matlab DLL into LabWindows/CVI

I am new to the LabWindows/CVI & TestStand environment but trying to import
Matlab 2008a DLLs into LabWindows/CVI but when compiling the MatLab
generated H files I keep generting redefinitions. As an example, here are a
few

"wchar.h"(78,31) Redeclaration of '_ctype' previously declared at
ctype.h:33.
"wchar.h"(84,52) Redefinition of macro '_UPPER'.
"win.h"(2907,40) Redefinition of macro 'THREAD_PRIORITY_ABOVE_NORMAL'.
"win.h"(2908,43) Redefinition of macro 'THREAD_PRIORITY_BELOW_NORMAL'.

Has anyone been successful with importing a MatLab DLL into CVI? Any
suggestions would be appreciated or am I wasting my time???

Michel


0 Kudos
Message 1 of 5
(4,051 Views)
Try changing the order of your include files (matlab first).
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 2 of 5
(4,042 Views)

Hello Michel,

 

If the previous post does not work for you, you might also try using preprocessor directives such as #ifdef and/or #ifndef to avoid redefinition.

Message Edited by Gist on 11-13-2008 12:14 PM
0 Kudos
Message 3 of 5
(4,029 Views)
Guillaume & Gist

Thanks for the suggestion of changing the order of H files as it has fixed
most of the problems. I am trying to used the Options-Build Options to add
compiler defines but not able to get to work. Do I need something special to
have the compiler use the defines I have added or just add to my own H
files?

Michel

"Gist" <x@no.email> wrote in message
news:1226601611490-808646@exchange.ni.com...
> Hello Michel, &nbsp;If the previous post does not work for you, you might
> also try using preprocessor directives such as #ifdef and/or #ifndef to
> avoid redefinition.Message Edited by Gist on 11-13-2008 12:14 PM


0 Kudos
Message 4 of 5
(4,010 Views)

Michel,

 

You should be able to type the preprocessor directives directly into your header file without configuring any of the environment options.  I have the default options that were set with installation and it allows me to build a project with these directives.

0 Kudos
Message 5 of 5
(3,997 Views)