Issue Using MuParser in Qt Creator Project for C++

I am trying to include MuParser in my Qt Creator project, but I have been struggling for quite a while to get it working properly.

Where I am now, it appears to be unable to find several symbols in the MuParser library for whatever reason, and I am not really sure what to do about this. Does anyone have any idea what I might want to do to resolve this?

I downloaded the source code as a .zip file from the official website. After extracting the contents, I added a “build” directory to the folder. In MSYS2 MINGW64, I ran

cd (path to muparser folder)/build
cmake .. -DENABLE_SAMPLES=ON -DENABLE_OPENMP=ON -DENABLE_WIDE_CHAR=OFF -DBUILD_SHARED_LIBS=OFF
make

from the build directory. This produced the static library “libmuparser.a”.

I added this file, along with the headers, into my project folder in the following file structure:

(Project File)->libs->muparser->lib->libmuparser.a
(Project File)->libs->muparser->include->(MuParser Header Files)

Then, in my .pro file, I added

INCLUDEPATH += $$PWD/libs/muparser/include
LIBS += -L$$PWD/libs/muparser/lib -lmuparser

However, when I attempt to build the project, I get the following error messages:

collect2.exe:-1: error: ld returned 1 exit status
C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: in function `qMain(int, char**)':
C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: debug/main.o: in function `mu::Parser::~Parser()':
collect2.exe: error: ld returned 1 exit status
C:UsersAidan BeecherDesktopQt ProjectsTestMuParsermain.cpp:16: error: undefined reference to `__imp__ZN2mu6ParserC1Ev'
:-1: error: C:UsersAidan BeecherDesktopQt ProjectsTestMuParserbuildDesktop_Qt_6_7_2_MinGW_64_bit-Debug/../../main.cpp:17: undefined reference to `__imp__ZN2mu10ParserBase9DefineVarERKNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEEPd'
:-1: error: C:UsersAidan BeecherDesktopQt ProjectsTestMuParserbuildDesktop_Qt_6_7_2_MinGW_64_bit-Debug/../../main.cpp:18: undefined reference to `__imp__ZN2mu10ParserBase7SetExprERKNSt7__cxx1112basic_stringIwSt11char_traitsIwESaIwEEE'
:-1: error: C:UsersAidan BeecherDesktopQt ProjectsTestMuParserbuildDesktop_Qt_6_7_2_MinGW_64_bit-Debug/../../main.cpp:20: undefined reference to `__imp__ZNK2mu10ParserBase4EvalEv'
C:UsersAidan BeecherDesktopQt ProjectsTestMuParserlibsmuparserincludemuParser.h:50: error: undefined reference to `__imp__ZTVN2mu6ParserE'
:-1: error: C:UsersAidan BeecherDesktopQt ProjectsTestMuParserbuildDesktop_Qt_6_7_2_MinGW_64_bit-Debug/../../libs/muparser/include/muParser.h:50: undefined reference to `__imp__ZN2mu10ParserBaseD2Ev'
:-1: error: [Makefile.Debug:72: debug/TestMuParser.exe] Error 1
Error while buildingdeploying project TestMuParser (kit:-1: Desktop Qt 6.7.2 MinGW 64-bit)

As stated before, it appears unable to locate several MuParser library symbols, for whatever reason, though I have not edited any of the header files from how they were downloaded. Could this be an issue with the build of libmuparser.a?

EDIT: It was suggested to remove the previous update with my additional errors and locate the linkage command that caused my initial errors. While I am not seeing any command with the exact form of /some/path/x86_64-w64-mingw32-g++ -o debug/TestMuParser.exe..., I do see some similar looking lines. Are any of these the linker command? Particularly, the first line of the fourth box below looks as though it may be the linker command.

C:/Qt/Tools/mingw1120_64/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Aidan Beecher/Desktop/Qt 
Projects/TestMuParser/build/Desktop_Qt_6_7_2_MinGW_64_bit-Debug'
g++ -c -fno-keep-inline-dllexport -g -std=gnu++1z -Wall -Wextra -Wextra -fexceptions -mthreads -
DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_QML_DEBUG -DQT_WIDGETS_LIB -
DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../../TestMuParser -I. -
I../../libs/muparser/include -IC:/Qt/6.7.2/mingw_64/include -
IC:/Qt/6.7.2/mingw_64/include/QtWidgets -IC:/Qt/6.7.2/mingw_64/include/QtGui -
IC:/Qt/6.7.2/mingw_64/include/QtCore -Idebug -I. -IC:/VulkanSDK/1.3.290.0/include -
IC:/Qt/6.7.2/mingw_64/mkspecs/win32-g++  -o debugmain.o ....main.cpp
g++ -Wl,-v -Wl,-subsystem,windows -mthreads -o debugTestMuParser.exe debug/main.o 
debug/mainwindow.o debug/moc_mainwindow.o -L"C:UsersAidan BeecherDesktopQt 
ProjectsTestMuParserlibsmuparserlib" -lmuparser C:Qt6.7.2mingw_64liblibQt6Widgets.a 
C:Qt6.7.2mingw_64liblibQt6Gui.a C:Qt6.7.2mingw_64liblibQt6Core.a -lmingw32 
C:Qt6.7.2mingw_64liblibQt6EntryPoint.a -lshell32  

New contributor

Aidan Beecher is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật