Thread: Windows or Linux?

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    2

    Windows or Linux?

    Hello all!

    I am planning on learning C++ and I was just wondering if it really mattered which OS I used. I just put Linux on an old computer that I had, as something else to learn in my spare time.

    Can you compile programs for windows on a linux box and vice versa?

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    If the programs stick to the c++ standard then yes. But to do some things will require OS specific functions.
    I would say for learning the c++ language it dosen't matter what OS you use.

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    86
    I would say use linux

    the environment is much nicer, plus I just hate windows, vc++ is annoying to learn

    Plus, most of the GUI API's one woudl use on linux have a windows version, so the code can be very easily ported

    go with linux

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    Can you compile programs for windows on a linux box and vice versa?
    Generally no. But, if you write ANSI/ISO Standard C++ code, it can be re-compiled for any platform (on the new platform) if it has a compiler.

    However, there is no sound, graphics, color, or mouse in Standard C++. Most real-world programs have some system-specific (non-portable) code.

    A compiler that makes executable code for a different system is called a cross-compiler. Typically, cross-compilers are used for embedded system development. If you're writing code for an automobile ignition system, you would might develop it (and compile it), on a PC using special-purpose development software, then transfer the executable hex-code to the embedded system. That system may have a non-Intel CPU, and it may have another operating system, or no operating system at all.

  5. #5
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    as much as i hate to say it, i would recommend windows vc++ for the shear fact that you can get very quickly look things up via vc++'s help.

    another thing i hate to say is that *most* (give or take) useful programs are OS dependant in my opinion. you can write console programs for both OS's, but you must adhere to the standard. as far as learning c/c++ goes however, there's only slight differences between OS's. the more low-level or specific you get, the more platform depedant you get. but for learning the language, it's syntax, and it's basic functions, whichever OS (or both) you feel more comfortable with is probably the right one. don't get me wrong, you can write portable, usefull programs but in my opinion, most of them aren't 100% portable.

    i'm a little drunk, so if the above doesn't make much since, let my point be:
    You'll know when to be concerned about which OS you're coding for when you get there.
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  6. #6
    Registered User samGwilliam's Avatar
    Join Date
    Feb 2002
    Location
    Newport
    Posts
    382
    Quote Originally Posted by misplaced
    as much as i hate to say it, i would recommend windows vc++ for the shear fact that you can get very quickly look things up via vc++'s help.

    another thing i hate to say is that *most* (give or take) useful programs are OS dependant in my opinion. you can write console programs for both OS's, but you must adhere to the standard. as far as learning c/c++ goes however, there's only slight differences between OS's. the more low-level or specific you get, the more platform depedant you get. but for learning the language, it's syntax, and it's basic functions, whichever OS (or both) you feel more comfortable with is probably the right one. don't get me wrong, you can write portable, usefull programs but in my opinion, most of them aren't 100% portable.

    i'm a little drunk, so if the above doesn't make much since, let my point be:
    You'll know when to be concerned about which OS you're coding for when you get there.
    MSDN is online now.

  7. #7
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    please don't think that you need to use VC++ to code in C++ on windows. MingW has ported GCC to windows, so as long as you have standards-compliant code, it'll run fine. if you're just starting out, it doesn't really matter which OS you use, but for more real-life programming, you're going to have to learn a little OS-specific code. I'd say this mostly is determined by your job though.

    note: the MingW port of GCC can be found in Dev-C++
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you're planning to learn C++, then you'll need either a fairly recent version of GCC (either gcc on linux, or one of the windows ports like dev-c++, mingw, cygwin, djgpp), or the latest microsoft .net compiler.

    VC++ version 6 is so old and out of touch with respect to the C++ standards that it won't be long before you bump into some weirdness.
    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.

  9. #9
    Registered User
    Join Date
    Mar 2005
    Posts
    2
    Thank you everyone for your input. I think that I am going to start to learn in Windows, only because I am more comfortable in it. I may switch over to Linux at a later date, once I get some more experience with it. I downloaded Bloodshed Dev-C++ so expect more questions from me soon.

    Thanks again.

  10. #10
    Registered User
    Join Date
    Dec 2004
    Posts
    465
    I have a desktop PC and a mac laptop. I've never used Linux. I only program on my PC because my Xcode compiler for mac has insane amounts of errors because its on Mac and I don't want to mess with that stuff. I don't know one bit of vc++ who says you have to learn it just because you have windows?
    My computer is awesome.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. windows .dll vs. linux .so - global static objects
    By pheres in forum C++ Programming
    Replies: 11
    Last Post: 11-23-2010, 01:29 PM
  2. Thinking of upgrading to linux...
    By Yarin in forum General Discussions
    Replies: 37
    Last Post: 07-24-2009, 11:40 AM
  3. Build linux on windows
    By baash05 in forum Linux Programming
    Replies: 6
    Last Post: 02-19-2008, 10:12 PM
  4. Why can't Windows run Linux binary executables?
    By Kleid-0 in forum Tech Board
    Replies: 30
    Last Post: 12-04-2005, 11:44 PM
  5. Linux and Windows Duel Boot
    By The15th in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-26-2002, 04:59 AM