Giter VIP home page Giter VIP logo

Comments (4)

Nairou avatar Nairou commented on July 17, 2024 43

From stb_image.h:

Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in one C or C++ file to create the implementation.

from stb.

Nairou avatar Nairou commented on July 17, 2024 21

That's because STB_IMAGE_IMPLEMENTATION needs to be defined within a .c or .cpp file, not within a header. When you define STB_IMAGE_IMPLEMENTATION, you are creating the bulk of the stb_image code. You only want that code to exist once, like the code in your own project, which is why it has to be defined within a .c or .cpp file.

from stb.

andrepcg avatar andrepcg commented on July 17, 2024

I missed that line...

I did that in my Utils.h file. Now I'm trying to access the functions in another file that is including Utils.h but I still get errors:

Error   276 error LNK1169: one or more multiply defined symbols found   ...\3PS.exe
Error   274 error LNK2005: _stbi_zlib_decode_noheader_malloc already defined in 3PS.obj ...\Utils.obj
....

I've checked and the fname.obj are all the files referencing Utils.h

from stb.

andrepcg avatar andrepcg commented on July 17, 2024

Thanks, solved it!

from stb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.