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 4a: link 3rd party library on Linux ARM
  • 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: 25 Dec 2020 1:44 PM Date Created
  • Views 871 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended

Build an application in Eclipse and GCC for Windows and Linux - supports external Libs, DLLs, Debug: Part 4a: link 3rd party library on Linux ARM

Jan Cumps
Jan Cumps
25 Dec 2020

Goal: use a 3rd party library in my c++ project, on Windows and Linux.

Example: the support library for a USB smart card reader.

I'm starting from previous project, that's already set up for both platforms.

image

 

I'm assuming here that the 3rd party provides a compiled lib and the necessary header files.

I'll be using shared libraries: .so in Linux, .dll for Windows.

 

I intended to write both Linux and WIndows instructions in the same post. But it was getting long.

So I write shared settings and Linux here. The Windows setup goes to 4b.

 

3rd party distribution

 

The libraries for my smart card reader (Digital Logic µFR Nano) are distributed as an archive that supports several platforms.

There's a single shared include, and binary files organised per target.

In this post, I'll use two dynamic options:

  • linux/arm-hf (for BBB, Raspberry Pi: Arm Linux with hardware floating point) and
  • windows/x86_64 (for a pc, laptop, server, on the x86 or x64 platform)

 

image

 

The test program is a simple routine that talks to the smart card device over USB. All communication goes through the vendor's API and lib.

Because the home location of the 3rd party distro is shared between all platforms and OSs, I will create a variable that's available for all Eclipse configurations.

That makes it easy later on to move to a newer version of the library by just changing that variable.

It also shows how to do a setting that impacts all configurations.

 

image

In the next steps, I'll define the library and include file locations relative to this variable.

 

Link and Test on Linux Arm

image

 

This is a good point to learn how to configure a set of configurations in a single action.

I only want to define settings for the Linux toolchain. In stead of selecting All configurations, I'll check Multiple configurations.

image

 

Then I select the two Linux configs. I want to configure both the include and library settings.

image

First the include:

image

Although the include location is the same for all four configurations, I can't set it once for every one.

The Windows and Linux toolchains aren't the same, so they can't share settings across them.

I can share settings across configurations of the same toolchain, so setting include and link lib for both Linux configs can be shared.

 

Then the Linux ARM dynamic lib for hardware float.

This is the content of the library folder for these configurations.

 

image

In the GCC linker, you do not mention the lib at the start and the .so at the end:

image

 

You can now build the two configurations:

image

image

Then execute the Debug configuration from previous post.

This will upload the binary to the Linux box and start the debugger.

I had previously installed the shared library.(see prerequisites > Library)

image

 

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
  • 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