Thread: C++ Code : Unix vs Windows

  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
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    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 01:27 AM.

  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
    2,738
    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, 10:32 PM
  2. Unix Programming on Windows
    By hYph3n in forum C Programming
    Replies: 4
    Last Post: 04-25-2006, 06: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, 03: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, 03:37 PM

Tags for this Thread