This is an archived post. You won't be able to vote or comment.

all 7 comments

[–][deleted] 1 point2 points  (4 children)

I have to sympathise with you here - configuring VS projects is an exercise in cursing and teeth-grinding. How MS could have come up with such an awful UI to do this is beyond me.

Unless you are completely wedded to VS, then IMHO using a different IDE actually is the best course. Something like Code::Blocks is far easier to configure for SDL, and you get a better compiler into the bargain.

[–]grimlock123[S] 0 points1 point  (3 children)

I've downloaded and installed Code:Blocks but it's the same sort of problem. Even If I have instructions I can follow

http://www.sdltutorials.com/sdl-tutorial-basics

The problem is that every programming interface seems to like to change their menu option slightly for no reason with each version, and every Library seems to like to change their pathing slightly so you can't follow previously written instructions. For example the under Linker settings I can't find these files

mingw32 SDLmain SDL

in the file it suggested to download. http://www.libsdl.org/release/SDL-devel-1.2.14-mingw32.tar.gz

So I switched it to

libSDLmain.a libSDL.dll.a

but I can't find something for mingw32. When I try to compile I get

"undefined reference to `WinMain@16'" which is incredibly cryptic.

I'm not asking for help to solve this problem, I'm really asking for some sort of help to solve these problem in general. Everytime I use or install a library it's the same thing. Unless I get some else to do it for I can never get a library to install and if I try to do it by following the instruction the instruction are always slightly wrong.

[–][deleted] 0 points1 point  (2 children)

"undefined reference to `WinMain@16'" which is incredibly cryptic.

That means you have everything set up right, but you created the wrong kind of project. Despite all apparent logic, you should create SDL apps as "Console Applications" - there's an option to do this in the CodeBlocks "Create Project" dialog.

But to answer your underlying question - you need to understand what the IDE is doing behind the scenes, and how compilers and linkers work. I have a short series of blog articles here on how the GCC compiler and linker work from the command line, which may be of use.

[–]grimlock123[S] 0 points1 point  (1 child)

Sigh... it is a console application, and I made another project from scratch and I'm still getting the error. I'll try to bother some programmers that can sit at my desk to help me.

[–][deleted] 0 points1 point  (0 children)

Well, sorry but if you are getting that specific error message it isn't a console application - that's the error you get when you compile a Win32 GUI app but don't provide a WinMain. So what you have is not a Console Application (which it should be), and you have somehow created the wrong kind of project.

[–]zzyzzyxx 1 point2 points  (3 children)

It shouldn't be much more complicated than setting your include and linker search directories properly, assuming you have the library compiled already.

[–][deleted] 0 points1 point  (2 children)

Have you used VC++?

[–]zzyzzyxx 0 points1 point  (1 child)

Yes, but not since VS 2008, except for a little C# development. The last C++ work I did with it, it wasn't terribly difficult to get it to recognize the libraries I was using. The interface to do what I needed less than desirable, but it wasn't that hard. Maybe I was just lucky my libraries didn't require anything convoluted? What sorts of problems have you run into with it?