作者:张明怡紫茂佳尧 | 来源:互联网 | 2023-09-04 15:05
When trying to compile the library on Windows to get the shared object library, I get the following when running make all:
1 2 3 4 5 6 7 8 9 10 11 12 13
| process_begin: CreateProcess(NULL, sh -c "uname -s 2>/dev/null || echo false", .
..) failed.
cc -c -fPIC -std=c89 -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings
-Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-over
flow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion -fstack-pr
otector-strong cJSON.c
process_begin: CreateProcess(NULL, cc -c -fPIC -std=c89 -pedantic -Wall -Werror
-Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2
-Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswi
tch-default -Wconversion -fstack-protector-strong cJSON.c, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:68: recipe for target 'cJSON.o' failed
mingw32-make: *** [cJSON.o] Error 2 |
And the following with "cmake .." while in a subdir.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| CMake Error at CMakeLists.txt:6 (project):
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Mattia/Downloads/cJSON-master/build/CMakeFiles/CMakeOutput.lo
g".
See also "C:/Users/Mattia/Downloads/cJSON-master/build/CMakeFiles/CMakeError.log
". |
I'm using mingw as compiler.
该提问来源于开源项目:DaveGamble/cJSON
Closing this because of missing response from the original reporter. (and the second issue has been solved).