问题
It seems I'm still a newbie in eclipse, and I need to set some compilation flags to my ANSI C project with the gcc compiler. Such flags are for example.. -std=c99 -Wall -Wconversion -Wtype-limits -pedantic and some more.
I remember not so long ago, I used to set that flags from a very intuitive interface with check-boxes and labels, but it is not any more there... for example in this link:
Enabling flags (Wall, pedantic) for C/C++ compilation within Eclipse
they are making a very similar question but when I arrive to Eclipse -> Project Explorer -> your project -> context menu -> Properties. It is not at all the "C/C++ Build" -> Settings.
Project properties window screenshot without the "c/c++ build" option
Edited.
I found out a way to solve the problem, but still I cannot set the compiler flags.
The thing was when an existing project is opened from "file" -> "open projects from filesystem", it is not predefined the C/C++ nature. And then it is not possible to set c/c++ settings in spite of you can set the gcc to compile the whole project...
An approach to the solution is to add the C/C++ nature from "File" -> "New" -> "Convert to a C/C++ Project (Adds C/C++ Nature)". And following I find the "C/C++ build" option, but, I do not see yet the tab "Tool Settings"...
Look at these examples below:
screenshot from a window with the tab "Tool Settings" visible (by creating a new C/C++ project)
screenshot from a window without the tab "Tool Settings" visible (by adding the C/C++ nature as above explained)
Any ideas?
I hope you can understand my question, and help me with this problem...
来源:https://stackoverflow.com/questions/61432377/setting-flags-to-compiler-from-eclipse-with-gcc