Good day.
Task: WinAPI + OpenGL + SOIL to create a window, and then load and display a .png image.
What is done: Created a window, drew several primitives in it using openGL.
What doesn’t work: build a project with SOIL
What I write for: compile and compile - g ++. Exe (MinGW.org GCC-6.3.0-1) 6.3.0, I write the code in Notepad ++, I work with g ++ from the command line, OS - Windows 10.
Link libraries: OpenGL was originally present on the computer, so the need to download the library arose only with regard to SOIL. I downloaded SOIL from the official site as a zip archive. After unpacking, I opened the lib folder where I found the file libSOIL.a. I copied this file, and also the SOIL.h file to the folder where the sources of my project lie.
How I try to compile: All my own source code is in the main.cpp file. In the same directory where main.cpp is, there are files SOIL.h and libSOIL.a.
I collect with the help of the g ++ command main.cpp -o main.exe -mwindows -l opengl32 -I. -l SOIL. But g ++ writes: s: / mingw / bin /../ lib / gcc / mingw32 / 6.3.0 /../../../../ mingw32 / bin / ld.exe: cannot find -lSOIL
Then I decide to specify the directory in which libSOIL.a is: g ++ main.cpp -o main.exe -mwindows -l opengl32 -I. -L. -l SOIL. But then g ++ cannot find openGL and produces a lot of messages like - ./libSOIL.a(SOIL.o):SOIL.c:(.text+0x3e): undefined reference to `glGetString @ 4 '
Question: please tell me, what mistakes do I make in the above commands for g ++ and how to fix them?
-lopengl32
put after-lSOIL
- Croessmah