1

My aim is to create cross-platform C++ python modules. I'm usingCyther (cross-platform The Cross-Platform Cython/Python Compiler).

Cyther uses GCC to compile modules and gives the user the ability to add GCC command-line args.

So, I need run compiler on Windows, but compile for Linux. What args I must pass to GCC to compile a module for Linux (or other platform)?

Is this possible, if so how?

1
  • 1
    Tried doing some prior research; like using your favorite search engine? And why so many tags? Commented Sep 30, 2016 at 9:24

1 Answer 1

1

Gcc must be built separately for each compilation target. It can be built for any target on any host. The target you need is i386-linux-gnu (or often i586-linux-gnu) for 32-bit and x86_64-linux-gnu for 64-bit Linux.

Note that it provides separate binaries, i386-linux-gnu-gcc, x86_64-linux-gnu-gcc etc. Parameters are then the same.

I am not sure anybody provides that, but you can build it yourself. A tool to help you with that is described in C++ cross-compiler from Windows to Linux.

Or you can go the simpler way and build on Linux (including cross-compilation to Windows). This kind of things is just so much easier on a decent Linux distribution.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.