Unable to Build on windows using CMAKE and MinGW(32) #179
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
I've run the following command to build pkgconf on windows
cmake .. -G "MinGW Makefiles" -- The C compiler identification is GNU 6.3.0 -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Looking for include file sys/stat.h -- Looking for include file sys/stat.h - found -- Looking for strlcpy -- Looking for strlcpy - not found -- Looking for strlcat -- Looking for strlcat - not found -- Looking for strndup -- Looking for strndup - not found -- Looking for cygwin_conv_path -- Looking for cygwin_conv_path - not found -- Configuring done -- Generating done -- Build files have been written to: C:/Users/pnikh/Downloads/pkgconf-master/build
After creating the make files Ive run mingw32-make this is the error I get
Scanning dependencies of target libpkgconf [ 5%] Building C object libpkgconf/CMakeFiles/libpkgconf.dir/argvsplit.c.obj gcc.exe: error: /WX: No such file or directory gcc.exe: error: /wd4996: No such file or directory libpkgconf\CMakeFiles\libpkgconf.dir\build.make:62: recipe for target 'libpkgconf/CMakeFiles/libpkgconf.dir/argvsplit.c.obj' failed mingw32-make[3]: *** [libpkgconf/CMakeFiles/libpkgconf.dir/argvsplit.c.obj] Error 1 CMakeFiles\Makefile2:121: recipe for target 'libpkgconf/CMakeFiles/libpkgconf.dir/all' failed mingw32-make[2]: *** [libpkgconf/CMakeFiles/libpkgconf.dir/all] Error 2 Makefile:139: recipe for target 'all' failed mingw32-make[1]: *** [all] Error 2
looks like there is some problem 'argvsplit.c' file. I am using code from master branch.
i believe the issue is that CMake assumes you're using MSVC on Windows. you might try to use the ./configure script under MSYS in the meantime.
It's likely just this line https://github.com/pkgconf/pkgconf/blob/master/CMakeLists.txt#L60 that needs to be wrapped in a
if (MSVC)
block.Yeah upon taking a closer look at the errors was able to realize that
if(win32)
needs to be modified toif(MSVC)
so made the required modification in the CMAKE file and was able to build sucessfully.Anyways Thanks for the response @tonytheodore @kaniini