Eclipse live error checking disabled - c++

Few days ago I had to reinstall all my Linux system, and I also had to reinstall Eclipse CDT as I used to work with it since few weeks.
Unfortunately, since then I do not have live error checking anymore... and I miss it ;)
If I create a new Hello World C++ project (New / C++ Project / Hello World C++ project) and then add some errors like calling a method from an nonexistent class or adding any undefined or untyped variable, well Eclispe doesn't underline and report them as it was doing before I had to reinstall it all.
I searched stackoverflow, and tried to deactivate/reactive "Build automatically" without any change. I also verified that the project path is included in the project sources (Project properties / C-C++ general / Path and Symbols / Source Location) but as it already was, it didn't solved the problem.
When I "Build All" the errors are well reported in the "Problems view", and then when I fix one problem and save the file, the error disappear from the Problem view, but then if I add another problem and save, nothing is reported until I build again. Even errors turned to comments still remains underlined until the next "build all".
Do you have any idea to help me reactivate this feature ?
I was under Eclipse Linux 3.5 and I now use Eclipse Linux 3.7.

I installed the Eclipse package: Eclipse C/C++ IDE Indigo SR-1 with Eclipse Platform 3.7.1 and that fixed the problem.
So I guess, there was a problem with the 3.7.0 currently provided by the Ubuntu Software Center.
With this new version all is Ok by default.

Related

CodeLite won't detect (installed) MinGW -- and will not compile even with manual configuration

I installed CodeLite and was rightfully put in the direction to install MinGW. I installed MinGW right from where CodeLite suggests/links to it and everything went well there. I then click "scan" on CodeLite to find the just installed compiler and it says it can't find any on the system -- lost already here.
I then just tried to configure the directory of the compiler to one which is provided with MinGW, such as gcc. I try to compile any basic hello world or such and get the error that, "The system cannot find the file path specified." When trying by default it would compile even before actually properly setting up the compiler, so it seems completely backwards on the face of it. Maybe it's some cross/directory issue?
The log shows CMD.exe looking to cd to some weird/incorrect directory. I've changed environment variables to only include MinGW's path and the issue persists. I've changed around global settings/include paths/build settings to point to the compiler, but it just won't get past this.
Aside from manual setup not working and CodeLite being unable to find MinGW despite it being 100% verified and installed properly, I am basically lost here.
I have prior programming experience, but usually with everything out of the box. I'm now trying to get back in but wanted to learn the process of setting up a compiler/getting more "hands on."
I'm pretty sure it's something set up wrong by me, but the problem is clearly that I have no idea what.
CodeLite does not need the compiler to be in the path. You can "tell" CodeLite where it is installed by pointing it to the right folder from Settings->Build Settings
See this wiki page, note that the build settings dialog is a bit outdated, the drop down button does not exist anymore, instead you have a toolbar with green + button, click it instead.
Once you added the compiler, right click on your project and and select Project Settings, under the General tab, choose the compiler you just configured.
I had the same issue where I had MinGW installed and working, then I downloaded CodeLite and went into the setup wizard, where it could not find MinGW.
Essentially the fix I found was closing and re-opening CodeLite.
I saw on the CodeLite site that the compiler should not be in a folder path with spaces in it, so I moved my compiler from "Program Files" to "ProgramFiles" and manually pointed to it using Settings -> Build Settings. However, CodeLite's scan still couldn't find it until I restarted it.
Then I moved my compiler back to its original folder and restarted CodeLite again, it worked.

cmake problems with qt creator hello world

How can I choose platform for cmake with QT creator?
This is my project settings:
My cmake settings (what i am supposed to put as platform/kit?):
This gives me gives me crazy output here:
Whats wrong here? I do have rc.exe in my path:
UPD: As asked, I've checked vcvars32.bat:
(what am I expected to see here also??):
I have managed to walkaround the problem in the end by removing MSVC2017, Windows SDK and reinstalling MSVC 2015 + Windows SDK for W10. But this is not enough, in this crazy dialog:
you have to select ...ninja+codeblocks and this allows to run cmake sucessfully. Why VS14 setting here causes problems -- this remains a mystery for me.

Building glfw3 programs in CodeBlocks 16.01 in Windows 7 failed

I am using CodeBlocks 16.01 in Windows7. I have downloaded GLFW windows binary from here. I have copied include and lib-mingw to my project folder. Have provided the include and lib-mingw directories for Compiler and Linker options respectively in the build options. In the Linker settings tab, I have added glfw3,gdi32 and opengl32. I'm running the sample program given in the documentation page of the GLFW website. The program is compiling. While building a warning and an error message is displayed:
Warning: .drectve `-aligncomm:"__glfw",5' unrecognized
And
init.c undefined reference to `__chkstk_ms'
Have googled a lot, but in vain. Any help would be great.
Today the problem is solved. The problem was with the compiler settings in CodeBlocks. In CodeBlocks, under "Settings" tab "Compiler"->"ToolchainExecutables", it was "Dev C++". I installed TDM-GCC-32 (http://tdm-gcc.tdragon.net/download) 32 bit version. Then changed "Dev C++" with the directory where TDM-GCC-32 is installed in my computer.
Next in "Settings"->"Debugger" option, I selected "GDB/CDB Debugger" and "Default". Then provided the path of gdb32.exe located in the TDM-GCC-32/bin directory.
I think as I had installed Dev C++ before installing codeblocks, Dev C++ was selected by default (not sure). For those who are facing similar problems but DEV C++ is not their case, updating TDM-GCC may help.
However, this DEV C++ compiler was working for older GLFW 2.7. Today, I have also found another problem with this DEV C++ one. I was using freeglut. When I was including iostream along with GL/glut.h similar "undefined reference to `__chkstk_ms'" error message was appearing.
But now, it is ok. Thank you all :)
looks like you need to add library(.lib) with this stuff. .h file has been
deployed already so you need to detect it. Then you can google for library.

