C++ Code : Unix vs Windows

This is a discussion on C++ Code : Unix vs Windows within the Windows Programming forums, part of the Platform Specific Boards category; Hi everyone, After skimming through a few pages that the search option threw at me, I wasn't quite sure if ...

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    14

    C++ Code : Unix vs Windows

    Hi everyone,

    After skimming through a few pages that the search option threw at me, I wasn't quite sure if this question has been answered or not.

    I am taking my final programming class in college and we are required to submit our work electronically on the university's unix server.

    Throughout time I've been programming using MS Visual Studio 2010. The teacher said we wouldn't be able to write our programs using MSVS, that we would need to SSH to their unix server. While SSH'd use vim/emacs for example to code in, compile using g++ and we use a makefile to save time on the compile/link/exe

    This to me, doesn't make sense. I mean, are the C++ library's on Windows and Unix different? Why wouldn't I be able to just write and test my code using MSVS, then when complete, just copy/paste into the text editor? Thanks for your time.

    JT

  2. #2
    Registered User manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    Kolkata@India
    Posts
    2,528
    Quote Originally Posted by mrJTparadise View Post
    This to me, doesn't make sense. I mean, are the C++ library's on Windows and Unix different? Why wouldn't I be able to just write and test my code using MSVS, then when complete, just copy/paste into the text editor? Thanks for your time.
    You could... if you write (98+3)% portable standard C++ code...which is often not the case.
    To be completely sure... test on the server after you're done.
    Last edited by manasij7479; 03-30-2012 at 02:27 AM.
    Manasij Mukherjee | gcc-4.9.2 @Arch Linux
    Slow and Steady wins the race... if and only if :
    1.None of the other participants are fast and steady.
    2.The fast and unsteady suddenly falls asleep while running !



  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    14
    So what you are saying is there is a syntax?

  4. #4
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    1,625
    Quote Originally Posted by mrJTparadise View Post
    So what you are saying is there is a syntax?
    For example, if you use MFC your code will go boom on gcc. Same goes for many system-dependent libraries, including the WinAPI itself( X11 could be its counterpart ). Also, some MSVS syntax is different, like "asm". Follow @manasij7479 's suggestion and you'll be fine. Another example: "system("PAUSE");" is for Windows ONLY, Linux won't recognise that order!...
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Connecting windows through Unix
    By vin_pll in forum Tech Board
    Replies: 10
    Last Post: 06-23-2008, 11:32 PM
  2. Unix Programming on Windows
    By hYph3n in forum C Programming
    Replies: 4
    Last Post: 04-25-2006, 07:52 AM
  3. How May I connect from Windows NT to Unix
    By jose luis in forum C Programming
    Replies: 3
    Last Post: 08-22-2002, 04:12 PM
  4. Windows or Unix environment
    By ghe1 in forum Windows Programming
    Replies: 5
    Last Post: 02-19-2002, 11:37 AM
  5. unix, windows
    By stef in forum C Programming
    Replies: 3
    Last Post: 09-14-2001, 04:37 PM

Tags for this Thread


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