Using clibgen.generateLibraryDefinition on QT inclusive libaries
6 ビュー (過去 30 日間)
古いコメントを表示
The error is similar to the one recieved in VS2022 when the project type is set incorrectly. I have the additional compiler flags added into additionalCompilerFlags, but they seem to do nothing.
Code:
headerFile = "C:\MYAPP\my_driver.h";
libFile = "C:\MyAPP\my_driver.dll";
includePath = ["C:\Qt\Qt6.7.0\6.7.0\msvc2019_64\include",...
"C:\Qt\Qt6.7.0\6.7.0\msvc2019_64\include\QtCore",...
"C:\Qt\Qt6.7.0\6.7.0\msvc2019_64\include\QtSerialPort",...
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"];
additionalCompilerFlags = "/std:c++17 /Zc:rvalueCast /Zc:inline /Zc:strictStrings /Zc:throwingNew /permissive- /Zc:__cplusplus /Zc:externConstexpr /utf-8 /w34100 /w34189 /w44996 /w44456 /w44457 /w44458";
libName = "MYLIB";
clibgen.generateLibraryDefinition(headerFile, "Libraries", libFile, "PackageName", libName, "IncludePath", includePath, 'AdditionalCompilerFlags', additionalCompilerFlags)
Error:
Errors parsing interface generation files.
C:\Qt\Qt6.7.0\6.7.0\msvc2019_64\include\QtCore\qcompilerdetection.h(460):
warning: this feature-test macro is ignored (and returns 0) in the current compilation mode
C:\Qt\Qt6.7.0\6.7.0\msvc2019_64\include\QtCore\qcompilerdetection.h(1257):
error: #error directive: "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus
option to the compiler."
0 件のコメント
回答 (1 件)
Kautuk Raj
2024 年 5 月 22 日
I can observe that you are facing compilation errors due to Qt's C++17 requirements and potentially incorrect compiler flag settings in MATLAB.
From the information provided, I can see that the IncludePath refers to this path:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include". Here, Visual Studio 14.0 refers to Visual Studio 2015, which is not supported by MATLAB R2023b.
I suggest using a supported compiler, the list of which can be referred to in this document: https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/system-requirements-release-2023b-supported-compilers.pdf
Reproducing from the above document: Visual Studio Community, Professional, and Enterprise editions are supported. The “Desktop development with C++” workload is required for MEX and associated functionality.
I trust this response will guide you towards resolving your problem.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!