Rikonator
Rikonator

Reputation: 1860

SDL 2.0 with Code::Blocks

Ever since I picked up SDL (which was not too long ago), I have used Code::Blocks with MinGW to develop... on Windows. Setting it up for SDL 1.2 was easy and quick.

Now I want to start with OpenGL 3.2, and since I already know SDL, I thought using it for OpenGL would be logical. So I downloaded SDL 2.0, which supports OpenGL 3.x, and tried to build the libraries.

I tried to make install with Cygwin, but it did not configure because I am on Windows. To get the .lib and .dll files, I followed the VisualC instructions and was able to generate them.

But I was pretty sure I wouldn't be able to use the *.lib files with MinGW. I couldn't.

So I tried to use reimp to convert the *.lib files to *.a. It did not work, all libraries were found to be "corrupt". Even glew32.lib which I downloaded and did not build myself. I am quite lost.

Can I even get it to work with MinGW, or do I have to switch to VisualStudio?

(I don't even know if VC++ 2010 Express Edition will be usable. The only reason I was able to build the VisualC libraries is because I used the Visual Studio Pro Trial. VC++ 2010 was not letting me do so earlier.)

Update:

I used MSYS to build the *.a and *.dll.a for both SDL 2.0 and GLEW. My project was linked properly and built without any problems. But, I am unable to run it.

I get the error "The application was unable to start correctly (0xc00007b)".

I know this problem is due to incorrect *.dll files. I have linked all the *.dll.a files I built, and I don't know why this problem is occurring.

What am I doing wrong?

(Here is the pastebin of the test program I wrote, but I doubt that the present problem is with the code.)

Update v2:

I solved it. I just put the *.dll files into the System32 folder, as well as the SysWOW64 folder.

Then, I just had to debug my code. Currently, you can't simply call SDL_Init(SDL_INIT_EVERYTHING) because there is no haptic support.

Now that I've got my stuff working, I'll get to developing. Thanks for your help.

Upvotes: 1

Views: 2180

Answers (1)

Youssef Oujamaa
Youssef Oujamaa

Reputation: 171

You might want to try installing MSYS, which will provide you with a bash shell and the utilities for building a library on Windows.

Upvotes: 1

Related Questions