On Tue, Apr 11, 2017 at 4:11 AM, Karsten Saunte <kars...@saunte.com> wrote:

> Hi Feng
>
>  "Visual Studio 15 2017" is supported.
>
> The above command line refers to "NMake makefiles" not visual studio.
>
> Anyway tried your suggestion with -G "Visual Studio 15 2017"
>
> This fails with "-- The C compiler identification is unknown" (which
> worked with the "NMake makefiles" profile") - and this is due to a linker
> error (CMake Error log file)
>   >> LINK : fatal error LNK1181: cannot open input file 'gdi32.lib'
> [M:\SandBox\proto\cpp\protobuf-3.2.0\cmake\build\
> solution\CMakeFiles\3.8.0-rc4\CompilerIdC\CompilerIdC.vcxproj]
>
> Tried to fix the issue by adding c:\Program Files (x86)\Windows
> Kits\10\Lib\10.0.15063.0\um\x64\ to LIBPATH but didn't solv the issue.
>
It seems to me an installation problem with visual studio.
http://stackoverflow.com/questions/33599723/fatal-error-lnk1104-cannot-open-file-gdi32-lib

Some people say it can be fixed by reinstall visual studio. Can you give it
a try? Alternatively, can you try with a different version of visual studio?


>
>
>
>
>
>
> On Monday, 10 April 2017 19:45:13 UTC+2, Feng Xiao wrote:
>>
>> Can you try "cmake --help"? It should print a list of Visual Compilers it
>> supports. If VS 2017 is on the supported list, just invoke cmake with:
>> cmake -G "Visual Studio [VERSION_NUMBER]" ../..
>>
>> and it should generate a protobuf.sln file that you can open with VS 2017.
>>
>> On Mon, Apr 10, 2017 at 7:11 AM, Karsten Saunte <kar...@saunte.com>
>> wrote:
>>
>>> Hi
>>>
>>> New to protocol buffers, downloaded 3.2.0 and followed the guide in
>>> cmake/README.md
>>>
>>> It fails at this step
>>>
>>> *****
>>> To start using a *Release* configuration:
>>>
>>>      C:\Path\to\protobuf\cmake\build>mkdir release & cd release
>>>      C:\Path\to\protobuf\cmake\build\release>cmake -G "NMake Makefiles"
>>> ^
>>>      -DCMAKE_BUILD_TYPE=Release ^
>>>      -DCMAKE_INSTALL_PREFIX=../../../../install ^
>>>      ../..
>>> *****
>>> with the following error
>>> ************************************************************
>>> ************************************************************
>>> ********************************
>>> CMake Error at C:/Program Files/CMake/share/cmake-3.8/Mo
>>> dules/CMakeTestCCompiler.cmake:51 (message):
>>>   The C compiler "C:/Program Files (x86)/Microsoft Visual
>>>   Studio/2017/Community/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe"
>>> is
>>>   not able to compile a simple test program.
>>>
>>>   It fails with the following output:
>>>
>>>    Change Dir: M:/SandBox/proto/cpp/protobuf-
>>> 3.2.0/cmake/build/release/CMakeFiles/CMakeTmp
>>>
>>>
>>>
>>>   Run Build Command:"nmake" "/NOLOGO" "cmTC_e9028\fast"
>>>
>>>         "c:\Program Files (x86)\Microsoft Visual
>>>   Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\
>>> x86\nmake.exe"
>>>   -f CMakeFiles\cmTC_e9028.dir\build.make /nologo -L
>>>   CMakeFiles\cmTC_e9028.dir\build
>>>
>>>   Building C object CMakeFiles/cmTC_e9028.dir/testCCompiler.c.obj
>>>
>>>
>>>         C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1410~1.250\
>>> bin\HostX86\x86\cl.exe
>>>   @C:\Users\Karsten\AppData\Local\Temp\nmEF9D.tmp
>>>
>>>   testCCompiler.c
>>>
>>>   Linking C executable cmTC_e9028.exe
>>>
>>>         "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe
>>>   --intdir=CMakeFiles\cmTC_e9028.dir --manifests --
>>>   C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1410~1.250\
>>> bin\HostX86\x86\link.exe
>>>   /nologo @CMakeFiles\cmTC_e9028.dir\objects1.rsp
>>>   @C:\Users\Karsten\AppData\Local\Temp\nmF0D7.tmp
>>>
>>>   RC Pass 1 failed to run.
>>>
>>>   NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' :
>>>   return code '0xffffffff'
>>>
>>>   Stop.
>>>
>>>   NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual
>>>   Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\
>>> x86\nmake.exe"'
>>>   : return code '0x2'
>>>
>>>   Stop.
>>> ************************************************************
>>> ************************************************************
>>> ********************************
>>>
>>> I'm really an IDE user - so not that familiar with cmake and nmake - I
>>> can't find the exact spot where it fails - i managed to extract a few parts
>>> here and there to compile and link testCCompiler.c.exe
>>>
>>> Any clues?
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to protobuf+u...@googlegroups.com.
>>> To post to this group, send email to prot...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at https://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to