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?
Related
I cloned a library that i needed to use for a coding task and visual code auto-compiled its cmake automatically giving me this,i've already looked all over stack overflow and seen similar problems with cl.exe but the solutions dont seem to be anything that fits my problem, the error is following:
Severity Code Description Project File Line Suppression State
Error CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/CMakeTestOBJCXXCompiler.cmake:62 (message):
The Objective-C++ compiler
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: D:/puzzlenew/out/build/x64-Debug (default)/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_0f8c7 && [1/2] Building OBJCXX object CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
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 '-x'
cl : Command line warning D9024 : unrecognized source file type 'objective-c++', object file assumed
cl : Command line warning D9027 : source file 'objective-c++' ignored
cl : Command line warning D9024 : unrecognized source file type 'testOBJCXXCompiler.mm', object file assumed
cl : Command line warning D9027 : source file 'testOBJCXXCompiler.mm' ignored
cl : Command line warning D9021 : no action performed
[2/2] Linking OBJCXX executable cmTC_0f8c7.exe
FAILED: cmTC_0f8c7.exe
cmd.exe /C "cd . && C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /machine:x64 CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o -o cmTC_0f8c7.exe && cmd.exe /C "cd /D "D:\puzzlenew\out\build\x64-Debug (default)\CMakeFiles\CMakeTmp" && C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -executionpolicy Bypass -file C:/src/win32/vcpkg/scripts/buildsystems/msbuild/applocal.ps1 -targetBinary "D:/puzzlenew/out/build/x64-Debug (default)/CMakeFiles/CMakeTmp/cmTC_0f8c7.exe" -installedDir C:/src/win32/vcpkg/installed/x64-windows/bin -OutVariable out""
Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64
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 '/machine:x64'
cl : Command line warning D9024 : unrecognized source file type 'CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o', object file assumed
Microsoft (R) Incremental Linker Version 14.28.29337.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:testOBJCXXCompiler.mm.exe
/out:cmTC_0f8c7.exe
CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o
LINK : fatal error LNK1181: cannot open input file 'CMakeFiles\cmTC_0f8c7.dir\testOBJCXXCompiler.mm.o'
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project. C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.18/Modules/CMakeTestOBJCXXCompiler.cmake 62
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!
I Know this problem been posted and I search the internet looking for the solution of my problem. I am new to programming and I try to find the answer before posting my problem.
I am trying to do a code interface node for Labview. Follow the direction and of course search on the internet. I setup my environment variables to point where my files are at. I set up the property page and were I am having the trouble at is on the command line in the custom build set up. I enter the following command:
"$(CINTOOLSDIR)\lvsbutil" "$(TargetName)" -d "$(OutDir)"
and for the Output I enter
$(OutDir) $(TargetName).lsb.
`
when I build the code I get the following.
'
Project: SimpleCIN2010, Configuration: Release Win32 ------
1>C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(298,5): warning MSB8004: Intermediate Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(299,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
1> SimpleCIN2010.cpp
1> Microsoft (R) Incremental Linker Version 10.00.40219.01
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> "/OUT:.\Release\SimpleCIN2010.dll" /INCREMENTAL "/LIBPATH:C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools" cin.obj labview.lib lvsb.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "/DEF:C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools\lvsbmain.def" /MANIFEST "/ManifestFile:.\Release\SimpleCIN2010.dll.intermediate.manifest" "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /DEBUG "/PDB:C:\Users\XXX\Documents\Visual Studio 2010\Projects\CIN VC2010\SimpleCIN2010\SimpleCIN2010\Release\SimpleCIN2010.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:.\Release\SimpleCIN2010.lib" /MACHINE:X86 /DLL .\Release\SimpleCIN2010.dll.embed.manifest.res
1> .\Release\SimpleCIN2010.obj
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification
1>SimpleCIN2010.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1> Creating library .\Release\SimpleCIN2010.lib and object .\Release\SimpleCIN2010.exp
1> Microsoft (R) Incremental Linker Version 10.00.40219.01
1> Copyright (C) Microsoft Corporation. All rights reserved.
1>
1> "/OUT:.\Release\SimpleCIN2010.dll" /INCREMENTAL "/LIBPATH:C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools" cin.obj labview.lib lvsb.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "/DEF:C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools\lvsbmain.def" /MANIFEST "/ManifestFile:.\Release\SimpleCIN2010.dll.intermediate.manifest" "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /DEBUG "/PDB:C:\Users\XXX\Documents\Visual Studio 2010\Projects\CIN VC2010\SimpleCIN2010\SimpleCIN2010\Release\SimpleCIN2010.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:.\Release\SimpleCIN2010.lib" /MACHINE:X86 /DLL .\Release\SimpleCIN2010.dll.embed.manifest.res
1> .\Release\SimpleCIN2010.obj
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:ICF' specification
1>SimpleCIN2010.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1> Creating library .\Release\SimpleCIN2010.lib and object .\Release\SimpleCIN2010.exp
1> SimpleCIN2010.vcxproj -> C:\Users\XXXX\Documents\Visual Studio 2010\Projects\CIN VC2010\SimpleCIN2010\SimpleCIN2010\.\Release\SimpleCIN2010.dll
1> C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools\lvsbutil: error building resource file: 1
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: The command ""C:\Program Files (x86)\National Instruments\LabVIEW 8.6\cintools\lvsbutil" "SimpleCIN2010" -d ".\Release\"
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(183,5): error MSB3073: :VCEnd" exited with code 2.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========`
I went into the command line to double check for double spacing or not enough. I read the other article that been posted and try some of the codes. So if someone could tell me if I set up the command right please let me know.
Thanks
I finally found out that the issue was from trying to use two different version software. After over a week and many hours on the internet searching for an answer I came across an article on how to make the lsb file. First I had to remove the custom build commands and output from the property manager. rebuild the program to create my release folder under my project. once this was done i follow the following steps:
Executing cmd.exe When Compiling a CIN in VC++
You can reduce the introduction of typing errors and mis-quoting by following these steps:
1. Go to the start button and click run. Then type cmd in the command window and hit enter.
Browse to the directory that has lvsbutil.exe (in the cintools directory under LabVIEW), drag the lvsbutil.exe onto the cmd window. This will correctly quote the executable.
Browse to the folder that holds your dll, this is usually in /Debug of your project's directory, verify that a dll has been created there.
In the cmd window, type the following command: project_name -d
Drag the folder that contains the dll onto the cmd window, and press enter.
You should see LabVIEW resource file with the following properties created properly:
type: CIN
name: sharedcin.lsb
The .lsb file will be built in the same directory as the DLL.
Note: LabVIEW must be installed on the computer that the VC++ code is compiled on. Simply copying the cintools directory to the computer that will compile your code without having LabVIEW installed will cause an error when linking.
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?
I have two files source1.f90 and main.cpp. The Fortran file has a subroutine and the cpp file has a program that calls the Fortran subroutine
I compiled the Fortran file and the built a static library file using the following command line options
ifort source1.f90 /nologo /debug:full /Od /gen-interfaces /warn:interfaces /traceback /check:bounds /libs:static /threads /dbglibs /c
lib /out:lib1.lib source1.obj
But when I compiled the cpp file using
CL main.cpp /link LIB1.LIB
I get the following error
D:\temp>CL main.cpp /EHsc /link LIB1.LIB
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
Microsoft (R) Incremental Linker Version 11.00.60610.1
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
LIB1.LIB
main.obj
LINK : fatal error LNK1104: cannot open file 'ifmodintr.lib'
How do I fix this problem so that my program compiles?
Generally speaking, you miss the setting of the mixed programming environment in Visual studios. Just follow this link provided by intel:
https://software.intel.com/en-us/articles/configuring-visual-studio-for-mixed-language-applications.
Or in short, add the fortran compiler include directory and library directory in the project configuration tab. In my case, the fortran compiler directory is "g:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\include\intel64", and the library directory is "g:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\compiler\lib\intel64_win".