E
E
Egorithm2020-01-15 22:42:59
Qt
Egorithm, 2020-01-15 22:42:59

How to build the .lib library [muParser]?

I need to link the muParser library ( GitHub ) to a Qt Creator project.

In the Install.txt file I read:
1. Installation on win32
========================
muParser supports various win32 command-line compilers:
    -> mingw
    -> watcom
    -> microsoft CL
and provides also the project files for MSVC6 IDE.

In order to compile muParser from makefiles, open an MSDOS prompt and
then move to the muParser/build directory and type:
    mingw32-make -fmakefile.mingw    for mingw
    nmake -fmakefile.vc              for msvc
    make -fmakefile.bcc              for borland
    wmake -fmakefile.wat             for watcom

All makefiles supports the following options:
    # Set to 1 to build debug version [0,1]
    #   0 - Release
    #   1 - Debug
    DEBUG = 0
    # Set to 1 to build shared (DLL) version [0,1]
    #   0 - Static
    #   1 - DLL
    SHARED = 0
    # Set to 1 to compile samples [0,1]
    SAMPLES = 1

The muParser library is created in the 'lib' folder and the sample binaries are
created in samples\example1 or samples\example2.

  • I have MinGW compiler installed
  • added to PATH environment variable
  • i go to cmd
  • move to directory .../muparser/build
  • I write mingw32-make -fmakefile.mingw
  • and I get:
    mingw32-make: makefile.mingw: No such or directory
    mingw32-make: *** No rule to make target 'makefile.mingw'. stop.


Tell me, please, what am I doing wrong? How to fix?
Also, I did not understand where and how do I need to specify the DEBUG, SHARED and SAMPLES parameters?
UPD: Yes, since the library is built on the CMake build system, I also created the Qt project on this system.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly, 2020-01-16
@EgoRusMarch

So there is CMakeLists.txt at the root. Something like "mkdir build && cd build && cmake .. && make" (Windows equivalent) doesn't work?

S
Stanislav Makarov, 2020-01-16
@Nipheris

Why not look at CI scripts, for example for AppVeyor?
Version from master branch :

version: 1.0.{build}
os: Visual Studio 2015
clone_folder: C:\projects\muParser
test: off
branches:
  only:
    - master
environment:
  matrix:
    - CMAKE_PLATFORM: Visual Studio 14 2015
build_script:
  - cmake -LAH -G "%CMAKE_PLATFORM%" -DCMAKE_INSTALL_PREFIX="%CD:\=/%/install" .
  - cmake --build . --config Release --target install
  - ctest -C Release --output-on-failure

I think cmake calls at the end (except for ctest) will be useful to you. Yes, instead of CMAKE_PLATFORM, you can specify another generator, such as MinGW Makefiles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question