Errors in Modern OpenGL 3.0+ Tutorial 5

  • yuhuidu02
    Likes 0

    Problem Description

    Hi,

    I used the code from github, but kept getting errors like these:

    Undefined symbols for architecture x86_64:

      "_SOIL_free_image_data", referenced from:

          _main in main.o

      "_SOIL_load_image", referenced from:

          _main in main.o

    ld: symbol(s) not found for architecture x86_64

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    I think it might be a problem with building settings, given what I knew from searching in internet, but I have no idea how to fix it specifically. Can anyone help me?

  • Sonar Systems admin
    Likes 0

    Are you doing this on Mac?

  • yuhuidu02
    Likes 0

    Yes, I was doing this on Mac.

  • Sonar Systems admin
    Likes 0

    Which tutorial did you follow?

  • yuhuidu02
    Likes 0

    The video from this link: https://www.youtube.com/watch?v=bjGJHq3hgi4


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    Did you follow the other videos in the series.


  • yuhuidu02
    Likes 0

    I restart the program and all things are good at the end of Tutorial 2 – Shader Files. But when I follow the programming in Tutorial 3, the exact errors happen:

    Undefined symbols for architecture x86_64:

      "_SOIL_free_image_data", referenced from:

          _main in main.o

      "_SOIL_load_image", referenced from:

          _main in main.o

    ld: symbol(s) not found for architecture x86_64

    clang: error: linker command failed with exit code 1 (use -v to see invocation).

    I think it came from this part of main.cpp, which is:

        unsigned char *image = SOIL_load_image( "resources/images/image1.jpg", &width, &height, 0, SOIL_LOAD_RGBA );

        glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image );

        glGenerateMipmap( GL_TEXTURE_2D );

        SOIL_free_image_data( image );

        glBindTexture( GL_TEXTURE_2D, 0 );

    But I still get no clue to fix it.

  • yuhuidu02
    Likes 0

    I got the answer from this link: http://www.sonarlearning.co.uk/questions.php?question-topic=717, it works now. Thanks.

  • Sonar Systems admin
    Likes 0

    Fantastic.

Login to reply