在Labview裡使用matlab所建出的dll檔已回收
dear all,
我希望能在labview裡使用matlab建出的dll,
由於matlab所產生的dll資料格式, labview認不出來,
所以必須藉由VC來做溝通, 建一個wrapper的dll,
將資料格式轉成matlab看得懂的.
參考出處 :
http://forums.ni.com/ni/board/message?board.id=170&message.id=29793&view=by_date_ascending&page=3
NOTE: 在討論的最後, 有人寫了一個step by step 的參考文件, 來解決這個問題,
文件如下
http://forums.ni.com/ni/attachments/ni/170/186604/1/dllexample.zip
參考文件用的版本是
1. matlab 7.0
2. MS VC++ 6.0
--------------------------------
我在底下版本去實做:
1.Matlab version 7.4
2.MS VC++ 6.0(sp6)
matlab 的部分, 似乎比較容易, 可以產生出vc要的檔案,
不過在vc部分, 無法編出dll檔
我對 vc的部分相當不熟悉, 在setting參數的時候, 也不能完全確定,
因為版本跟文件裏的有些不同.
這個問題困擾我許久,
有任何建議, 請不吝賜教
感謝
錯誤訊息 ;
Compiling...
dllexample.cpp
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1528) : error C2065: 'REFCLSID' : undeclared identifier
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1528) : error C2146: syntax error : missing ')' before identifier 'clsid'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1528) : error C2182: 'mclCLSIDtochar' : illegal use of type 'void'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1528) : error C2059: syntax error : ')'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1532) : error C2065: 'REFGUID' : undeclared identifier
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1532) : error C2146: syntax error : missing ')' before identifier 'guid'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1532) : error C2182: 'mclGUIDtochar' : illegal use of type 'void'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1532) : error C2059: syntax error : ')'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1590) : error C2061: syntax error : identifier 'REFCLSID'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1601) : error C2146: syntax error : missing ')' before identifier 'clsid'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1603) : error C2059: syntax error : ')'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1608) : error C2061: syntax error : identifier 'REFCLSID'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1618) : error C2146: syntax error : missing ')' before identifier 'clsid'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1620) : error C2059: syntax error : ')'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1625) : error C2061: syntax error : identifier 'REFCLSID'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1635) : error C2146: syntax error : missing ')' before identifier 'clsid'
c:\program files\matlab\r2007a\extern\include\mclmcr.h(1637) : error C2059: syntax error : ')'
Error executing cl.exe.
dllexample.obj - 17 error(s), 0 warning(s)
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.198.94.135
※ einstein328:轉錄至看板 C_and_CPP 12/26 03:02