frustrated programer looking at my non-windows options

Posted:
in Genius Bar edited January 2014
I am furrious at M$ right now - I have a huge project due and my compiler/whole os install of xp pro is screwing up big time and with a large project (for my skill level) due Wed., it will not help immedeitly but i do have a few questions that have been nawing at me:



if i use xcode on mac for terminal based c++ apps, how much work is involved in porting it back to windows for my teacher to grade?



and since the units at school are windows ( should i continue using only the windows platform (as apposed to finding a cheap mac or dual booting bsd) untill i graduate in May?

Comments

  • Reply 1 of 8
    kickahakickaha Posts: 8,760member
    If you program for the POSIX API set, then any command line C++ app you can compile on OS X will compile with gcc under Windows.



    Of course, your teacher may require you to use Visual C++, .NET, or some such, in which case all bets are off. (Big shocker: MS's C++ implementation in VC++ has been traditionally pretty broken. I hear they finally got most of it working in the latest couple of years, but frankly I'd been burned so much by them years ago I gave up.)



    If you need a GUI app, then I'm afraid that Windows is about your only way to go. \
  • Reply 2 of 8
    a_greera_greer Posts: 4,594member
    Quote:

    Originally posted by Kickaha

    If you program for the POSIX API set, then any command line C++ app you can compile on OS X will compile with gcc under Windows.



    Of course, your teacher may require you to use Visual C++, .NET, or some such, in which case all bets are off. (Big shocker: MS's C++ implementation in VC++ has been traditionally pretty broken. I hear they finally got most of it working in the latest couple of years, but frankly I'd been burned so much by them years ago I gave up.)



    If you need a GUI app, then I'm afraid that Windows is about your only way to go. \




    .

    well, i use visual c++ 6 both places, is the code syntax different in gcc?
  • Reply 3 of 8
    kickahakickaha Posts: 8,760member
    Quote:

    Originally posted by a_greer

    .

    well, i use visual c++ 6 both places, is the code syntax different in gcc?




    Not the syntax, per se, but the details of how templates work, whether RTTI is available at certain times in exception chains, etc, etc, etc.



    Basically, it was 'embrace and extend'. :P MS's version of C++ and gcc's version of C++ pre-gcc3.0 were *HORRENDOUS* to try and get working.



    You might be better off now, I honestly don't know. One thing you'll have to watch out for is that the project info (build ordering, compiler flags, etc) will be completely non-compatible. You'll have to set up two projects, one in Xcode and one in VC++, and keep them in sync manually.



    Frankly, you may want to just bite the bullet and stick with VC++ for now, knowing that when you get out in May you've got many options. A dualboot BSD box for XP and BSD may not be a bad idea - you can use the XP/VC++ side for making sure you can turn in homework, and the BSD/gcc side to familiarize yourself with the basics of that system. Since it's the basis of MacOS X and Xcode, it's not a bad idea and much of the knowledge will transfer rather cleanly.
  • Reply 4 of 8
    gongon Posts: 2,437member
    Just a few thoughts...



    - if you have a Linux/BSD box at home, you can SSH there from school and develop with it - as long as you use command-line apps only

    - if you use makefiles, I think you can import the project to VC++ 6 with no fuss - of course there are still incompatibilities, but they're no problem if you don't have use for some advanced features of C++. The "easiest" incompatibility to stumble on is when you use floating point parameters in a template

    - do you absolutely have to make a Windows binary - can't you show the teacher your software through SSH, running on your own box? If you're not present in the grading then you could still give the teacher an own user account, and along with the code, you give detailed instructions on how to SSH on your box and run the program there

    - if you can install Cygwin (http://www.cygwin.com) on a school computer then you should be able to use its cvs, gcc and make to make Windows binaries directly from your repository at home with no adjustments



    Is XCode compatible with make at some level?
  • Reply 5 of 8
    a_greera_greer Posts: 4,594member
    thanks for the help

    after reading all the posts here i, after reading the posts, have decided to stay with what i know untill May when windows compiles are no longer essential to passing a class.
  • Reply 6 of 8
    kickahakickaha Posts: 8,760member
    Good call, probably.



    Then come join the club, brutha! Dynamic languages, Unixy goodness, killer frameworks, oh my!
  • Reply 7 of 8
    a_greera_greer Posts: 4,594member
    update:

    aftere getting to school and debugging the few errors in the code, i save it and what do ya know - i go to re-open the c++ source after saving it, and what do i see???

    HEXADECIMAL!!!!!!!!!!!!!

    thats right corrupt source file! and non error checked copy was here and the project is now gonna be a day late

    (teacher saw source befor curruption and will accept it late not sure if i get full credit (probably will as it was a computer mishap not mine) )



    can i sue bill gates?
  • Reply 8 of 8
    gongon Posts: 2,437member
    Quote:

    Originally posted by a_greer

    update:

    aftere getting to school and debugging the few errors in the code, i save it and what do ya know - i go to re-open the c++ source after saving it, and what do i see???

    HEXADECIMAL!!!!!!!!!!!!!

    thats right corrupt source file! and non error checked copy was here and the project is now gonna be a day late

    (teacher saw source befor curruption and will accept it late not sure if i get full credit (probably will as it was a computer mishap not mine) )




    ... whereas, in the real world, it is your mishap if there are no backups and no version control. You're better off learning that attitude now, before the project's success really counts.
Sign In or Register to comment.