Cross-Compiling: Libraries Necessary?

This is a discussion on Cross-Compiling: Libraries Necessary? within the C++ Programming forums, part of the General Programming Boards category; I want to use mingw32 to cross-compile a program written for Linux to windows. The program uses GTK for the ...

  1. #1
    Registered User
    Join Date
    Sep 2006
    Posts
    8

    Cross-Compiling: Libraries Necessary?

    I want to use mingw32 to cross-compile a program written for Linux to windows. The program uses GTK for the interface.

    Q. Will GTK need to be cross-compiled too for the compilation to work or will the native win32 runtime mean that cross-compilation is unnecessary for the external library?

    Thanks in advance!

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,506
    You'll need GTK compiled for windows.
    Whether you do that yourself, or get win32 libraries from the GTK site is up to you.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    MinGW32 is a Windows app. If you compile an application with it for Windows, that's not cross-compilation, that's simply compilation.
    Cross-compilation is when you compile an application for a target other than what the compiler runs on.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8
    I'll be compiling with mingw32 on a linux system. I try not to use Windows if I can help it.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by JupiterV2 View Post
    I'll be compiling with mingw32 on a linux system. I try not to use Windows if I can help it.
    Then you will need ALL the necessary libraries in Windows version for the project you are build.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    IMHO the easiest way is just to build it with mingw on Windows (yes, I know it also works on Linux).

    That is what I do with my programs. I do all the development and testing on Linux, then run Windows in a virtual machine to compile a Windows version.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cross compiling
    By X56THN in forum Linux Programming
    Replies: 5
    Last Post: 07-04-2008, 03:30 PM
  2. GCC: Compiling with both static and shared libraries
    By eatwithaspork in forum C Programming
    Replies: 4
    Last Post: 06-23-2008, 01:48 PM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. Time libraries and funtions for Windows C Compiling
    By vmn_3k in forum C Programming
    Replies: 6
    Last Post: 08-14-2003, 01:24 PM
  5. Cross Compiling with Linux and Turbo C
    By ozgulker in forum Linux Programming
    Replies: 0
    Last Post: 11-18-2002, 02:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21