eclipse-cdt

How to catch a moment when Eclipse is creating a new project?

与世无争的帅哥 提交于 2020-01-05 04:01:09
问题 I am developing a CDT plug-in for Eclipse IDE. I want to write to a project-scoped preference file when creating a project or just store an info to identify this project later and write to a file. How can I seize a moment when Eclipse is creating a new project and store some info about it? 回答1: You can use an IResourceChangeListener listener to listen for all resource changes: ResourcesPlugin.getWorkspace().addResourceChangeListener(listener); The listener implements the single method: public

“launching 'project' has encountered ..” , project file does not exist

你。 提交于 2020-01-04 14:19:37
问题 I wanted to write 'hello world' in eclipse c++, but it does not work I go to Run configurations, what config options for c++ programs should i give? I know I don't care about 'debug' - only 'release', but how to do that? 回答1: Here is what I did: File->New->C++ Project You will get a pop up window. Type the name of the project you want. Then, below it says executable and inside this folder, I have (by default I guess) Empty Project. Then click Next and Finish. Now the project appears in the

How to set QT paths in Eclipse without using the “Qt project”?

感情迁移 提交于 2020-01-04 06:58:08
问题 I have a mixed C++/Qt/Python project managed in Eclipse, and I would like to set the Qt paths without setting my project as a "Qt Project". Using CDT and setting it as general "Makefile project from existing code", I cannot find any option in the project properties, where I can set the Qt paths. The menu "QT" seems to disappear from the project Properties if the project is set as other than "Qt Project". I set the Qt include path (e.g. /include/QtGui/) in the "C++ General --> Paths & Symbols"

Can I have Eclipse highlight an #ifdef block of code regardless of whether the symbol is defined?

别来无恙 提交于 2020-01-04 06:04:23
问题 In a project I am working on at the moment I have a lot of functions interleaved with blocks of #ifdef 'd code. In this particular case it would be much more readable if that code was subtly highlighted to show it as being separate from the main code. I've had a look in the theme options but couldn't see any way to do this. I'd just remove the symbol from the project and have eclipse highlight it as being disabled, but then I can't work on it easily (limited / no hover or f3 functionality). I

How to change the optimization level with Eclipse + CDT + MinGW?

若如初见. 提交于 2020-01-04 05:08:57
问题 I am writing some C code with Eclipse + CDT + MinGW. The compilation output always shows: Info: Internal Builder is used for build gcc -O0 -g3 -Wall -c -fmessage-length=0 -o Math.o "..\\Math.c" How can I change the command line parameters such as -O0, -Wall? (I am new to Eclipse IDE.) 回答1: For GCC, the setting is in project properties => C/C++ Build => Settings => GCC C Compiler => Optimization. 来源: https://stackoverflow.com/questions/26689632/how-to-change-the-optimization-level-with-eclipse

Building a new library on top of another library (SDL and Eclipse)

£可爱£侵袭症+ 提交于 2020-01-04 02:56:13
问题 I am working on a project with SDL. I feel like a lot of my code could/should be reusable for any other projects I might want to take on. I was going to start a library project, but I don't know how to go about linking to the SDL libraries. Usually, I go to Project Settings and edited Mingw32 Linker to include the libraries (ming32, SDLmain, and SDL). But the linker does not show up in the settings. So my questions: Is there no linker settings because building a library is only a compiling

Eclipse CDT - “Invalid arguments” when using template defaults

六眼飞鱼酱① 提交于 2020-01-04 01:29:06
问题 I am getting a weird error with the following code: template<class T, size_t Size = sizeof(T)> class foobar { }; template<class T> void foo(foobar<T> param1) { // Do something } void bar() { foobar<int> obj; foo(obj); } The error occurs at the line foo(obj); and is: Invalid arguments ' Candidates are: void foo(foobar<#0,unsigned int16 0 #0>) ' The code itself compiles fine however. I have no idea how to fix it. Eclipse giving me Invalid arguments ' Candidates are: void * memset(void *, int, ?

Undefined reference to 'WinMain@16' C error

女生的网名这么多〃 提交于 2020-01-03 18:51:51
问题 I am using Eclipse (C programming) and I have come up with this code but every time I build it, I get the error saying, "Undefined Reference to 'WinMain@16'". I have spent over 2 hours trying to solve this problem but I can't figure out my where my error is. Can anyone help? This is the code: #include <stdio.h> int main(void) { int input; printf("Please enter an integer:\n"); scanf("%d",&input); int temp = input; while(input<=temp+10) { printf("%d ",input); input++; } printf("\n"); return 0;

Eclipse C macro automatic formatting

不打扰是莪最后的温柔 提交于 2020-01-03 17:07:23
问题 I'm having a problem with using the automatic formatting in Eclipse CDT. For the most part it works great but it seems to insist on putting the semicolons after macro calls on a separate line. Is this a bug or did I mischeck a combination of formatting settings which lead to this? 回答1: The problem has been fixed in later versions of Eclipse CDT. Just try to download later version of Eclipse. 来源: https://stackoverflow.com/questions/5881284/eclipse-c-macro-automatic-formatting

explicit instantiation of function template fails (g++)

本秂侑毒 提交于 2020-01-03 16:48:58
问题 I am experiencing some problems (i.e, linkage errors) with explicit instantiation of a function template. Under Visual Studio the project links ok, only under g++/Unix, using Eclipse-CDT, the linkage produce errors. The function call is a part of a static library, which is linked with a dynamic library, in a big project. The architecture of the function is as follows: function template declared (but not implemented) inside a namespace in my MathUtils.h file. One of the function arguments is