Cannot build a C++ project with Eclipse CDT - c++

I have a C++ project which uses CMake, and I want to try using Eclipse CDT with mingw (this project already compiles and run with MSVC, code::blocks, etc.)
With Eclipse CDT, I choose a target, and right click to build the target, but I get the following message :
22:59:13 ** Build of project OgreProcedural-RelWithDebInfo#ogreprocedural_eclipse **
"e:\MinGW\bin\mingw32-make.exe" -C E:/Prog/Builds/ogreprocedural_eclipse OgreProcedural
Cannot run program "e:\MinGW\bin\mingw32-make.exe": Invalid directory.
Error: Program "e:\MinGW\bin\mingw32-make.exe" not found in PATH
PATH=[E:\Prog\ImageMagick;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Graphviz2.26.3\bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\TortoiseHg\;C:\Program Files\doxygen\bin;e:\prog\libs\qt\bin;C:\Program Files\7-Zip;e:\mingw\bin;C:\Program Files (x86)\CMake 2.8\bin;e:\python;%GROOVY_HOME%\bin]
... but the mingw\bin directory is in the path, and mingw32-make is inside it.
Am I missing something?
EDIT:
Finally, I was able to build projects, but among the multitude of build targets generated by CMake, some build fine and some others don't.

Related

Cannot open include file: 'stddef.h': No such file or directory in cstddef QtCreator

When I want to compile my Qt project, debuger shows me that stddef.h was not included into ...\VC\Tools\MSVC\14.27.29110\include. I tried to solve this problem using adding to system Environmental Variables path to Win SDK Kits (folder include). But this doesnt solve my problem. Also I instaled Windows Universal CRT SDK but this giving me nothing. Also I tried to reinstall VS and Qt,check Qt for update, add to environment variable PATH path to folder bin from MSVC folders and change include in cstddef from stddef.h to stddef. This is the list of my environment variable PATH:
C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
C:\Program Files\dotnet\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0
And this is user environment setting PATH:
C:\Users\karat\AppData\Local\Programs\Python\Python37-32\Scripts\
C:\Users\karat\AppData\Local\Programs\Python\Python37-32\
C:\Users\karat\AppData\Local\Microsoft\WindowsApps
C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.1\bin
C:\Users\karat.dotnet\tools
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
%USERPROFILE%.dotnet\tools
Could you recommend me a way to solve this problem and tell me why this could happen at all?

MSBuild 2019 ignores INCLUDE environment variable

I am working with two machines that have Visual Studio 2019. One has Community edition, the other has Pro edition.
The pro edition of MSBuild is completely ignoring the INCLUDE environment variable, so the project I'm trying to build (ICU) cannot find stddef.h. The stddef.h file is in the Windows Kits 10 ucrt directory, which is included in the INCLUDE env var.
The community edition doesn't do this.
When I build the project with the /v:diag option I can see most of what's defined in the INCLUDE env var is added to a variable named CAExcludePath.
Here's the INCLUDE env var: INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\include;;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\atlmfc\include;;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\VS\include;;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt;;;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\VS\UnitTest\include;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;;
And here's the CAExcludePath: CAExcludePath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\atlmfc\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.24.28314\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt;;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;;
Why does this happen and how do I prevent it?
MSBuild 2019 ignores INCLUDE environment variable
I think you should not set these paths into Environment Variables. For C++ projects, VS does not recognize the library path in system environment variables by default and this is not the VS job.
Usually, you should set extra library paths in VS IDE. Right-click on your project-->Properties-->Configuration Properties-->VC++ Directories-->Include Directories or Properties-->Configuration Properties-->C/C++-->Additional Include Directories. You can refer to this official document.
However, when l install Windows Kits tool, this path is included in the include path by default and you can use this in your code directly. See this:
So l am afraid you have something wrong when you install the Windows Kits tool. Please follow this document to install the right tool and before you finish it, please install the related extension which is the last step in the installer in Visual Studio 2019 to integrate the tool.
I think when you install the extension, these paths will be included into VS automatically and you can use them directly.
Besides, if you do not want to install this extension, you can add the include path manually by the steps I mentioned above.
If you have done these steps and still faced the same error, I think you should check your Environment and follow these suggestions:
1) close VS Instance, delete .vs, bin, obj folders,reopen your project and then build again
2) do a repair in VS Installer
3) if your VS is not the latest, please update your VS and do not forget to update Operation System at the same time.
Hope these help.
Use the IncludePath environment variable instead.
set IncludePath=%INCLUDE%
IncludePath is not ignored/overwritten when running msbuild, and I was able to successfully compile my project/solution by setting it.
On my machine, setting IncludePath overrides 3 paths which would otherwise be set. The 3 paths have analogs (same header files but for different versions) in my %INCLUDE% paths, so it seems safe (and in fact prudent) to ignore/clobber/leave these out.

