compiling C++ in windows cannot open file 'libcpmt.lib' - c++

I am trying to compile libffm on my windows 10 machine:
https://github.com/guestwalk/libffm
I have Visual Studio Express 2013 installed and am using the VS2013 x64 Cross Tools Command Prompt to try and compile the package.
e:\libffm\nmake -f Makefile.win clean all
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
erase /Q *.obj *.exe windows\.
rd windows
mkdir windows
cl.exe /nologo /O2 /EHsc /D "_CRT_SECURE_NO_DEPRECATE" /D "USEOMP" /openmp -c ffm.cpp
ffm.cpp
ffm.cpp(1) : warning C4068: unknown pragma
cl.exe /nologo /O2 /EHsc /D "_CRT_SECURE_NO_DEPRECATE" /D "USEOMP" /openmp ffm-train.cpp ffm.obj -Fewindows\ffm-train.exe
ffm-train.cpp
ffm-train.cpp(1) : warning C4068: unknown pragma
LINK : fatal error LNK1104: cannot open file 'libcpmt.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\x86_amd64\cl.exe"' : return code '0x2'
Stop.
I read that it maybe issues with my environment variables so have reinstalled the tools for C++ for VS2013 Express.
When I check the path variables I get:
echo %LIB%
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64;
echo %LIBPATH%
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIB\amd64;C:\Program Files (x86)\Windows Kits\8.1\References\CommonConfiguration\Neutral;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.VCLibs\12.0\References\CommonConfiguration\neutral;
any ideas what to try next?

Related

How to build a CMake project with MSVC 2015?

I try to build a CMake (v3.14) project with MSVC 2015. I use the CMake GUI to generate the makefile but when I hit the "Configure" button, I get the following error:
The C compiler identification is MSVC 19.0.24210.0
The CXX compiler identification is MSVC 19.0.24210.0
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Projets/geolibextern/build_msvc/CMakeFiles/CMakeTmp
Run Build Command(s):nmake /nologo cmTC_fa317\fast
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f CMakeFiles\cmTC_fa317.dir\build.make /nologo -L CMakeFiles\cmTC_fa317.dir\build
Building C object CMakeFiles/cmTC_fa317.dir/testCCompiler.c.obj
C:\PROGRA~2\MICROS~2.0\VC\bin\amd64\cl.exe #C:\Users\egrace\AppData\Local\Temp\nm88C7.tmp
testCCompiler.c
Linking C executable cmTC_fa317.exe
"C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_fa317.dir --rc=rc --mt=CMAKE_MT-NOTFOUND --manifests -- C:\PROGRA~2\MICROS~2.0\VC\bin\amd64\link.exe /nologo #CMakeFiles\cmTC_fa317.dir\objects1.rsp #C:\Users\egrace\AppData\Local\Temp\nm8993.tmp
RC Pass 1: command "rc /foCMakeFiles\cmTC_fa317.dir/manifest.res CMakeFiles\cmTC_fa317.dir/manifest.rc" failed (exit code 0) with the following output:
Le fichier sp‚cifi‚ est introuvableNMAKE : 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 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
I also tried (unsuccessfully) to reinstall the Visual C++ build tools or to use a more recent version of CMake.
Indeed, CMake couldn't find the program mt.exe because the Windows SDK folder wasn't in the PATH variable. To solve this problem, I need to execute this command with these arguments:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 8.1

Getting an error building static libcurl VS2019

