0
\$\begingroup\$

I get the following errors:

Error List screenshot

  • LNK2019 unresolved external symbol _stbi_load referenced in function _main
  • LNK2019 unresolved external symbol _stbi_image_free referenced in function _main LNK 1120 2 unresolved externals

Initially, I gave the path of the stb_image.h & stb_image.c file location C/C++ include directories, as adding the header file directly to the project was not working.

\$\endgroup\$
5
  • \$\begingroup\$ Does this question and answer fix your problem? \$\endgroup\$ Commented Apr 2, 2019 at 4:29
  • 2
    \$\begingroup\$ Include your errors as text, not as images. This keeps the exact error message searchable, and accessible for users using screen readers. \$\endgroup\$
    – DMGregory
    Commented Apr 2, 2019 at 4:29
  • \$\begingroup\$ hey @user1118321 i have done that already yet i get the same error, the weird part is when i try load the stb_image.h file -> add as an existing item i get this error "cannot open source file stb_image.h" at this step #include <stb_image.h> and i made sure i had the #define STB_IMAGE_IMPLEMENTATION. \$\endgroup\$
    – Mani Kiran
    Commented Apr 2, 2019 at 4:45
  • \$\begingroup\$ solved it apparently adding the header file to the VC++ include directory solves the issue. Phew thanks guyz. \$\endgroup\$
    – Mani Kiran
    Commented Apr 2, 2019 at 5:00
  • \$\begingroup\$ Publish an answer to your question with the solution and accept it \$\endgroup\$
    – Bálint
    Commented Apr 2, 2019 at 7:44

1 Answer 1

1
\$\begingroup\$

Add:
#define STB_IMAGE_IMEPLEMENTATION

And after that add:
#include stb_image.h

I had also faced same issue but this define solved it.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .