Config:
OSX 10.10.5
XCODE 7.0
SDL 1.2.15
How to reproduce:
Copied the SDL.Framework to /Library/Frameworks as explained on the readme.txt
On XCODE Template > Building settings > Framework Search path as /Library/Frameworks
I included the SDL framework on the main.cpp file as follows:
#include <SDL/SDL.h>
Then I had the same problem loading SDL Framework on XCODE, because of a double declaration of class main that blocked the compilation.
This is the error message:
Undefined symbols for architecture x86_64:
"_main", referenced from:
implicit entry/start for main executable
(maybe you meant: _SDL_main)
This how I solved it:
I checked and saw that SDL.h is including all the following files:
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
#include "SDL_events.h"
#include "SDL_loadso.h"
#include "SDL_mutex.h"
#include "SDL_rwops.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_video.h"
#include "SDL_version.h"
#include "begin_code.h"
One of them is SDL_main.h and on that file we see:
#define main SDL_main
This line is producing a conflict with the class main on main.cpp, commenting that line on SDL_main.h or commenting the line #include "SDL_main.h" on SDL.h solves the issue.
I'm a noob on C++ (I just learn it at University many years ago) but from other languages I know that "hacking" a library is a very bad practice... though it seems to be a particular compatibility problem with MAXOSX and I really want to use XCODE...
Please correct and comment, justify yes or no, as I'm on a learning process.
Cheers!