Eclipse CDT build error: make not in path - eclipse-cdt

I just recently(actually today) started using Eclipse CDT for windows. Created a project, a test C file(Hello World) added to project. Build the project, I got error as below.
Error: Program make is not found in Path -
So then I read that Eclipse CDT needs Mingw/MSYS, which I did install. Now i See that there is make.exe in
C:\MinGW\msys\1.0\bin
But Since I dont have administrator privileges, I could not add this folder containing make to the Path system variable on Windows. (I am not likely to get administrator privileges)
Now how do I work around this error to build and use CDT on windows? Any Project settings for Eclipse CDT which if added the path to make could help resolve this?

Was able to get a fix around this problem.
Added the correct paths for two exes - make and gcc/g++ (installed by Mingw/Ansys) to the User environment variable Path (Was not allowed to edit System variable Path).
But adding these paths to User environment variable Path also helped to resolve this. Now Eclipse CDT built and executed the code fine.

check environment variable path has c:/cygwin/bin or c:/mingw/bin or wherever u installed it
if makefile name is mingw32-make.exe or something else , make a copy and rename that to make.exe

The problem is simply that your IDE need to know where is the place of GNU Binary Utilities so how to deal with that simple go to
Windows -> preference -> C/C++ -> new c++ project wizerd -> makefile
then chose what are u instal for example I use MinGW so now I will chose GUN elf parse and now I need the location for c++ filt :D
you will go to place where u install minGW in default it will be C:\MinGW
and search for c++ filt.exe :D and now u done :D
and you can install minGW from
http://www.mingw.org/

Also after adding C:\MinGW\bin to PATH variable. Make sure your new project is created with MinGW GCC toolchain as shown below.

Related

Using scons to compile C++ code under windows, scons adds "/Fo" as compile option

