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
  • About Us
  • 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 4b: link 3rd party library on Windows
  • 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 5:13 PM Date Created
  • Views 818 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 4b: link 3rd party library on Windows

Jan Cumps
Jan Cumps
25 Dec 2020

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

Continuing from post 4a, where I configured the Linux build.

image

 

I'm assuming here that the 3rd party provides a compiled lib and the necessary header files. And that you did the steps in that post.

 

Link and Test on Windows x86 / x64

image

In my use case, the 3rd party library archive for windows contains a .dll and .def file.

image

That's good. We can work with that. We can even work with a plain .dll only. But when the .def file is available too, we have better debug support.

The GCC linker needs a more common (read linux-ish) library than the .dll to build an executable.

But all the tools to build that library are available in the GCC toolchain.

We just have to execute this command (part of the cygwin/mingw distro):

 

dlltool --def uFCoder-x86_64.def --dllname uFCoder-x86_64.dll --output-lib uFCoder-x86_64.a

 

You can choose to do that one time, or as a pre-step in the Eclipse build process for Linux.

If you take the second option, the file will be re-generated often. But you don't have to remember the command line when you switch to a new version of the 3rd party lib. Your choice.

 

Now that I have all artifacts, it's time to set up the windows configs:

Again it's  a good point to learn how to configure a set of configurations in a single action.

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

image

First the include file.

image

Then the library.

image

 

That should do for the build part:

image

Then execute the Windows Debug configuration from previous post (don't forget to move the smart card reader from the Linux USB to one of your Windows computer USB ports).

The window executable depends on the 3rd party dll. So we have to add it to the build path:

image

This works, exactly like on Linux. That was the goal.

image

 

Finish.

 

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