Skip to content

Programming with Eclipse

Coderik edited this page Jan 13, 2014 · 5 revisions

Prerequisites

There should be three source folders:

  • Core
  • UICore
  • Example

1. Adding the code to the Eclipse projects

1.1. File - New - Makefile Project with Existing Code

1.2. Browse the location of the source folder (e.g. Core/). Project name will be substituted accordingly.

1.3. Select an appropriate toolchain (e.g. Linux GCC)

Repeat the same procedure the all source folders.

2. Adjusting projects parameters

2.1. Go to the Core project's parameters.

2.1.1. [C/C++ Build - Builder Settings]: check Generate Makefiles automatically option. Click Apply.

2.1.2. [C/C++ Build - Settings - Build Artifact]: select Static Library as the Artifact Type; specify 'a' to be the Artifact extension. Click Apply.

2.1.3. C/C++ General - Paths and Symbols - Includes: for the GNU C++ language add '/Core/include' and the appropriate include path for the sigc++-2.0 library. Note, use "pkg-config sigc++-2.0 --cflags" command to output include path(s). Click Apply.

2.2. Go to the UICore project's parameters.

2.2.1. C/C++ Build - Builder Settings: check Generate Makefiles automatically option. Click Apply.

2.2.2. C/C++ Build - Settings - Build Artifact: select Static Library as the Artifact Type; specify 'a' to be the Artifact extension.

2.2.3. C/C++ Build - Settings - Tool Settings - GCC C++ Compiler - Miscellaneous: add "pkg-config gtkmm-3.0 --cflags" string in the end of the Other flags field. Note, this will cause the list of gtkmm related dependencies to be added to the compiler invocation command. Alternatively all these dependencies might be added separately in the C/C++ General - Paths and Symbols - Includes. Click Apply.

2.2.4. C/C++ General - Paths and Symbols - Includes: for the GNU C++ language add '/Core/include'. Click Apply.

2.2.5. Project References: mark Core to be a reference.

2.3. Go to the Example project's parameters.

2.3.1. C/C++ Build - Builder Settings: check Generate Makefiles automatically option. Click Apply.

2.3.2. C/C++ Build - Settings - Build Artifact: select Executable as the Artifact Type.

2.3.3. C/C++ Build - Settings - Tool Settings - GCC C++ Compiler - Miscellaneous: add "pkg-config gtkmm-3.0 --cflags" string in the end of the Other flags field.

2.3.4. C/C++ Build - Settings - Tool Settings - GCC C++ Linker - Miscellaneous: add "pkg-config gtkmm-3.0 --libs" string in the Linker flags field.

2.3.5. C/C++ Build - Settings - Tool Settings - GCC C++ Linker: In the Command line pattern field move "${FLAGS}" to the end. Note, the pattern should be "${COMMAND} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS}" for the correct order of library inclusion. Click Apply.

2.3.6. C/C++ General - Paths and Symbols - Includes: for the GNU C++ language add 'UICore' and '/Core/include'. Note, the order matters here. That is, UICore have to be above.

2.3.7. C/C++ General - Paths and Symbols - Libraries: add "UICore" and "Core".

2.3.8. C/C++ General - Paths and Symbols - Library Paths: add "/UICore/Default" and "/Core/Default". Click Apply.

Clone this wiki locally