Error : undefined reference to 'engOpen'

2019-09-11 04:36发布

Please, I'm looking for a solution to this problem erreur : undefined reference to 'engOpen' when I try to call mtlb function for c++

I'm working on win64 with QT creator.

Here is my .pro file:

TEMPLATE = app

QT += qml quick
CONFIG += c++11

SOURCES += main.cpp

RESOURCES += qml.qrc

INCLUDEPATH += "C:\Program Files\MATLAB\R2012a\extern\include"
LIBS += -L "C:\Program Files\MATLAB\R2012a\bin\win64"

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Default rules for deployment.
include(deployment.pri)

1条回答
做个烂人
2楼-- · 2019-09-11 04:57
LIBS += -L "C:\Program Files\MATLAB\R2012a\bin\win64"

You're only setting the lib path, you also have to point to the lib file:

LIBS += -L<path> -l<file without extension>

On Windows you can also just set the full path (with file), but the above format should work both with Unix and Windows. In your .pro you're mixing the Unix format and the Windows format.

Cf the Qt documentation.

查看更多
登录 后发表回答