Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8331961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:34:41+00:00 2026-06-09T02:34:41+00:00

I need to cross-compile some C/C++ library. The library depends on several C/C++ libraries.

  • 0

I need to cross-compile some C/C++ library. The library depends on several C/C++ libraries. Some of those of libraries in turn depend on other libraries. All libraries come with configure script. I know how to compile and install libraries on host system – install dependencies before the lib I need. Obviously this won’t work when cross-compiling. Any tips are appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:34:43+00:00Added an answer on June 9, 2026 at 2:34 am

    Generally, to cross-compile an autotooled package, you pass a couple of extra arguments to ./configure: --host and --build. --host is the name of the system that the built programs will run on, and --build is the name of the system that does the compiling.

    When I say “name of the system”, I mean a tuple of the form ARCH-VENDOR-OS-LIBC. (For example i686-pc-linux-gnu is the tuple describing the system I’m currently using.) Sometimes parts of the tuple are elided, as in the case of the mingw32 toolchain (on my system, the mingw32 cross tools are installed with the tuple i586-mingw32msvc and/or amd64-mingw32msvc).

    (There’s another argument to configure, --target, which is for cross-compiling compilers and specifies the system that the compiler being built will target when generating code.)

    Each toolchain has its own subdirectory under /usr such as /usr/i586-mingw32msvc. You’re going to want to install new packages here so they get found. Use the --prefix argument to configure.

    So to cross-compile from my GNU/Linux system to a MinGW32 system, I would run configure like this:

    ./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu --prefix=/usr/i586-mingw32msvc
    

    So start with the leaves of your dependency graph and work your way up. You may want to also pass --enable-static --disable-shared to configure: that will stop the creation of dynamic libraries for libtooled packages. You may have to install some packages natively as well as cross-compiling them, if a package needs to run a program as part of the build.

    Sometimes configure‘s tests will fail: where it tries to compile and run a program, for instance. Often these tests set a cache variable which you can also pass on the command line to configure. Similarly, you can override things like program paths and library compile/link flags. Check your package’s ./configure --help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a cross-platform library/algorithm that will convert between 32-bit and 16-bit floating point
I am wanting to write some cross-platform library code. I am creating a library
I need some idea how to write a C++ cross platform implementation of a
I'm need some help tracking down the compile errors that thrust::fill is giving me.
I need a cross browser way of capturing the right mouse click, preventing the
I need a cross-browser compatible plugin for textrea to be auto growing and shrinking
I need a cross-platform solution for multi-thread to write to a same file concurrently
I need to write cross-platform GUI application, what toolkit can I use? Currently I
I need to write cross platform application (basically CRUD). Is usage of Java Swing
I need to do a cross-domain request in a chrome extension. I know I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.