Teamcity can not find skd 8.1

Every time when I am trying to build solution I get error error C1083: Cannot open include file: 'dxgi1_2.h': No such file or directory.
It seems that build agent does not have Sdk 8.1. How to check it in TeamCity settings?
Update
In TeamCity I see
Actual Parameters on Agent
Configuration Parameters
WindowsSDKv8.1_Path C:\Program Files (x86)\Windows Kits\8.1
In my project i Added to Additional Include Directories path "C:\Program Files (x86)\Windows Kits\8.1". Still not working...

Jgrasp C++ compile issues

When I try to compile a simple source code in c++ using jgrasp i get this
----jGRASP wedge2 error: command "g++" not found. ---- This
command must be in the current working directory ---- or on the
current PATH to use this function. ---- PATH is ";C:\Program Files
(x86)\NVIDIA
Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Microsoft\Web Platform Installer\;C:\Program Files
(x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files
(x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program
Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files
(x86)\QuickTime\QTSystem\". ----jGRASP: operation complete.
anyone know how to fix it?
Im using windows 8
You either don't have a C++ compiler installed on your machine or you have a C++ compiler installed and have not added it to your PATH.

Visual Studio 2012 alongside 2010 - kernel32.lib, windows.h

I just installed Visual Studio 2012 alongside Visual Studio 2010. The problem is that I can't manage to convert simple projects from 2010 to 2012 - they fail to link to files such as kernel32.lib or include files such as windows.h. My system also has Windows SDK 7.1 installed.
I have tried messing with Property Manager for my x86 and x64 user platforms (since I had appropriate $(DXSDK_DIR) references added there), only to get mixed results - sometimes it just works, sometimes it compiles but doesn't link, other times it simply stops at windows.h
For example, currently I'm getting
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
or
1>Source.cpp(2): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
(depending on the inclusion or not of "windows.h") with a simple "hello world" type program only in x64.
In the project properties for Active(Debug) / Active(x64) -> VC++ Directories -> Include Directories I can now see $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);$(DXSDK_DIR)Include. If I expand that input box and I click Edit, I see:
$(VCInstallDir) = C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
$(WindowsSDK_IncludePath) = c:\Program Files (x86)\Windows Kits\8.0\Include\um;c:\Program Files (x86)\Windows Kits\8.0\Include\shared;c:\Program Files (x86)\Windows Kits\8.0\Include\WinRT
While my platform toolset v110 windows.h resides at c:\Program Files (x86)\Windows Kits\8.0\Include\um\Windows.h (so there should be no problem). Stuff works if I select Windows SDK 7.1 as platform toolset.
Any solution besides formatting and reinstalling Windows?
L.E. if I replace the $(variable) directories with absolute paths within the system, everything works. I don't see why I would do this, since I am sharing the project with others as well.
I know there's almost an answer above. But...
The problem seems to be that when VS2012 and VS2010 are installed, the configuration for VS2012 does not work correctly.
The fix is to edit the props files in %home%\AppData\Local\Microsoft\MSBuild\v4.0.
These are the files that worked for me, using SDK v8.1.
First Microsoft.Cpp.Win32.user.props which is used for 32-bit builds:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludePath>C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86;$(LibraryPath)</LibraryPath>
<ExecutablePath>C:\Program Files (x86)\Windows Kits\8.1\bin\x86;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
</Project>
Now Microsoft.Cpp.x64.user.props which is used for 64 bit builds:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IncludePath>C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64;$(LibraryPath)</LibraryPath>
<ExecutablePath>C:\Program Files (x86)\Windows Kits\8.1\bin\x64;$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
</Project>
I hope this helps others with this problem, I haven't found a solution posted anywhere else.
I had a similar problem.
In my case this was because the correct paths weren't inherited in the project settings.
Check that the paths are inherited in: Project -> Properties -> VC++ Directories
Under Include and Library Directories go to Edit.
Make sure that the Inherit from parent or project defaults is checked.
The VS2012 default properties and Macros were set correctly. (Although I had the common installation problems where I had to replace all the VC directory because it didn't even install the C++ core libraries)