Using the following:
Python version 2.7.13, Scons version 2.5.1, Visual Studio 2012 express is installed, but I am not planning to use it.
Code blocks and MinGW-W64-builds-4.3 are installed.
Using Scons to compile C++ code (networkit toolkit) under windows. Scons adds "/Fo" as compile option. This option works only with VC++ and not with MinGW which I am trying to use. Why does Scons add this flag? I have checked my Sconstruct and the reference build.conf files and cannot seem to find this flag getting set explicitly.
My Sconstruct file is here(http://www103.zippyshare.com/v/jSrMapGz/file.html) and the build.conf file is here (http://www11.zippyshare.com/v/aXGQA5b5/file.html).
I want to get the compilation done with "-o" flag for g++, which is the equivalent of /Fo flag for VC++. I just cant figure out where Scons is picking this flag from :(
I am a novice with python and scons. I typically use VC++ 2012 but have to use networkit toolkit for a project, but it uses C11 features. And I cannot update to VC++ 2015/2017 yet.
Thanks for your help!
I checked your SConstruct file, and you are initialising your build environment as
env = Environment()
, which leaves the environment variable "tools" set to its standard value "default". The latter setting means: let SCons figure out which tools/compilers are installed in the current system, and add corresponding Builders to the build environment automatically. Under Windows, SCons will prefer "vc" over "mingw"...this is hardcoded at the moment (we're working on changing this for future versions of the core source).
What you can do, since you know that you have a "mingw" compiler installed that you want to use explicitly, is to tell SCons that you want to work with "mingw" only.
The following example from the page https://bitbucket.org/scons/scons/wiki/SconstructShortMingwWin32 shows the basic recipe for this:
import os
#don't use the default environment
DefaultEnvironment(tools=[])
#create an environment that uses mingw tools
env = Environment(ENV=os.environ, tools=['mingw'])
#the target will be myprogram.exe (in win32)
#the source files will be every file in the
#current directory that matches "*.cpp"
env.Program(target='myprogram', source = Glob('*.cpp'))
For further help and as reference, please consider checking out our User Guide and Man page.

Building Qt static, can't find MinGW

I'm trying to build a static version of Qt, so I could make a .exe file of my project.
I have found this tutorial, and am using the script made by the tutorial author. When I try to run the script, my PowerShell gives me this>
Building static Qt version 5.3.1
ERROR: MinGW environment not found, no Qt prebuilt version?
Press Enter to continue...:
This is impossible. I know this because I already had made projects with Qt5 and built them with my MinGW compiler.
Some additional info:
MinGW is located:
C:/Qt/Tools/mingw491_32 (/bin/gcc.exe)
When I open the script, theres this line>
#Search all instances of gcc.exe from C:\Qt prebuilt environment.
$GccList = #(Get-ChildItem -Path C:\Qt\*\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object)
So, to me it looks like the gcc should be found by the script.
Anyone have any ideas as to what is happening here?
Thanks.
Replace
C:\Qt\*\Tools\mingw*\bin\gcc.exe
with
C:\Qt\Tools\mingw*\bin\gcc.exe
Not exactly the answer to your question but probably the solution for your problem.
There is no need to make Qt static for creating an executable of your sources. The static option is more appropriate for embedded system without OS, or with a very thin OS below. I can't imagine, it would make sense on windows.
Build a release version, copy your exe and all required dlls of Qt and mingw to one directory and copy this directory to any windows pc. It should work.
For checking, which dlls are required, use depends-tool
For providing your exe in a more professional way, create an installer. I'd recommend Inno Setup, which is very easy to use.
In case you want to copy the dlls use windeployqt, its very simple than using dependency walker. This will copy all the dlls for you to a given folder...
Copy <MyApp.exe> to a folder say <MyAppPackage>
cd to <MyAppPackage>
C:\Qt\Qt5.7.0\5.7\mingw53_32\bin\windeployqt.exe MyApp.exe
All the dlls will be copied to <MyAppPackage> folder.
It helped me:
The path that reads " C:\Qt*\Tools\mingw*\bin\gcc.exe" needed to be changed to " C:\Qt\Tools\mingw*\bin\gcc.exe" on my (Windows 10) system.
https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW

mingw-w64-v2.0.6.tar.gz - define environment variables path

I download the latest version of minGW - mingw-w64-v2.0.6.tar.gz . Then I extract in into C:\MinGW . As I saw in some articles, now I have to define the path under environment variables .
In C:\MinGW now have -
I tried to set the variable value of path as C:\MinGW , but when I do in eclipse juno build path for some project I get -
make all
Cannot run program "make": Launching failed
Error: Program "make" not found in PATH
EDIT:
I downloaded GCC+binutils 64-bit ,exctract to c:\mingw64 , change the path to c:\mingw64\bin and changed the build command to mingw32-make.
Now when I build the project I get error -
mingw32-make all
mingw32-make: *** No rule to make target `all'. Stop.
2nd EDIT :
finally I succeeded to run a project by chose -
Note that it must uncheck the show project type and toolchians only if they are supported on the platform otherwise it not let to chose Executable Project type . In addition the build command should be stay on "Use default build command" .
You downloaded the source package.
You need a toolchain (GCC+binutils and maybe make/gdb). Those are located here:
32-bit
64-bit
I recommend my (rubenvb) Personal builds. They are tidy, full-featured and up to date.
After extracting the toolchain anywhere (say, D:\), add D:\mingw64\bin or D:\mingw32\bin to PATH. Or double-click on the batch scripts I include with my latest builds and it'll be done for you.
Note that you'll need to set up Eclipse for MinGW compilation, which means using mingw32-make, not make.
Lastly, I also suggest using MinGW-w64's support channels (forum and mailing list; please subscribe before posting to mingw-w64-public) in the future. I linger there, among other generally nice and helpful people.

NetBeans with C++ and OpenGL / Freeglut under Windows 7

I recently tried to figure out how to use freeglut with NetBeans 7.
I Google'd a lot and I didn't find a suitable tutorial on how to bind the stuff I need into it.
Currently I have more problem then this:
First one is:
- freeglut 2.8 => in order to compile it I need MinGW and msys.
I have both installed but I can't "configure" or "make all" and "make install" freeglut.
I didn't find an easy-to-read how-to for that task.
Next one:
- once built, where to put what files into a specific folder?
Last one:
- Once put the files into corresponding folder, how to use finally freeglut under NetBeans 7 on a C++ project?
I feel like a lack of information on that.
All I found are always answers like:
download, build, install and done. But I'm already stuck on the "install" and "build".
The solution:
Close NetBeans.
Install and download MinGW from mingw.org
After installing, add the Path to your SystemEnvironemt (example: C:\MinGW).
go to Start->Computer, right mousebutton, select properties
go to advanced system setting, in the following dialog press "Environment Variables".
in the tab "system variables", find the entry Path (or PATH)
add: C:\MinGW;
get freeglut pre-compiled package:
(http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/)
there is a good tutorial how to set up.
Now have fun (just #include " and you're done.
have fun.
Note #1:
if you have problems finding make, the folder is:
C:\MinGW\msys\1.0\bin\make.exe
(when installed MinGW on C:\MinGW).
"mingw-get install msys" in command line should get msys...
last but not least dont forget to add msys\bin to path, too. :)
here's a full tutorial, but in german language.
http://techchan.blog.de/2012/03/18/einrichten-opengl-netbeans-7-1-1-teil-0-start-13209096/
If you need it in english, let me know if you could translate it ;) otherwise i'll think about to translate it myself.
I had a difficult time getting glut working in Netbeans on Windows 7 until I found freeglut, I attributed this to the fact that glut is just very out of date and so are the tutorials I found.
Maybe this will help others looking for instructions on using freeglut in Netbeans. These instructions are like the ones in the link already provided, but help explain how to use it in Netbeans rather than from the command line. This tutorial expects that you've already gotten Netbeans and your compiler working together. IF you have not done so, I found the guide here very helpful: http://netbeans.org/community/releases/68/cpp-setup-instructions.html#mingw
download and extract freeglut from http://www.transmissionzero.co.uk/computing/using-glut-with-mingw/ into an easy to reach folder. (I recommend C:/FrGlut)
either add the bin folder (C:\FrGlut\bin) to your Windows PATH variable, or copy the freeglut.dll from your bin folder into C:\Windows\System32
Open Netbeans and open or create your project
go to: file->project properties
Select your compiler, go to include directories, and add the path to your freeglut include folder (C:\FrGlut\include)
under linker, select add libary, and navigate to the file C:\FrGlut\lib\libfreeglut.a
select options and add the following individually:
-dynamic -lfreeglut -lopengl32 -LC:\FrGlut\lib\libfreeglut.a
Netbeans should now be ready to use with your freeglut library.
To use the glut libary add the following include to your source:
#include <GL/glut.h>
Remember that freeglut.dll will need to be shared along with your executable in order for the program to run, as most users will not already have it.

Eclipse CDT C++ error

I have just installed Eclipse CDT on my machine for developping C++ applications.
I have created a new C++ project. I have copied a cpp file.
When I click the build button, the project compile without errors.
However, I have a problem. The problem is that Eclipse tell me that there is many errors. For example Eclipse show that "using namespace std" is an error or that "#include " is an error.
I don't know what is the problem with Eclipse because my file compile properly when i click the "build" button.
Is there some settings that I did not set properly?
Thanks!
You need to add the paths to the std libraries to your project in eclipse. It seems that somehow eclipse did not find your std library.
You need to add the path to your gcc include under:
properties->C/C++ General->Paths and Symbols->Includes->GNU C and GNU C++
The paths GCC/G++ uses can be found by the commands in this answer to "Where does gcc look for C and C++ header files?".
Requires a restart of eclipse to be active.
Install the GNU C++ Compiler g++, using the command:
sudo apt-get install g++
In my case (I am using TDM GCC installed on a non-standard location on Windows), I had to add the Path variable to the project. I did it by Project->Properties->C/C++ build->build variables. The value to the Path variables are auto read when one clicks on add and then select Path from the drop down list. Once the Path variable is added the C/C++ index needs to be rebuild.