First I make nmake work:
set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29812\bin\Hostx64\x86
then I git clone https://github.com/curl/curl.git --depth=1
Then I run buildconf.bat all seems fine.
then I go to winbuild and run nmake /f Makefile.vc mode=static and the build fails with the following error:
configuration name: libcurl-vc-x64-release-static-ipv6-sspi-schannel
cl /O2 /DNDEBUG /MD /DCURL_STATICLIB /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL /DUSE_WIN32_IDN /DWANT_IDN_PROTOTYPES /DUSE_IPV6 /DUSE_WINDOWS_SSPI /DUSE_SCHANNEL /Fo"..\builds\libcurl-vc-x64-release-static-ipv6-sspi-schannel-obj-lib/altsvc.obj" ..\lib\altsvc.c
altsvc.c
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\windows.h(167): fatal error C1083: Cannot open include file: 'excpt.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29812\bin\Hostx64\x86\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.28.29812\bin\Hostx64\x86\nmake.exe"' : return code '0x2'
Stop.
Is my nmake installed wrong?
If your ultimate goal is to "Get a static library compiled with a local cl compiler", I suggest you try the "vcpkg".
All you have to do is "vcpkg install curl". It will download the source code and compiled locally. :)

Can anybody help me understand this error message?

I am currently working on creating a virtual machine from scratch. I found a video online and I followed it, but when the time has come for me to compile my C++ program(s), the guy said to run the 'make' command to compile it. I used NMake using my Visual Studio Developer Command Prompt and it gave me this error message:
cl -std=c++11 -c stack-vm.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
stack-vm.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ostream(285): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\include\ostream(270): note: while compiling class template member function 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int)'
stack-vm.cpp(53): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::operator <<(int)' being compiled
stack-vm.cpp(49): note: see reference to class template instantiation 'std::basic_ostream<char,std::char_traits<char>>' being compiled
cl -std=c++11 -c main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
main.cpp
cl -std=c++11 stack-vm.o main.o -o stack-vm
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl : Command line warning D9002 : ignoring unknown option '-std=c++11'
cl : Command line warning D9024 : unrecognized source file type 'stack-vm.o', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'main.o', object file assumed
Microsoft (R) Incremental Linker Version 14.27.29112.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:stack-vm.exe
/out:stack-vm.exe
stack-vm.o
main.o
LINK : fatal error LNK1181: cannot open input file 'stack-vm.o'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX86\x86\cl.EXE"' : return code '0x2'
Stop.
NOTE: I have a makefile setup already.
Can anybody help me understand this error? If you need source code, just reach out to me.
Thank you so much!

NMAKE : fatal error U1077: return code '0x2'

I am trying to build libsvm binary for Windows. But nmake returns an error code.
C:\Users\user\Desktop\libsvm-3.23>nmake -f Makefile.win clean all
Microsoft (R) Program Maintenance Utility Version 14.14.26433.0
Copyright (C) Microsoft Corporation. All rights reserved.
erase /Q *.obj windows\*.exe windows\*.dll windows\*.exp windows\*.lib
Could Not Find C:\Users\user\Desktop\libsvm-3.23\*.obj
Could Not Find C:\Users\user\Desktop\libsvm-3.23\windows\*.exe
cl.exe /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE -c sv
m.cpp
svm.cpp
C:\Program Files (x86)\Microsoft VisualStudio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\vcruntime.h(180): error C2371: 'size_t': redefinition;different basic types
predefined C++ types (compiler internal)(16): note: see declaration of 'size_t'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\bin\HostX86\x86\cl.exe"' : return code '0x2'
Stop.
C:\Users\user\Desktop\libsvm-3.23>
What is the wrong with this?

How to build SHTTPD on Windows?

I tried building SHTTPD on Windows using the following command:
nmake msvc Makefile
All i get is a bunch of errors. What am I doing wrong?
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. cl /MD /TC /nologo /DNDEBUG /Os standalone.c /link /out:shttpd.exe ws2_32.lib user32.lib advapi32.lib shell32.lib shttpd.lib standalone.c c:\users\samira\desktop\network\shttpd-1.42\src\compat_win32.h(46) : warning C4005: 'EWOULDBLOCK' : macro redefinition C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\errno.h(132) : see previous definition of 'EWOULDBLOCK' –
According to the site you link, you have to use the command
nmake win
to build on windows.
Edit From the site you linked:
Download the source package. Extract
it, go to src directory. Run "make
unix" there ("nmake win" on Windows,
requires MSVC). That buillds a
library.
Have you invoked the command from the src directory?