Xcode 4.0.2 SOIL Library Link Errors (OSX 10.6.8)

My user story: I want to load a texture into my openGL program.

My question is: how to properly bind the SOIL library in xcode 4.0.2

So, over the past few days I have been looking for information about my warnings about linkers in xcode4 and I canโ€™t answer it myself, so I dare to post another topic on this issue ... (modest beginner secrets tail between legs).

My actions: "

  • I will unzip the โ€œOpenGL Simple Image Libraryโ€ to my downloads
  • I am dragging libSOIL.a into the project file

    • In the "Phase Assembly" section, libSOIL.a is automatically added to "Link Binary With Libraries"
    • The Build Settings section also automatically updates my library search paths.
    • My virtual architectures already indicate "i386 x86_64"

I get this warning when I try to run my program:

ld: warning: ignoring file /Users/Scott/Developer/Projects/SpaceRanger/Code/Production/lib/libSOIL.a, the file was created for an archive that is not related to architecture (x86_64)

As I mentioned, I'm completely new to programming and the IDE in general, so I was hoping that a simpler approach to loading textures in OpenGL (like SOIL) would be good for SDL or even GLFW. If I have problems downloading only libraries, they should be completely out of my league.

Other Hit n 'Miss search-based attempts:

  • adding a library to Compile Sources generates more warnings
  • toggling 'Only embedded active architecture' Yes โ€‹โ€‹/ No
  • tuning schemes up to 32 and 64 bit
  • writing my own texture loader using libjpg / DevIL / etc.

I'm afraid I'm starting to cripple my project, just trying to link this library. If someone can help me link the SOIL library properly in xcode 4.0.2, I will be forever grateful.

Thank you in advance.

-kropcke

+6
source share
1 answer

I would like to add to this, which over the past few days has confused me. Like all of the above, I had to provide the following.

In Project> Target> Build Phases, in the "Compilation Sources" section, you need to add .c SOIL files:

image_DXT.c, image_helper.c, SOIL.c, stb_image_aug.c.

Only now will it compile and run.

// not sure why downvote will appreciate the reason!

+5
source

Source: https://habr.com/ru/post/924114/


All Articles