The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
entry point (_main) undefined
divad


Joined: 09 Jun 2015
Posts: 15
I'm trying to run my SDL app on ios8, xcode6. The ios simulator works fine, but when I build for a real device I get the linker error: "entry point (_main) undefined".

I link with libSDL2.a only. When I run "lipo libSDL2.a -info" I see "armv7 armv7s arm64" so that seems fine. My entry point looks like...

Code:
extern "C" int main(int argc, char* argv[]) {
    // ...
    return 0;
}


Which also seems fine. I also have the linker flag -ObjC, but it doesn't seem to do anything either way (should I need it?).

So far as I know, SDL_uikitappdelegate.m is supposed to define main. I can build, link, and run for/on the ios simulator, but on a real device it fails to link. Any ideas?
divad


Joined: 09 Jun 2015
Posts: 15
Is it kosher to bump threads? I just can't believe no one else has run into this where the SDL entry point works in the ios simulator but not on a real device... especially with ~700 views of this question...
entry point (_main) undefined
Ryan C. Gordon
Guest

On 06/22/2015 11:43 AM, divad wrote:
Quote:
Is it kosher to bump threads? I just can't believe no one else has run
into this where the SDL entry point works in the ios simulator but not
on a real device... especially with ~700 views of this question...

Is it possible you don't have SDLmain included in the build when
targeting a real device, or maybe SDLmain doesn't have support for the
real device's architecture so the linker is rejecting it?

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
divad


Joined: 09 Jun 2015
Posts: 15
So, the problem is that I was calling the configure script before before building the ios project, because I was building for a different platform beforehand. What arguments should I pass the configure script as to make building ios equivalent to never having run it? I don't really know what that script does, but it changes some source code #defines or something right?
entry point (_main) undefined
Ryan C. Gordon
Guest

On 06/24/2015 02:09 PM, divad wrote:
Quote:
So, the problem is that I was calling the configure script before before
building the ios project, because I was building for a different
platform beforehand. What arguments should I pass the configure script
as to make building ios equivalent to never having run it? I don't
really know what that script does, but it changes some source code
#defines or something right?

build in a separate directory:

mkdir build1
cd build1
../configure for whatever for platform
make

cd ..
mkdir build2
cd build2
../configure for whatever _different_ platform


Alternately, you can try deleting your build dir manually, or "make
distclean" to delete everything away from a previous configure.

--ryan.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org