0

I am starting out in C++ development (coming from a PHP/Javascript background), with an aim of creating a small game for iOS/Android using SDL2. As far as C++ and SDL2 I feel I'm understanding everything well so far, but I am struggling with how to structure and setup a project for multiple platforms. I've been searching for a solution all morning, but I'm perhaps just not using the right terms to find the answer I seek.

Is there a way to setup an SDL project for Xcode and Eclipse so they can both share common code and assets? Or is it best to just treat them as separate projects and copy/paste common code and assets (this feels wrong though)? Thanks

Fourjays
  • 537
  • 1
  • 8
  • 16
  • 1
    Factor the common code into a library, then include/link in the divergent projects. Never copy/paste code. – JBentley Jun 09 '14 at 13:49
  • Ok, I can find out how to do the linking part (presumably much the same as adding SDL) and I'm guessing the file structure will be something like "Project/Common", "Project/iOS" and "Project/Android". However I'm not sure what project type I need to start in Xcode for the common code library? – Fourjays Jun 09 '14 at 15:42
  • I eventually figured out that I had to create a Cocoa Static Touch Library, then just replace the generated Obj-C files with some C++ ones. – Fourjays Jun 11 '14 at 12:17

0 Answers0