#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Posts
    421
    Rep Power
    12

    differences in linux vs. windows C++


    is syntax in linux similar or disimilar to that in windows? All the C++ knowledge I know is in windows/dos. Would it be tough for me to make the switch to linux?

    -andy
    hmmm...
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    C++ is the same on both. What is different is the API functions for each OS. If you stick to writing text mode stuff, then there should be very little difference between the two of them. As long as you don't use any GUI stuff/OS specific stuff (i.e. Window GUI functions, Registry functions, Threads etc.) porting should be relatively easy.
  4. #3
  5. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    I concur with Scorpions. All the differences that I can think of are OS-specific stuff.

    For example:

    You write a qualified file name (ie, contains both directory path and file name) differently:
    "files\\thisfile.txt"
    becomes
    "files/thisfile.txt"
    Also, file and directory names will now be case-senstive.

    Instead of doing a FindFirst followed by FindNext, you will do an opendir and readdir.

    Everything else that comes to mind is the extra stuff that you can do in Linux (processes, interprocess comm, etc).
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    34
    Rep Power
    14
    they are very similar, if you know one, you can pick up the system stuff in a day
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Posts
    13
    Rep Power
    0
    IM switching to linux...I hope I wont have too many probs doing C++ or D3D programming
  10. #6
  11. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    If you mean Direct3D programming, then you wont have any problems with it on linux, since it isn't supported by linux.
    Linux uses OpenGL.
  12. #7
  13. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,162
    Rep Power
    2222
    Originally posted by bes
    IM switching to linux...I hope I wont have too many probs doing C++ or D3D programming
    Make the switch with your eyes open. For example, while I do most of my professional work in Windows, I'm learning and working with Linux on the side. I've even written a few test utilities (eg, a broadcast server) on Linux. So my transition is gradual. And I have yet to tackle GUI programming.

    The C++ language is very similar, but don't overlook that the OS and the GUIs are different. You've already learned that you will need to work in OpenGL (which is also supported in Windows) instead of Direct3D. Since you appear to be GUI-oriented, you must also learn that about all you can carry over from Windows programming are some basic concepts. None of your Windows tools will help you (unless there are some ports). Basically, you will either use GTK+ (GUI API using C functions) or Qt (a C++ framework). Borland offers Kylix, which is a Delphi port, but then that's Pascal instead of C++.

    So while you won't have a C++ learning curve, you will still have non-trivial OS and GUI-programming learning curves. By all means, go for it! But be realistic about what the switch is going to take.
  14. #8
  15. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    >> Borland offers Kylix, which is a Delphi port, but then that's Pascal instead of C++.

    Kylix 3 is a C++ compiler as well.
  16. #9
  17. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    You also have wxWindows which is supposed to be cross-platform, but I have never used this guy as of yet.

IMN logo majestic logo threadwatch logo seochat tools logo