I use codeblocks under the windows, there was a problem when i run the exe file built. Through codeblocks runs without errors. A separately does not work. Just I use sdl + opengl, but the problem is obvious not in them . Initially, required libstdc, has added to link to the linker options
-static-libgcc -static-libstdc++
Then another pthread, and so on. On the Internet I found a way to add to linker options is
-static -lpthread -lole32 -limm32 -lgdi32 -lwinmm -loleaut32
Next, the compiler began issuing
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:566: undefined reference to `GetFileVersionInfoSizeA@8'
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:570: undefined reference to `GetFileVersionInfoA@16'
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:571: undefined reference to `VerQueryValueA@16'
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:566: undefined reference to `GetFileVersionInfoSizeA@8'
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:570: undefined reference to `GetFileVersionInfoA@16'
/Users/slouken/release/SDL/SDL2-2.0.4-source/foo-x86/../src/video/windows/SDL_windowskeyboard.c:571: undefined reference to `VerQueryValueA@16'
collect2.exe: error: ld returned 1 exit status
I found these functions, they require winver.h. Included, but errors staying. I thought I could fix it linking mincore lib ( implementation Winver.h is here ) , but it does not see mingw
ld.exe||cannot find -lmincore|
||error: ld returned 1 exit status|
All that I have included in the project
#include<iostream>
#include<cstring>
#include<windows.h>
#include<objbase.h>
#include<winver.h>
#include<oleauto.h>
#include"SDL.h"
#include"SDL_main.h"
#include"SDL_opengl.h"
#include"SDL_image.h"
#include"GL/gl.h"
#include"GL/glu.h"