Results 1 to 6 of 6

Thread: Xcode SDL2 issue: "Undefined symbols for architecture i386"

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    1. Which SDL2 headers are you using?
    2. Sure you got all the development libs? (And for the right arch?)

  2. #2
    I'm using these headers:

    https://github.com/ev1313/Pascal-SDL-2-Headers

    And have installed the Mac OS X SDL 2 frameworks from the official sources (I mean, I didn't install them from source files, I downloaded the .dmg's from the official websites and installed them by copying the frameworks into the Library/Frameworks/ folder). There's only one .dmg to choose for SDL2, SDL2_image and SDL2_mixer, respectively.

    I'm also using the Xcode 4 Objective Pascal templates from here:

    https://dl.dropboxusercontent.com/u/...bjP/index.html

    I'm fairly sure that it's an issue with Xcode not finding the SDL 2 libraries/frameworks during linking, but I don't know how to fix that. I've tried setting the framework path in Build Settings, but that didn't help.
    Last edited by Christian Knudsen; 09-02-2015 at 01:10 PM.
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  3. #3
    Finally some progress!

    I had to add:

    {$IFDEF DARWIN}
    {$linkframework Cocoa}
    {$linkframework SDL2}
    {$linkframework OpenGL}
    {$linkframework SDL2_image}
    {$linkframework SDL2_mixer}
    {$ENDIF}

    To the main source file to get it to compile. I have no idea why, though. It now crashes when setting up the OpenGL context during runtime, but at least it's compiling now!
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  4. #4
    ev1313's headers use {$LINKLIB} to specify linking to SDL2. I'm guessing that because you put the SDL2 lib in Frameworks/, {$LINKLIB} failed to find them so you had to use {$LINKFRAMEWORK}.

  5. #5
    Ahhh, that makes sense! There should probably be a notice about that in a readme or somewhere else, since per the installation instructions on the SDL2 website, most people will probably install the frameworks in Library/Frameworks.

    I also fixed the OpenGL crashing issue (I had OpenGL was set to PROFILE_CORE when it should be PROFILE_COMPATIBITY as I'm using immediate mode). I've never been this relieved to just manage to compile and run some code before!
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •