E
E
Egorithm2020-01-14 13:17:44
Qt
Egorithm, 2020-01-14 13:17:44

How to connect the [muParser] library to Qt?

I will need to link the muParser library ( GitHub ) to Qt Creator.
The problem is that I don't fully understand how to do this, because:
1) It needs to be installed via the console via the configure file (on Linux).
2) It contains configuration files (makefiles).
If there were just headers and sources, then this is one thing, but here I don’t know. Never did it. Please tell me how to do this, where can I read about it in detail?
I need to build the project so that on another device it can be compiled from the project without additional installations (well, that is, from Qt Creator).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2020-01-14
@EgoRusMarch

There are several options here.
1. Build *.a (by any suitable method), throw h-files into the include directory of the compiler, *.a into the lib directory of the compiler. Add LIBS += -lmuparser to the project.
2. Throw the source code of the library somewhere in the project, add * .cpp (maybe not all) to this very project. To make it more convenient to include files, write INCLUDEPATH += muparser/include
3. An intermediate option is to collect *.a, throw it and *.h somewhere in the project. Add LIBS += -L$$PWD -lmuparser, INCLUDEPATH += muparser/include to the project
4. Build a package for Qt. How, I don't know.
When do I use which method?
1. Only if the library is in the MSYS distribution.
2. In the vast majority of cases.
3. Sometimes, especially if the library is large. Well, if the authors offer an "official" DLL - after collecting, for example, using Dependency Walker + DllTool, the appropriate * .a and versioning it. (Large projects cannot do without the LLD linker, but, unlike LD, it does not pick up *.DLL, you need to create a library file.)
4. If there is an "official" package. One such library is QWT.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question