.. (לתיקייה המכילה) | ||
Some problems can arise if Eclipse is installed in a directory which has Hebrew directory names in the path to it. For example : C:\מתמ\Eclipse. The problem can also arise if a workspace is opened in such a directory, for example C:\מתמ\Ex1 . | |
If everything works for you – do not change anything. If you have problems with mingw libraries, gcc or gdb not found, do the following: 1. Go to Control Panel, "Clock, Language, and Region", "Regional and Language Options". Go to the last tab "Administrative and change "Language for non-Unicode programs" into "Hebrew (Israel)". (A restart will be required) If it does not help, do the following: 2. Copy Eclipse directory to some directory without Hebrew names in its path, for example C:\Eclipse. Create a new workspace, for example C:\workspace and import the previous project into the new workspace by using File->Import ->General->Existing Projects into Workspace. Alternatively, you can simply open a new project , add and copy the files one by one to this new project from the old project. |
Q. I try debug and receive the error : 'gdb' is not found. | |
A. You probably have the Eclipse installed in a directory which has Hebrew directory names in the path to it. For example : C:\מתמ\Eclipse. See the previous question how to fix the problem. |
Choosing the right Tool Chain | |
Please pay attention to selecting MinGW GCC toolchain when you create an Eclipse project, see http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_project_toolchain.JPG . If you forget to do it, you can change the toolchain to MinGW GCC in Project -> Properties -> C/C++ Build -> Tool Chain Editor. See http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_tool_chain.JPG |
Q. How do I use the files you supplied in my Eclipse CDT project? | |
A. First you will need to copy the files, including the object file into your Eclipse project. You can do that by simply dragging them into the project folder in the "Project Explorer" tree in Eclipse. See http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_add_object_project_explorer.JPG To link the object file (Which contains the implementation) you will need to add the object file for the linker options. To do that: 1. Open Project, Properties. 2. In that dialog select "C++ Build, Settings". 3. Under the Tool Settings tab choose "Linker" or "MinGW C Linker" or equivalent and under that select "Miscellaneous". 4. Under the "Other Objects" press the "Add..." button (the green cross) and type the name of the supplied object. Do not use Workspace or File system options, just type the name of the object. See "before and after" screenshots: before: http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_add_object.JPG after: http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_added_object.JPG |
Q. When I try to run my project in Eclipse I get a "Launch failed. Binary not found." error | |
A. That means there is no compiled binary of the project to run. Follow the following steps: - Build your project by choosing "Project | Build all" (Or press Ctrl+B), make sure the build has succeeded - Under your project in the explorer (tree view) you should see a "Binary" label containing all binaries in the project. If you don't see that make sure no compilation errors occurred (Look at the console window, or "problems" window), make sure your project name does not contain spaces. - Once your project is go to "Run | Run configurations...", double click on "Local C/C++ Application" to create a new suitable configuration. If the project name or application name are missing use "Browse" to select the right project and "Search project" to locate the newly created binary file. - Select "Run" |
Q. I have the following error:
| |
A. You probably added mtm_ex1.o via Workspace or File system. You should just type "mtm_ex1.o" , as explained in the previous question. |
Q. I have the following error : | |
A. You probably have the previous version of your program still running. You should terminate it - go to Debug view and push the red button (Red square - "Terminate"). |
Q. Sometimes, after I start Eclipse, it shows errors which were already fixed previously. What is the matter ? | |
A. Just run Project-> Clean and build, and the errors will disappear (if they indeed were fixed). |
Q. I have the following error:
| |
A. You probably use a wrong Tool Chain. See "Choosing the right Tool Chain item" |
Q. I have the following error:
| |
A. You probably use a wrong Tool Chain and a wrong Builder. See "Choosing the right Tool Chain item" |
Q. I have the following error:
| |
A. You probably use a wrong Builder. See "Choosing the right Tool Chain item" |
Q. Eclipse does not print output/error messages to the console ! | |
A. Just insert the following two lines in the beginning of main(): setvbuf(stdout, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0); |
Q. Wait! What do these two lines from the previous answer mean? | |
A. O.K. Here goes: Input / Output operations (Like writing to a file or the screen) are in fact very slow. However in a lot of cases writing a reasonably sized string at once can take the same time as writing one character only. Because of that I/O operations are made using a buffer. For example every time your program prints (by calling printf etc...) the data is first copied into a buffer that is part of the appropriate FILE* and only once in a while the data is actually passed on to the output device. Unfortunately, this it not the behavior you would want with a terminal window. Because of that output in terminals is usually flushed after each line or every character. Unfortunately (again), under Windows, Eclipse CDT cannot automatically make its console behave like a terminal which may cause re-ordering of I/O operations. Luckily, you can simply change the buffer size of a FILE* in C, or remove it completely. To do so you use the function setvbuf. The two lines mentioned before will simply disable any buffering for stdout and stderr and solve the problem. If you wish to learn more about setvbuf you can do so here. |
How can I find/create useful shortcuts in Eclipse? | |
Press ctrl+shift+L to see the shortcuts. If you wish to change any of them, press ctrl+shift+L twice (that is, once more after you enter the shortcuts window) and you will find the keys prepferences window pop up. |
Q: How do I add a library (.a) file to an Eclipse project? | |
A: Go to Settings->MinGW C Linker->libraries. There, add mtm as under "libraries" (press the green plus sign) and add the correct directory path under "Library search path" (press the second green plus sign and choose "workspace" and then the project folder. | |
קישור: Link: Ссылка: وصلة: | http://webcourse.cs.technion.ac.il/234122/Spring2009/ho/WCFiles/eclipse_link_libmtm_library.JPG |