[問題] MEX可編譯C++的code嗎? 還是只能C?
我的matlab版本是2008a 64bit 作業系統是win7 64bit
使用的編譯器是visual c++ 2008
剛開始跑版上M文給的範例(Hello World)當然是可以compile
但因為我比較習慣用C++寫
所以加了include<iostream> 改用cout 結果竟然出現compile失敗
以下是我的程式碼
#include <iostream>
#include"mex.h"
using namespace std;
void mexFunction(
int nlhs, mxArray *plhs[],
int nrhs, const mxArray *prhs[])
{
cout << "Hello! World!\n";
}
請問這樣打有什麼問題嗎? 還是真的不能compile C++
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.170.155
※ 編輯: kuenya 來自: 140.113.170.155 (05/05 00:09)
→
05/05 16:12, , 1F
05/05 16:12, 1F
→
05/05 16:13, , 2F
05/05 16:13, 2F
→
05/05 17:13, , 3F
05/05 17:13, 3F
→
05/06 09:05, , 4F
05/06 09:05, 4F
→
05/06 12:38, , 5F
05/06 12:38, 5F
推
05/06 22:31, , 6F
05/06 22:31, 6F
→
05/07 16:40, , 7F
05/07 16:40, 7F
→
05/07 16:42, , 8F
05/07 16:42, 8F
→
05/07 16:44, , 9F
05/07 16:44, 9F