Windows/Linux C++ project

This is a discussion on Windows/Linux C++ project within the Linux Programming forums, part of the Platform Specific Boards category; I am planing to do a C++ project in Windows, using DevCpp as an IDE and using SDL as a ...

  1. #1
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286

    Windows/Linux C++ project

    I am planing to do a C++ project in Windows, using DevCpp as an IDE and using SDL as a graphics library. The project is supposed to compile both in Windows and in Linux. What shall I think of?

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,892
    Don't use any Win32 API. Don't use backslashes as path separators. (Windows will mostly work just fine with forward slashes.) Regularly compile and test on Linux.

    Using DevCpp will largely shield you from accidentally using VC++-specific features.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Try taking a look at wxWidgets if you need a GUI.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,337
    > What shall I think of?
    An old favourite - a tetris clone?
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286
    No, I'm not making a tetris clone, actually I'm trying to make something that visualises or illustrates something about the theory of relativity, that was the though at least. It's a project in school.

    And thanks for the answers so far.

  6. #6
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    If you need lines, circles, etc, consider using SDL_gfx or maybe SGE, or take the code from here if you can't use another library: http://www.brackeen.com/home/vga/

    Also definitely consider using SDL_image, which lets you use png, jpg, tiff, etc images instead of just bmp images, which really saves on disk space.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  7. #7
    Registered User
    Join Date
    Dec 2006
    Posts
    2
    Yeah, SDL is great. And it's true, using Dev-CPP on windows might ease out any pain, since it uses Mingw which is (As far as I know) a gcc implementation on windows (Also available for other OSes), so compiling options should be the same. I suggest either creating an SVN Repository or using one on the internet so that you can simply boot into either OS and update your code if you made changes to it from the other OS, or you can mount your Windows partition/drive in linux and just copy the source from there, or vice versa using a file system driver (Such as Ext2 IFS). You can also use DevIL for image handling, I believe it supports many more image formats, but that is up to you and what you feel is better, after all, I doubt you'd be using little known image formats.

  8. #8
    Algorithm engineer
    Join Date
    Jun 2006
    Posts
    286
    Quote Originally Posted by Salem
    > What shall I think of?
    An old favourite - a tetris clone?
    Huh?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Displaying a Struct
    By rockstarpirate in forum C++ Programming
    Replies: 16
    Last Post: 05-05-2008, 09:05 AM
  2. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 01:30 PM
  3. Dynamic Binding
    By gpr1me in forum C++ Programming
    Replies: 1
    Last Post: 03-24-2006, 08:01 AM
  4. Game Independent Anti-cheat Project Needs Programmers
    By GIA Project Lea in forum Projects and Job Recruitment
    Replies: 3
    Last Post: 09-15-2005, 07:41 PM

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