eclipse-cdt

Include Git commit hash and/or branch name in C/C++ source

…衆ロ難τιáo~ 提交于 2020-01-01 03:54:25
问题 I would like to know how you can get a Git commit hash and/or other information into the contents of a C++ variable in the compiled binary without having it be part of the source that's tracked by Git. I need to keep track of firmware release information in a compiled executable running on an embedded processor. Means to identify the particular release of the firmware binary such as meaningful filenames, MD5 checksums or even date/time stamps are not available in this closed environment (i.e.

Where to add a CFLAG, such as -std=gnu99, into an (Eclipse CDT) autotools project

六月ゝ 毕业季﹏ 提交于 2019-12-31 13:55:24
问题 I have a simple Autotools C project (not C++), whose skeleton was created for me by Eclipse CDT (Juno). CFLAGs (by inspection) seem to be -g -O2 . I want all of the generated make files to also have -std=gnu99 appended to the CFLAGs, because I use for (int i = 0; i < MAX; i++) and similar. I can obviously hack the Makefile, but this gets overwritten on ./configure . Where is the correct place to add (or change) CFLAGs which are required by the code (as opposed to those CFLAGs which the user

Where is the Makefile generated by the Eclipse CDT?

非 Y 不嫁゛ 提交于 2019-12-31 08:28:10
问题 I've built a hello world C++ project with Eclipse(helios) CDT. It compiled fine. But I would like to take a look at the Makefile CDT generated. I can't find it in project folder/debug/release folders or in the src folders. Where can I find this Makefile? 回答1: If you use the default setttings with current builder = CDT internal builder , there is no make file. if you select current builder = GNU make , you will see the makefile in the debug folder. 回答2: On Windows, Click your project, go to

“Gtk-WARNING **: cannot open display:” when running a gtkmm project in Eclipse

↘锁芯ラ 提交于 2019-12-30 11:04:33
问题 I'm trying to run a gtkmm project in Eclipse CDT (On Ubuntu). The project compiles fine, there are no errors reported but when I try to run the project the console prints out this message "Gtk-WARNING **: cannot open display:" If I go to where the executable is located, in nautilus, I can open it and it runs fine. It's just a problem when trying to run directly from Eclipse. Thanks, 回答1: It sounds like the the "DISPLAY" environment variable is not being set in the environment used by eclipse

background colour of popup info box in eclipse

不打扰是莪最后的温柔 提交于 2019-12-30 04:28:05
问题 I am using eclipse CDT on xubuntu. It works perfectly. The only problem is that the background colour of the pop up box that appears when you put the mouse over a variable for instance will have a background colour of black. Sometimes some of the text in this box will be black as well. I then have to select all text inside the box to read what is in there. For the life of me I cannot figure out where to change that background black colour... Does anybody here know perhaps please. 回答1: Go to

Eclipse-CDT: Use Namespace in automatic generated include-guards

末鹿安然 提交于 2019-12-29 08:27:32
问题 Is it possible (and how) to add the namespace in the name of the automatic generated include guards in Eclipse CDT, when creating a new class using the .hpp/.cpp templates? For me Eclipse generates a new class with a namespace nicely, but the include guards do not contain the namespace, so if the same header file exists twice in two different directories, only one can be included. In my case the name of the namespace, the Eclipse project name and the name of the source directory are all the

Eclipse CDT Autocomplete not working

假装没事ソ 提交于 2019-12-29 02:55:07
问题 I remember from some time ago that Eclipse had auto-complete when you type, and now I can only get it when pressing Ctrl + Space . I already checked and don't have any unresolved dependencies, I can see all the auto-complete choices when pressing Ctrl + Space , but that's not something I like to do every-time... Can someone point me in the direction to get auto-complete back? (Using CDT C++) 回答1: At some point recently (not sure but since March 2013?) my Eclipse CDT stopped auto completion. I

Link object file to my project Eclipse CDR

◇◆丶佛笑我妖孽 提交于 2019-12-29 01:42:09
问题 I'm working on a project from school, and we were given a .o and a corresponding .h file. We need to use several functions from the .o file in our .c program. Just placing it in the same directory doesn't work. I tried to look for something like this in the project properties, but no good. I keep getting ../code_files/Search.c:116: undefined reference to 'reportError' I'm using Eclipse (Juno) CDT, gcc MinGW under Windows 7 I know it's possible to include .a files, but I couldn't find any

multiple (my and 3rd-party) native libraries in Android NDK

蹲街弑〆低调 提交于 2019-12-28 06:36:07
问题 I have to use two native libraries: one is my own and the other one is 3rd-party. As long as I used them in separate projects, everything was ok. But now I'm getting the Exception Ljava/lang/UnsatisfiedLinkError . I'm using Eclipse. I found out that if I place the existing library in libs/armeabi, Eclipse begins compilation of the native code and it fails. If I rebuild the JNI part from the command line, compilation succeeds but the 3rd party library disappears. Really stupid. So how do I

multiple (my and 3rd-party) native libraries in Android NDK

冷暖自知 提交于 2019-12-28 06:36:04
问题 I have to use two native libraries: one is my own and the other one is 3rd-party. As long as I used them in separate projects, everything was ok. But now I'm getting the Exception Ljava/lang/UnsatisfiedLinkError . I'm using Eclipse. I found out that if I place the existing library in libs/armeabi, Eclipse begins compilation of the native code and it fails. If I rebuild the JNI part from the command line, compilation succeeds but the 3rd party library disappears. Really stupid. So how do I