I prefer Eclipse as IDE, even though I need a plugin to use it for C++. But somehow the CDT plugin marks errors where none are, like this:
It tells me that the function 'to_string()' could not be resolved, even though make all runs without problems.
I already tried the solutions given in the accepted answer to this question, but with no effect
Simply rebuild the CDT index. This will remove any wrongly reported errors.
Related
I used Eclipse for Java development before, so I decided to try it with C++. After setting up my project in CDT, I had errors everywhere saying "Type so-and-so could not be resolved". I decided to make a test Hello World project, and got similar errors with anything else I added to it. For example:
Strangely enough, adding the scope resolution operator makes the error disappear and it works normally. I haven't done anything strange to the IDE; this is its out-of-box behavior on my system. Any idea what's wrong?
As per #user4581301, I wasn't specializing my template.
I installed NeatBeans IDE 8.1 fresh for C++ development and began a blank new project. The code for the project is shown below. The code within the editor shows a syntax error, although when building, THE CODE RUNS PERFECTLY FINE.
Although iostream is imported correctly, and I can view iostream.h by clicking on it, std seems to be completely undefined. In fact, I cannot use any library without it showing a syntax error. I realize that having an std in front of cout is redundant, since I am supposed to be using namespace std, but I just wanted to show that it is not just the namespace. I am using a 64 bit MinGW compiler as my configuration as pictured below.
I have tried using all solutions online, such as Reparse project, but that and others do not seem to help rectify this issue. How can I make the editor show no syntax errors and build correctly?
I remember having this problem. I used to fix it by doing a "Run -> clean and build project".
I have been trying out using Eclipse CDT for a course I am taking. Previously I have been using Visual Studio Express but since that requires me to be online and I have to use the IDE+compiler offline, I switched to Eclipse + Cygwin GCC.
Now everything was working prefectly, until I got an error about file paths in my make file. After reading some of the posts online, the issue seemed to be that Cygwin's make does not resolve absolute Windows file paths because of the ':' symbol and confuses it with a new target definition. The proposed fix was to download a fixed make file. I diligently did so and the programs would compile fine.
But after I went into the first debug session, everything froze. I aborted eclipse and tried a clean build but now the compilation wont happen AT ALL, which is very weird for me.
I can't find a post for a similar problem so I am really stuck now. I was currently working the assumption that my CDT may be corrupt or something so I downloaded Eclipse Luna just today and tried building using that, but no joy. Even a fresh project in a new workspace wont compile.
Appreciate the help in advance.
Did you try redownloading Eclipse? Sometimes Eclipse gets a fatal error glitch that makes it unable to compile anything. I've had this problem before, the only way i was able to fix it was to uninstall and re download the latest version. If this doesnt work, try switching to Bloodshed Dev C++ or codeblocks.
So it seems like an issue with the new make (v3.80). upgating it to v4.08 fixed the issue of not building.
Version 4.08 however does not fix the Windows file paths not being recognized properly and treated as a target definition. I am still getting the multiple target patterns. stop error.
EDIT: Found this on Stack overflow to solve the issue... should have searched better previously.
Very simple application fails with "multiple target patterns" from Eclipse
I've been working with Netbeans on Mac OS for the past few months (in C++) but have now moved to Ubuntu 12.04. I'm compiling via command line and just using Netbeans as an editor because I like the code assistance and things like that that it has. Normally it seems people want to disable code assistance and highlighting but in my case, they are not working and I don't know why. All the boxes are checked under the Editor>Highlighting tab. When I deliberately misspell a variable it does not complain. Syntax highlighting works fine. Is there some other thing I need to install?
I apologize is this is a very simple thing but googling and searching docs has not helped since it seems everyone is concerned with the opposite problem.
Does NetBeans use clang for static code analysis? Maybe you need to install it.
I'm new to using Eclipse. I'm trying to write some C++ code in it with the CDT but I can't figure out how to tell it to rebuild manually. I did a little test program and accidentally put SDL_EVERYTHING instead of SDL_INIT_EVERYTHING in SDL_Init args. I changed it to the correct name and saved but when I right clicked on the project and chose run as c++ application it said I still had that error. In fact that line is still underlined in red saying it can't find SDL_EVERYTHING even though it's been changed.
Does anyone know how to force eclipse to rebuild or how to clear these errors? This seems trivial but I haven't found anything online about how to get around it.
I don't have CDT installed on this computer at the moment, but as I recall you can clean and build a project using options under the project menu.
For more information