{"id":563,"date":"2017-10-29T20:36:00","date_gmt":"2017-10-29T19:36:00","guid":{"rendered":"http:\/\/systev.com\/?p=563"},"modified":"2019-06-09T20:05:10","modified_gmt":"2019-06-09T18:05:10","slug":"building-several-executables-in-one-eclipse-cdt-project","status":"publish","type":"post","link":"https:\/\/systev.com\/building-several-executables-in-one-eclipse-cdt-project\/","title":{"rendered":"Building several executables in one Eclipse CDT project"},"content":{"rendered":"
After having imported some C projects into Eclipse CDT<\/a>, I needed, for one of the projects, to build several executables, all of them being defined in the same project. What’s more, some of the executables had to be linked with object files created by another project. This article describes the configuration I set up to meet theses requirements.<\/p>\n <\/p>\n Let’s consider the following context:<\/p>\n I\u2019m using Eclipse Oxygen 1a Release<\/em>, on Linux Mint 18.2<\/em>.<\/p>\n The first step is the creation of a configuration that will be used to generate the new executable, independently of the existing one:<\/p>\n Add path to projectA<\/tt> header files:<\/p>\n I observed that I had to check Add to all configurations<\/strong>, to ensure that the directory was added to the project. Kind of weird…<\/p>\n ProjectB<\/tt> depends on projectA<\/tt>, as it uses one of its files. Declare this dependency:<\/p>\n To declare that functiona2.o<\/tt> object file from projectA<\/tt> must be linked with the executable:<\/p>\n To build the other executable of projectB<\/tt>, switch active configuration:<\/p>\n After having imported some C projects into Eclipse CDT, I needed, for one of the projects, to build several executables, all of them being defined in the same project. What’s more, some of the executables had to be linked with object files created by another project. This article describes the configuration I set up to … <\/p>\nContext<\/h3>\n
\n
Creating a configuration<\/h3>\n
\n
<\/p>\n
Adding a header path<\/h3>\n
\n
<\/p>\n
Configuring executable generation<\/h3>\n
\n
<\/a><\/p>\n
<\/p>\n
Declaring project dependency<\/h3>\n
\n
<\/a><\/p>\n
Declaring external object file<\/h3>\n
\n
<\/p>\n
<\/a><\/h3>\n
<\/h3>\n
Building another executable<\/h3>\n
\n