element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Build an application in Eclipse and GCC for Windows and Linux - supports external Libs, DLLs, Debug: Part 2: start multi-target project
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Internet of Things to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 23 Dec 2020 12:09 PM Date Created
  • Views 684 views
  • Likes 2 likes
  • Comments 0 comments
Related
Recommended

Build an application in Eclipse and GCC for Windows and Linux - supports external Libs, DLLs, Debug: Part 2: start multi-target project

Jan Cumps
Jan Cumps
23 Dec 2020

Goal: build a project in Eclipse, on Windows, that builds binaries for Windows Intel and Linux Arm.

image

When you create a project, you tell Eclipse what toolchain to use.

In our case, we'll want 2 chains:

GCC compiler for Windows (I'm using Cygwin + GCC)

GCC cross-compiler for Linux Arm (I'm using the Linaro chain)

 

When we use the wizard, we can select only one, so let's:

 

1: start with an Arm Linux project

image

image

 

image

Create the project.

 

Now let's do the first exercises that affects multiple build configurations:

Rename the two configurations to reflect that they represent our Linux builds

image

image

 

Then, Go to project properties, and select Internal builder for All configurations

 

image

 

 

image

We end up with two executables built: the Debug and Release version for Linux Arm

image

 

2: Add Windows configurations

image

Easiest is to import the configurations of an existing Windows project.

Let's create a temporary one, called "deleteme"

image

Do the same as we did in the previous project. Rename the configurations to show we're making Windows configs.

 

image

If you want, you can build this one too. Just to check if it works.

 

Then, go back to the Linux project, Manage Configurations

Press the New... button

image

Name the Windows Debug configuration, and create it from the deleteme > Windows Debug config

Do the same for a new Windows Release config.

 

You'll end like this:

image

 

That's it for this part: we have a multi-target project now.

Build all configurations:

 

image

 

Recognise the 4 build directories. Linux debug + release and Windows debug + release.

You can execute the binaries if you want. The windows ones on your development machine. The arm ones on a Pi.

And you can delete the deleteme project now.

 

If you prefer to work with MinGW, this works exactly the same. Select the mingw GCC toolchain.

For both styles, you'll need to distribute some DLLs with your project*.

*MinGW has the possible advantage, if you link your project with the -static flag, that you don't need to distribute GCC DLLs (at the cost of extra 2.52 MB added to the executable file).

 

In the next session, I'll show how to debug both platforms, from that same Eclipse project.

I'll use this project for that exercise. It's attached to this post.

 

related blog
Part 1: preview
Part 2: start multi-target project
Part 3: debug on both platforms
Part 4a: link 3rd party library on Linux ARM
Part 4b: link 3rd party library on Windows
Attachments:
smartcard_framework20202023.zip
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube