Permalänk

SDL_image i OSX

Jag håller på att lära mig C++ och SDL. Kodar i Xcode och när jag försöker kompilera något som använder SDL_image så säger den "Undefined symbols: _SDL_Error referenced from @executable_path/../Frameworks/SDL_image.framework/Versions/A/SDL_image expected to be defined in SDL". Koden är det inget fel på, den funkar fint i Linux. Installerade SDL och SDL_image som fanns på deras sida och jag har lagt till SDL.framework och SDL_image.framework i mitt projekt.

Hade någon konstig version av SDL_image och SDL förut, från darwinports tror jag. Den funkade, men krävde att man hade dessa frameworks i /Library/Frameworks och det vill jag absolut inte att någon ska behöva.

Visa signatur

Sverker G. Johansson

Permalänk
Medlem

Ser ut som den har byggt SDL som ett embeddable framework, dvs, man ska kopiera dem till sin appbundle så att de hänger med applikationen. Låter som en bra idé, eftersom SDL.framework inte levereras med Mac OS X, så användaren skulle annars behöva installera det själv.

I alla fall, hur du ska gå till kan du läsa om på här. Du kan nog skippa allting fram till beskrivningen om hur man sätter upp sitt apptarget, du har ju redan frameworken klara.

Permalänk
Citat:

1. Add your framework product to the Link Binary With Libraries build phase of your application target. This tells the application where to find your framework during the link phase.

To add the framework, crag the icon for your framework from the project’s Products group to the application target’s Link Binary With Libraries build phase. Dragging the target icon for the framework target has no effect.

Har haft dem i Link Binary With Libraries hela tiden, men jag har inga frameworks i Products, bara min .app som finns där.

Citat:

2. Select the application target and choose Project > New Build Phase > New Copy Files Build Phase.
3. Open the new build phase’s Info window.
4. Choose Frameworks from the Destination pop-up menu.
5. Add your framework product to the Copy Files build phase you just created.
6. Select the application target, open its Info window, and click General.

Det här hade jag redan gjort.

Citat:

7. Drag the framework target to the Direct Dependencies list in the application target Info window. Adding this dependency causes Xcode to build the framework target before building the application target.

Framework target? Jag testade att dra dit SDL.framework och det gick inte, vad är det jag ska dra dit?

Visa signatur

Sverker G. Johansson