Can't run C++ in NetBeans: "No Shell Found" error

I'm trying to learn C++ using NetBeans but even though I have CYGWIN and everything set up in my PATH, I keep getting an error that says: "No shell found. Cannot proceed. Please install either CYGWIN or Msys."
I don't know what Msys is but since the error says "or" I assume that if I have CYGWIN that I don't need to have Msys.
I'm trying to run the basic "Hello World!" tutorial but this error from what I've seen isn't covered. I'm getting aggravated because I have a project I need to have done in a few weeks.
If anyone has any answers for me, that would be great. I can supply screenshots if you need them.
Cygwin alone is not enough, first of all you have to check if you installed C++/gcc/gdb packages in your Cygwin.
From Cygwin/Net beans docs:
Open the Control Panel (Start > Settings > Control Panel) and double-click the System program.
Select the Advanced tab and click Environment Variables.
In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
Add the path to the cygwin-directory\bin directory to the Path variable, and click OK. By default, cygwin-directory is C:\cygwin. Directory names must be separated with a semicolon.
Click OK in the Environment Variables dialog and the System Properties dialog.
If it fails you could try to Re-Install Netbeans from/within an cygwin/bash instance start the netbeans from a cygwin/bash instance.
Netbeans should automatically detect gdb/g++
PS: I'd prefer to use a good Gnu/Linux distro
I had the same problem with 8.1.
Adjusting the %PATH%-variable - in my case adding C:\msys64\usr\bin - solved it (as wdavilaneto's slightly verbose answer suggested).
This is not an answer but it adds to this question, I know that isn't very objective but in this case there may be a problem with Netbeans. I have 7.3 so this could be the reason. I am getting the same error but it used to work just fine, then one day it just stopped working and couldn't find the Shell. I have everything you need to make C/C++ work for Netbeans and it was working, for a while too!
It is rather old, but I've had the same issue a moment ago. It "Solved itself" by Creating a new "welcome sample" project and then made it run, then went back to my original project and made it run again. For me, it solved the problem. Probably it is related to an issue with Netbeans as Cian said.
Btw, I'm with Netbeans 8.1.
Make sure the shell is in your path! Depending whether you have Cygwin, Mingw32, Mingw32, TDM Mingw... it will be somewhere here:
c:\<installation path>\usr/bin
Hmh, I have 2 C compilers one for 64bit and one for 32bit set in NetBeans. When I had 32bit compiler without 64bit one then compiling went fine but when I have installed 64bit then NetBeans has started to do some problems, firstly everything went fine but then I started to get this problem to. For me fix is to switch from 64bit compiler back to 32bit compiler, then compile my program and then go back to 64bit compiler and now I can compile it with 64bit compile... Not sure why is this fixing it.
I have this problem with Netbeans 10.
Computer is Windows 10 x64.
Resolved by following the answer given by TNT.
Problem was when start building my project the said "no shell" (the topic of this posting) dialog box popped up. Since there was no command prompt, the build tools cannot run - process cannot spawn.
Solution was to give the correct path (environment variable). Since I am using MSYS, Since I am using MSYS, adding
F:\msys64\usr\bin
to my PATH made it work.

Eclipse CDT crashing when trying to index header files

I'm successfully cross compiling C++ code to run on a raspberyy pi from a Windows 7 machine through Eclipse Kepler SR1. Although the compilation is successful, there is a problem with the error parsing on the editor. It's showing red lines (errors) for functions/definitions such as cout, endl, string, etc.
When I click on Project->C/C++ Index->Search for Unresolved Includes I can see that it complains that bits/c++config.h, bits/c++allocator.h and similar files are unresolved. So, I did a grep and found these and included the director under Project Properties->C/C++ Build->Settings->Tool Settings->Cygwin C/C++ Compiler->Includes and Eclipse just crashes. I noticed that it generates the attached log file. This seems like a nasty bug or a huge error on my part. Is there a way to resolve this issue?
Here is the error log file.
This answer not pretend to be a solution. Just a set of thoughts
There are many-many bugs in CDT. Try latest development versions in hope that someone fixed your issue.
Update sites (to install/update via "Help"->"Install new software"->"Add..." dialog):
http://download.eclipse.org/tools/cdt/builds/luna/milestones (for Luna milestones)
http://download.eclipse.org/tools/cdt/builds/8.4/nightly (for 8.4 nighlies )
Or download directly from CDT page.
You can also check their Bugzilla and forums if there are bug report for that issue and solutions/workarounds. And surely you can check out CDT source code and actively participate in bug fix ;)
Personally, I use latest milestones, because of indexer: 8.4 better understands C++11.
Hope it helps.