Closed aiaimimi0920 closed 8 months ago
Could you please provide the full output of cmake --build build --verbose
?
This is the complete output
$ cmake --build build --verbose
Change Dir: '/c/Users/xxx/Documents/glog/build'
Run Build Command(s): /usr/bin/cmake.exe -E env VERBOSE=1 /usr/bin/make.exe -f Makefile
/usr/bin/cmake.exe -S/c/Users/xxx/Documents/glog -B/c/Users/xxx/Documents/glog/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake.exe -E cmake_progress_start /c/Users/xxx/Documents/glog/build/CMakeFiles /c/Users/xxx/Documents/glog/build//CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/c/Users/xxx/Documents/glog/build'
/usr/bin/make -f CMakeFiles/glog_internal.dir/build.make CMakeFiles/glog_internal.dir/depend
make[2]: Entering directory '/c/Users/xxx/Documents/glog/build'
cd /c/Users/xxx/Documents/glog/build && /usr/bin/cmake.exe -E cmake_depends "Unix Makefiles" /c/Users/xxx/Documents/glog /c/Users/xxx/Documents/glog /c/Users/xxx/Documents/glog/build /c/Users/xxx/Documents/glog/build /c/Users/xxx/Documents/glog/build/CMakeFiles/glog_internal.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/c/Users/xxx/Documents/glog/build'
/usr/bin/make -f CMakeFiles/glog_internal.dir/build.make CMakeFiles/glog_internal.dir/build
make[2]: Entering directory '/c/Users/xxx/Documents/glog/build'
[ 3%] Building CXX object CMakeFiles/glog_internal.dir/src/demangle.cc.obj
/mingw64/bin/CC.exe -DGFLAGS_IS_A_DLL=0 -DGLOG_NO_SYMBOLIZE_DETECTION -DGLOG_USE_GFLAGS -DGLOG_USE_GLOG_EXPORT -DGOOGLE_GLOG_IS_A_DLL -I/c/Users/xxx/Documents/glog/src -I/c/Users/xxx/Documents/glog/build -I/usr/local/include -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -MD -MT CMakeFiles/glog_internal.dir/src/demangle.cc.obj -MF CMakeFiles/glog_internal.dir/src/demangle.cc.obj.d -o CMakeFiles/glog_internal.dir/src/demangle.cc.obj -c /c/Users/xxx/Documents/glog/src/demangle.cc
In file included from C:/Users/xxx/Documents/glog/src/demangle.cc:44:
C:/Users/xxx/Documents/glog/src/utilities.h:61:12: fatal error: port.h: No such file or directory
61 | # include "port.h"
| ^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/glog_internal.dir/build.make:76: CMakeFiles/glog_internal.dir/src/demangle.cc.obj] Error 1
make[2]: Leaving directory '/c/Users/xxx/Documents/glog/build'
make[1]: *** [CMakeFiles/Makefile2:861: CMakeFiles/glog_internal.dir/all] Error 2
make[1]: Leaving directory '/c/Users/xxx/Documents/glog/build'
make: *** [Makefile:166: all] Error 2
You need to run CMake in the MINGW64 / MSYS2
shell not MSYS / MSYS2
. You may need to install the mingw-w64-x86_64-cmake
package. See our MinGW github action for reference:
Thanks for your guidance, it helps a lot.
I am indeed using MINGW64/MSYS2. It should be caused by not installing the software package mingw-w64-x86_64-cmake. Because I did not encounter this problem when compiling other projects normally, I did not take it into consideration.
All in all, thank you very much
My step:
An error occurred:
Everything is normal when compiling on Ubuntu. Is there any special operation required for compiling on the Windows platform?
I use MSYS2 MINGW64、windows 11 、 Latest code 54b2c17172dc39892de41ed2b3e72902e19ce0c0
Hope to receive some guidance, thank you in advance