windows compiler

This is a discussion on windows compiler within the C++ Programming forums, part of the General Programming Boards category; I've started work on something that is supposed to be cross-platform. So, altho I'll probably have to get crazy drunk ...

  1. #1
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300

    windows compiler

    I've started work on something that is supposed to be cross-platform. So, altho I'll probably have to get crazy drunk first, I need to learn how to make stuff on windows (right after I figure out how to make a shortcut to a start menu item, heh-heh).

    I figured mingw and cmake are the best way for me to go but just wanted to check that this is not going to lead to headaches; the website says it's fine for applications "which do not depend on any 3rd-party C-Runtime DLLs". That's probably fine for me too, but I dunno: if I am using wxwidgets and boost libraries, will they be needing to do that?

    Someone mentioned in another thread that the vs++ compiler is available separately from the IDE (I will still be using vim, of course, and would prefer a CLI for the compiler). Is that free? Will it work with cmake?

    I don't want to end up with code that is compiler specific, either. Also: I need to port to OSX "snow leopard" too; I assume just plain gcc will be fine there but if not, is there anything like mingw that works on windows and macs (gcc based or otherwise)?
    Last edited by MK27; 05-10-2011 at 10:20 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    2,760
    I've started work on something that is supposed to be cross-platform.
    Someone mentioned in another thread that the vs++ compiler is available separately from the IDE (I will still be using vim, of course, and would prefer a CLI for the compiler).
    I don't want to end up with code that is compiler specific, either.
    CLI is basically a Microsoft extension that is primarily only used on Windows platforms. So if you want cross-platform I would not recommend CLI.

    The wxwidgets framework has been ported to all three platforms so you should be able to use it without problems. The boost libraries are designed to be platform neutral so they will also work on all three platforms, with any standard compliant compiler.

    The gcc compiler is also available for all three platforms. The mingw port contains everything, other than the operating system, to compile and run your programs. You should not require any of the Microsoft run time files to run your programs.

    So if you are familiar with the gcc toolchain I would recommend that you use this compiler for all three operating systems.

    Jim

  3. #3
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,629
    I believe MK27 was referring to Command Line Interface, not Microsoft's proprietary language technology.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #4
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    4,262
    The MinGW pages are referring to the fact that the binaries the compiler produces may only depend on shared libraries that a Windows installation will already have. (These libraries are mostly the Windows core like "USER32.DLL", but the binaries will also depend on an older version "MSVCRT". Only noted in the unlikely even that you are targeting an ancient version of Windows.)

    If you are building for C++, and using the latest version of the of "GCC", it will build shared libraries linked to a shared library version of "libgcc" and "libstdc++"; with some effort, you can force the compiler and linker to link with statically linked versions of those libraries, but you sacrifice some functionality in the process. It would be better to just allow the dependency and simply ship them with your Windows distribution. Even though those libraries are "GPL" code, an exception is in place allowing them to be used even with proprietary code.

    You can find the latest most recommended version of the MinGW port of "GCC" by searching for "Twilight Dragon" and "MinGW" or "GCC". Yes, even though it isn't often the official MinGW build, it is the recommended form; several of the MinGW maintainers use that build themselves.

    I highly recommend you install either "MSYS" package and use "CMAKE" from there or install "CYGWIN". The tools you will be familiar with in producing your code, packages, and redistributable files will likely not be available on a native Windows install. Don't be afraid of "CYGWIN" either; if you have the paths setup properly, "CMAKE" will use the MinGW port of "GCC" so the compiled binaries will not depend on the "CYGWIN" shared library.

    Many parts of "Boost" that are compiled are targeted at binary redistribution in the form of shared libraries. If you use those parts, you will need to include those libraries. "wxWidgets" is also almost always distributed as a shared library.

    If you don't need "C++1X" support, the free "MSVC Toolkit" is still available, is taken from "MSVC2K3", makes an excellent compiler, and has a fairly unrestrictive license. However, I've heard of a lot of people having problems building "Boost" without a full installation of the suite, but even then, you could just download and use a version ready built by someone else.

    As it happens, "GCC" can be setup as a cross compiler as can the MinGW port. In other words, once you are setup, you can easily compile binaries targeting both "Windows", "Mac OS", and "GNU/Linux" from whichever operating system you want to use to do the development.

    I believe MK27 was referring to Command Line Interface, not Microsoft's proprietary language technology.
    Well, don't I feel silly; I had to google for the Microsoft definition.

    Soma
    Last edited by phantomotap; 05-10-2011 at 02:30 PM. Reason: none of your business

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Compiler For 64-Bit Windows 7
    By Dr.Xperience in forum C Programming
    Replies: 9
    Last Post: 07-06-2011, 05:37 AM
  2. gcc compiler for windows?
    By td4nos in forum C Programming
    Replies: 8
    Last Post: 07-19-2009, 02:28 PM
  3. C Compiler For Windows CE
    By nathanpc in forum C Programming
    Replies: 1
    Last Post: 07-12-2009, 07:38 AM
  4. C Windows Compiler
    By pobri19 in forum Windows Programming
    Replies: 3
    Last Post: 05-30-2008, 05:36 AM
  5. <windows.h> compiler help..!
    By The Brain in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2005, 08:47 PM

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