Jump to content
  • Advertisement
Sign in to follow this  
KingSatchmo

Does Dev C++ do windows?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...?

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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


EDIT: Link fixed.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!