I want to implement the event logging as specified in the link below
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363680(v=vs.85).aspx
I can successfully create a provider.rc, provider.h and provider.res as it is.
But when I try create the link -dll -noentry provider.res it gives me the following error
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : warning LNK4068: /MACHINE not specified; defaulting to X86
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I even tried the command below
link /MACHINE:X64 -dll -noentry provider.res
Still gave this error
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
If this is of any use I used Windows Server 2008 R2 64 bit OS.
Edit: I have also tried the following method provided in the link.
http://msdn.microsoft.com/en-us/library/24b2tcy0.aspx
It uses .rc file i have previously generated using mc command.
specified both NO INCREMENTAL and NO ENTRY option as specified.
Still not working. Gives the following error
Build started 3/5/2014 11:50:16 AM.
InitializeBuildStatus:
Touching "Debug\evtlog.unsuccessfulbuild".
ClCompile:
All outputs are up-to-date.
All outputs are up-to-date.
ResourceCompile:
All outputs are up-to-date.
evtlog.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Build FAILED.
Time Elapsed 00:00:00
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Related
While trying to compile amazon-kinesis-video-streams-producer-sdk-cpp-repo I am getting an error
crypto\uplink-x86_64.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'.
I do not understand this. I checked solutions online but I do not have any VS project. I am running all these commands just to compile the OpenSSL library. I tried running on x86 Native Tools Command Prompt as specified in this question. Still same error.
I am using Windows 10 and Visual Studio 2017.
Here are the steps I followed:
1: Clone the repo. Installed cmake and pkg-config.
2: I built the directory and navigated to it:
mkdir -p amazon-kinesis-video-streams-producer-sdk-cpp/build
cd amazon-kinesis-video-streams-producer-sdk-cpp
3: Run the following command in Developer's command prompt for VS 2017:
cmake -G "MinGW Makefiles"
Here is the error I am getting:
crypto\uplink-x86_64.obj : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'x86'
Could Not Find C:\Users\amay\amazon-kinesis-video-streams-producer-sdk-cpp\open-source\local\libopenssl\build\src\project_libopenssl\libcrypto-1_1-x64.*
NMAKE : fatal error U1077: 'link' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86\nmake.exe"' : return code '0x2'
Stop.
mingw32-make.exe[2]: *** [CMakeFiles\project_libopenssl.dir\build.make:130: build/src/project_libopenssl-stamp/project_libopenssl-build] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:94: CMakeFiles/project_libopenssl.dir/all] Error 2
mingw32-make.exe: *** [Makefile:102: all] Error 2
CMake Error at dependency/libkvscproducer/kvscproducer-src/CMake/Utilities.cmake:93 (message):
CMake step for libopenssl failed: 2
Call Stack (most recent call first):
dependency/libkvscproducer/kvscproducer-src/CMakeLists.txt:66 (build_dependency)
-- Configuring incomplete, errors occurred!
See also "C:/Users/amay/amazon-kinesis-video-streams-producer-sdk-cpp/CMakeFiles/CMakeOutput.log".
Would appreciate any help!
Tried running with x64 Native Tools Command Prompt and it worked.
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 need OpenCV 3.2.0 with CUDA8.0.
I'm following this tutorial and at the last step - building the INSTALL project - Visual Studio 2013 giving me about 45 errors like:
LNK1104: cannot open file "..\..\lib\Debug\opencv_world320d.lib
The error occurs about 30-40 minutes after start building.
This is the first error that occurs:
> C:\Program Files (x86)\Windows Kits\8.1\Include\um\combaseapi.h(229): error : identifier "IUnknown" is undefined
9>
9>C:\Program Files (x86)\Windows Kits\8.1\Include\um\combaseapi.h(229): warning : expression has no effect
9>
9>D:\OCV\opencv-3.2.0\modules\core\include\opencv2/core/base.hpp(365): warning : function declared with "noreturn" does return
9>
9> 1 error detected in the compilation of "C:/Users/tomus/AppData/Local/Temp/tmpxft_000018ac_00000000-6_gftt.cpp4.ii".
9>CUSTOMBUILD : nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
9> gftt.cu
9> CMake Error at cuda_compile_generated_gftt.cu.obj.cmake:264 (message):
9> Error generating file
9> D:/OCV/build2/modules/world/CMakeFiles/cuda_compile.dir/__/cudaimgproc/src/cuda/Debug/cuda_compile_generated_gftt.cu.obj
After that I have 47 errors LNK1104.
I'm receiving a cmake error while configuring with cmake-gui:
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
9.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/admin/Desktop/myproject/CMakeFiles/CMakeTmp
Run Build Command:c:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com
CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
Microsoft (R) Visual Studio Version 9.0.21022.8.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: cmTryCompileExec, Configuration:
Debug Win32 ------
1>Compiling...
1>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for
80x86
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>cl /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /MT
/Fo"cmTryCompileExec.dir\Debug\\"
/Fd"C:\Users\admin\Desktop\myproject\CMakeFiles\CMakeTmp\Debug/cmTryCompileExec.pdb"
/c /TC .\testCCompiler.c
1>testCCompiler.c
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
1>Build log was saved at
"file://C:\Users\admin\Desktop\myproject\CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug\BuildLog.htm"
1>cmTryCompileExec - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========
why can't cmake let the vs compiler find the libraries it needs?
I had a rc.exe not-found error on my visual studio 2008 installation. Solved it, solved the abovementioned problem.
Sorry for troubling you.
I have a solution for a previous c++ project provided to me. When I open the solution in visual studio and try to build, I get the error:
1>------ Build started: Project: Test Proj, Configuration: Release Win32 ------
1>Build started 9/19/2011 8:28:56 PM.
1>InitializeBuildStatus:
1> Touching "Release\Test Proj.unsuccessfulbuild".
1>ClCompile:
1> example1.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1> InitShader.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.85
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I had to change the input linker settings of my project to include glew32d.lib. That fixes it, and it compiles and runs properly.
However, when I alter example1.cpp(even by just adding a comment), I am no longer able to build it and I get this error:
1>------ Build started: Project: Test Proj, Configuration: Release Win32 ------
1>Build started 9/19/2011 8:25:29 PM.
1>InitializeBuildStatus:
1> Creating "Release\Test Proj.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> example1.cpp
1>c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.67
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
glew32d is still being linked so I'm not sure where I'm getting the error and why I can't build
That's not a linker error, it's a compile error.
c:\users\mycomp\downloads\stp\testp\code\Angel.h(38): fatal error C1083:...
^^^^^^^^^^^
I bet on line 38 of Angel.h, you're trying to include...
...Cannot open include file: 'GL/glew.h': No such file or directory
^^^^^^^^^^^
...and the compiler can't find the header file.
You need to make sure that the OpenGL header files (whatever folder contains a folder named GL that contains a file called glew.h) are available to the compiler; you can add this folder to the Additional Include Directories in the properties of your C++ project.