0

Here is the instructions: https://github.com/json-c/json-c/blob/master/README.md#build-instructions--

This is the first time I've ever built from source. I'm on Windows 10 and I used CMake to build.

I did this and it all worked fine:

$ git clone https://github.com/json-c/json-c.git
$ mkdir json-c-build
$ cd json-c-build
$ cmake ../json-c

But I don't understand this part:

$ make
$ make test
$ make USE_VALGRIND=0 test   # optionally skip using valgrind
$ make install

Can someone explain to me what these lines do?

I installed mingw32-make but when I run mingw32-make on its own like in the this tutorial it just says:

mingw32-make: *** No targets specified and no makefile found.  Stop.

Do I need to create a Makefile? It doesn't say anywhere in the installation notes to do this but I cannot get past this step, what am I doing wrong?

  • `cmake ../json-c` configures a project for some default [generator](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html). A way for build resulted project depends on that generator. E.g. `mingw32-make` is a builder for project configured with generator "MinGW Makefiles". By passing additional option `-G` to `cmake` you could select desired generator. See e.g. [that answer](https://stackoverflow.com/a/4101496/3440745). – Tsyvarev Feb 12 '22 at 08:50
  • You will find that lots and lots of software out there is built and documented primarily for F/OSS operating systems such as GNU/Linux. If you want to build them on Windows, you'll need to learn a bunch of tricks on your own that may not be documented. As @Tsyvarev suggests, when you run `cmake` on Windows the default behavior is to generate build plans for Visual Studio, not `make`. These are totally different. If you want to build with `make` on Windows you have to provide extra arguments to `cmake` to tell it that you want to use a different generator. – MadScientist Feb 12 '22 at 13:53
  • I tried adding `-G "MinGW Makefiles"` but it didn't work so i tried to do it with the CMakegui but still ran into issues. So i decided to just move it over to Linux and or worked fine. Thanks – Pickinanameainteasy Feb 13 '22 at 14:04

0 Answers0