0

我在编译 It++ 库时遇到问题。我已经正确安装了它,并用一个没有 mex 的简单示例对其进行了测试。

mex it_mex_fkmigration.cpp -litpp

it_mex_fkmigration.cpp:1:25: error: itpp/itcomm.h: No such file or directory
it_mex_fkmigration.cpp:2:26: error: itpp/itmex.h: No such file or directory
it_mex_fkmigration.cpp:4: error: expected namespace-name before ';' token
it_mex_fkmigration.cpp:4: error: '<type error>' is not a namespace
it_mex_fkmigration.cpp:6: error: 'mxArray' has not been declared
it_mex_fkmigration.cpp:6: error: expected ',' or '...' before '*' token
it_mex_fkmigration.cpp:6: error: ISO C++ forbids declaration of 'mxArray' with no type
it_mex_fkmigration.cpp: In function 'void mexFunction(int, int**, int, int)':
it_mex_fkmigration.cpp:9: error: 'mexErrMsgTxt' was not declared in this scope
it_mex_fkmigration.cpp:10: error: 'mexErrMsgTxt' was not declared in this scope
it_mex_fkmigration.cpp:13: error: 'bvec' was not declared in this scope
it_mex_fkmigration.cpp:13: error: expected `;' before 'input_bits'  
it_mex_fkmigration.cpp:16: error: 'cvec' was not declared in this scope
it_mex_fkmigration.cpp:16: error: expected `;' before 'output_symbols'
it_mex_fkmigration.cpp:17: error: 'QPSK' was not declared in this scope
it_mex_fkmigration.cpp:17: error: expected `;' before 'qpsk'
it_mex_fkmigration.cpp:19: error: 'output_symbols' was not declared in this scope
it_mex_fkmigration.cpp:19: error: 'qpsk' was not declared in this scope
it_mex_fkmigration.cpp:19: error: 'input_bits' was not declared in this scope
it_mex_fkmigration.cpp:23: error: 'mxCOMPLEX' was not declared in this scope
it_mex_fkmigration.cpp:23: error: 'mxCreateDoubleMatrix' was not declared in this scope
it_mex_fkmigration.cpp:26: error: 'cvec2mxArray' was not declared in this scope 
4

1 回答 1

0

您需要知道mexIt++ 库的位置。使用-I选项指定包含路径;以及-L指定库搜索路径的选项。

mex it_mex_fkmigration.cpp -litpp -Ipath/to/it++/library -Lpath/to/libitpp

过去我在使用该-L选项时遇到过麻烦,不得不通过使用该选项指定库的整个路径来解决它-l

mex it_mex_fkmigration.cpp -lpath/to/libitpp/libitpp.a -Ipath/to/it++/library

可以传递给mex的其他选项列在文档中(在Mex 脚本开关部分下)。

此外,关于 等的错误mxArray表明mexErrMsgTxt您没有包含mex.hit_mex_fkmigration.cpp

于 2012-11-28T18:44:03.213 回答