Unable to Build on windows using CMAKE and MinGW(32) #179

Closed
opened 2018-03-08 20:33:46 +00:00 by datNurd · 3 comments
datNurd commented 2018-03-08 20:33:46 +00:00 (Migrated from github.com)

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'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.

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.
tonytheodore commented 2018-03-13 15:56:53 +00:00 (Migrated from github.com)

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.

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.
datNurd commented 2018-03-13 16:03:54 +00:00 (Migrated from github.com)

Yeah upon taking a closer look at the errors was able to realize that if(win32) needs to be modified to if(MSVC) so made the required modification in the CMAKE file and was able to build sucessfully.

Anyways Thanks for the response @tonytheodore @kaniini

Yeah upon taking a closer look at the errors was able to realize that `if(win32)` needs to be modified to `if(MSVC)` so made the required modification in the CMAKE file and was able to build sucessfully. Anyways Thanks for the response @tonytheodore @kaniini
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#179
There is no content yet.