Public Group

# Does Dev C++ do windows?

This topic is 4869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
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

##### Share on other sites
Quote:
 Original post by VBStriderIs 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...?

##### Share on other sites
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.

##### Share on other sites
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?

##### Share on other sites
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.)

##### Share on other sites
Are you useing any files that end with .lib?? If so they will not work with Dev-C++. You need the .a files.

##### Share on other sites
Quote:
 Original post by jfclavetteIt 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.

##### Share on other sites
Quote:
 Original post by TaymoAre 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

##### Share on other sites
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

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 14
• 12
• 29
• 11
• 44
• ### Forum Statistics

• Total Topics
634855
• Total Posts
3019653
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!