Note that there are some explanatory texts on larger screens.

plurals
  1. POSDL + OpenGL requires MSVCR90.dll and still gives error
    primarykey
    data
    text
    <p>So I was going to make a SDL + OpenGL project, with MinGW. But for some reason it still depends of a MSVCR90.dll which I find a little odd. So I tried to find a copy of the dll on my computer and copied into my bin folder. Now it gives me this nasty little error:</p> <p><img src="https://i.stack.imgur.com/Ii3xr.png" alt="enter image description here"></p> <p>And here is my code and compile settings:</p> <pre><code>#include &lt;SDL/SDL.h&gt; #include &lt;SDL/SDL_opengl.h&gt; #include &lt;SDL/SDL_image.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string&gt; using namespace std; SDL_Surface * screen; GLuint loadImage(string path) { GLuint texture; GLint nop; GLenum texture_format; SDL_Surface * sdlimage = IMG_Load(path.c_str()); if (sdlimage) { if ((sdlimage-&gt;w &amp; (sdlimage-&gt;w - 1)) != 0) { printf("warning: %s's width is not a power of 2\n", path.c_str()); } if ((sdlimage-&gt;h &amp; (sdlimage-&gt;h - 1)) != 0) { printf("warning: %s's height is not a power of 2\n", path.c_str()); } nop = sdlimage-&gt;format-&gt;BitsPerPixel; if (nop == 4) { if (sdlimage-&gt;format-&gt;Rmask == 0x000000FF) texture_format = GL_RGBA; else texture_format = GL_BGRA; } else if (nop == 3) { if (sdlimage-&gt;format-&gt;Rmask == 0x0000FF) texture_format = GL_RGB; else texture_format = GL_BGR; } else { printf("Invalid byte format on image %s", path.c_str()); exit(1); } glGenTextures(1, &amp;texture); glBindTexture(GL_TEXTURE_2D, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); //Make sure it doesn't blur glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); //In both shrinking and stretching situations glTexImage2D(GL_TEXTURE_2D, 0, nop, sdlimage-&gt;w, sdlimage-&gt;h, 0, texture_format, GL_UNSIGNED_BYTE, sdlimage-&gt;pixels); SDL_FreeSurface(sdlimage); return texture; } else { printf("Could not loud %s: %s\n", path.c_str(), SDL_GetError()); exit(1); } } void drawTexture( GLuint texture ) { glBindTexture(GL_TEXTURE_2D , texture); glBegin(GL_QUADS); glTexCoord2i( 0 , 0 ); glVertex2f( 0 , 0 ); glTexCoord2i( 1 , 0 ); glVertex2f( 16 , 0 ); glTexCoord2i( 1 , 1 ); glVertex2f( 16 , 32 ); glTexCoord2i( 0 , 1 ); glVertex2f( 0 , 32 ); glEnd(); } void shutdown(void) { SDL_Quit(); } void init() { if (SDL_Init(SDL_INIT_EVERYTHING) != 0) //Loads SDL { printf("Error could not initialize SDL!"); exit(1); } SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); //Double buffer for openGL screen = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_OPENGL); //Setup screen size glEnable(GL_TEXTURE_2D); //2d textures glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //Background colour will be black glViewport(0, 0, 640, 480); // Setup a viewport that matches our resolution glClear(GL_COLOR_BUFFER_BIT); //Clear the colours glMatrixMode(GL_PROJECTION); //Setup our projection glLoadIdentity(); //Load a new one glOrtho(0.0f, 640, 480, 0.0f, -1.0f, 1.0f); //Make our view matches our resolution glMatrixMode(GL_MODELVIEW); //Go into modelview glLoadIdentity(); //Load a new one atexit(shutdown); } int main(int argc, char * argv[]) { init(); GLuint text = loadImage("rmb.png"); drawTexture(text); SDL_GL_SwapBuffers(); SDL_Delay(3000); glDeleteTextures( 1, &amp;text ); return 0; } </code></pre> <p>Compile settings:</p> <pre><code>g++ -o bic.exe "src\\game.o" -lmingw32 -lopengl32 -lglu32 -lSDLmain -lSDL -lSDL_image </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload