Does Dev C++ do windows?

Started by
13 comments, last by Xpyder 18 years, 4 months ago
Hello, I've been programming in Dev-C++ in DOS for a couple of weeks, mostly doing problem solving programs, and have recently made the switch over to windows programming, specifically using "SAMS Teach yourself GAME PROGRAMMING in 24 Hours." Granted, not a smart choice on my part to try to learn windows programming through a game programming book, but its all I have available, and I did not feel like spending any more time on DOS. Plus learning how to program games is the step I would eventually like to end up at. But my problem is I keep having problems with Dev-C++ when trying to make very very very basic windows programs... like ones that just open a window. Whenever I use the examples in the CD, they work fine, so obviously Dev-C++ includes the windows.h library, but whenever I try to take out his code and stick in mine, it never works. I get errors like this:
Quote:[Linker error] undefined reference to `GameEngine::GameEngine(HINSTANCE__*, char*, char*, unsigned short, unsigned short, int, int)'
and
Quote:[Linker error] undefined reference to `TextOutA@20'
and I have no idea what these mean. By all accounts it should work, my GameEngine looks fine, all the headers and files are linking up right, but for some reason I always get that error. While we are on the subject, is there a good article on basic windows programming on the internet that I could use before trying this game programming that is way over my head?
Advertisement
Is this GameEngine part of a .lib file? If so, you may not be linking correctly.

It's kind of hard to know what is wrong without seeing the code. :/

VBStrider
Quote:Original post by VBStrider
Is this GameEngine part of a .lib file? If so, you may not be linking correctly.

It's kind of hard to know what is wrong without seeing the code. :/

VBStrider


Hows does one go about posting all my code? I could just put the folder somewhere...?
To be quite honest, the errors are pretty self-explanatory. It can't find the implementation of

GameEngine::GameEngine(HINSTANCE__*, char*, char*, unsigned short, unsigned short, int, int)

and of

TextOutA();

If those are functions you wrote yourself, make sure that the declaration and definition match. If those are library functions, make sure you are linking with the required libraries.




I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Could it have something to do with his executables? When I try to compile and run his examples, I get the above said errors, when I JUST run his examples, they work fine... I'm too new to apply logic to this, what could this mean?
It means that his example is using external libraries that you are not linking to. You need to link to those library in your project settings in order for it to link. (Those are linker errors, not compiler errors.)
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Are you useing any files that end with .lib?? If so they will not work with Dev-C++. You need the .a files.
Dev Journal - Ride the Spiralhttp://spiralride.blogspot.com/
Quote:Original post by jfclavette
It means that his example is using external libraries that you are not linking to. You need to link to those library in your project settings in order for it to link. (Those are linker errors, not compiler errors.)


I think some functions got lost in translation between the 3 headers and 2 source files that make up this oh so simple program. If I can't even figure out how to get a program that opens a window, that uses an engine, to run, then I think I need to go over what I've already been through. This book is very sketchy when it comes to the basics of windows programming, and if I don't start off on the right foot then I am royally screwed for the rest of my career. So I think I'll go get another book or find another article that is very precise and does a very good job explaining the basics. Could you possibly point me in the right direction?

P.S. Thanks for your help; I do get what you are saying, I just have no earthly idea how to go about fixing it.
Quote:Original post by Taymo
Are you useing any files that end with .lib?? If so they will not work with Dev-C++. You need the .a files.


No, none end with .lib
I think all the code works off of windows.h
I don't use Dev-C++ much, so I am unsure where it shows you the library files that it is linking to (if it is). If you could list off all the files from this particular example code's original folder (off the CD I am assuming), that may help us figure out what is wrong.

Oh, and a place where you can temporarily "paste" code is here: http://www.rafb.net/paste/

VBStrider


EDIT: Link fixed.

This topic is closed to new replies.

Advertisement