简体   繁体   中英

How do i perform make file in windows

i want to use this library https://github.com/json-c/json-c with my C program in codeblocks(windows) but i dont know how to make makefile/cmake on windows. I dont know how to do it in this particular example. There is only something like "Config.cmake.in".

Any ideas?

You didn't state what kind of build environment you are using on Windows. So find below a short description how i built the 32-bit version of json library on Windows 10 using cmake 3.14.3 and Visual Studio 2015. CMake supports several generators for Visual Studio as well as MinGW (see CMake documentation).

  1. Open command window (cmd.exe) change to root directory of json-c library source.
  2. Setup build configuration for 32 bit target in directory "build" using command line "cmake -G "Visual Studio 14 2015" -A Win32 -B build"
  3. Open command window for Visual Studio 2015 x86 environment (link at start menu) and change to build directory created during previous step.
  4. Run "msbuild json-c.sln" to build Debug version of json-c dynamic library
  5. Run "msbuild json-c.sln /p:Configuration=Release" to build Release version of json-c dynamic library

After that you should be able to add the built library to your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM