Jump to content
  • Advertisement
Sign in to follow this  
nomichi

dev-c++

This topic is 4567 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

So I'm going on a trip at the end of the month. I don't have a laptop so I borrowed one from my dad. It's a really old one so it's really slow and has like no space on it to install much of anything. Anyway, I put dev-c++ on it and downloaded the allegro devpack. I tried moving my project over from vs.net 2003. I set up an allegro project in dev-c++ and put all the .h and .cpp files in and tried to compile and I get a bunch of errors now. Stuff like no newline at end of file, linker errors etc. It seems allegro set up fine and all the errors have to do with it just not liking the way my code is set up. It compiles and runs fine in vs.net so I was wondering is this common for dev-c++ to find all kinds of different errors? This is my first time trying it out. On a side note, I'm looking for some simple little games that don't take up much room that I might fit on this piece of junk :P

Share this post


Link to post
Share on other sites
Advertisement
Yes, it's quite common to find small problems like that when moving a project from IDE to IDE (especially since you're also using different compilers there). You shouldn't find any that are a major difficulty to fix unless you've relied on some non-standard behavior provided by your compiler.

Just work through them (the errors), and if any of them are particularly difficult for you to figure out feel free to ask what might be the cause.

Share this post


Link to post
Share on other sites
Well the errors aren't the most descriptive. I get:

[Linker error] undefined reference to 'game'

about 6 times and then:

more undefined references to 'game' follow
Id returned 1 exit status

There are no line numbers or files listed. I guess it doesn't like the way I'm using externs. I have a CGame class and in main I create a global CGame object.
I list this as extern in my CMob class .cpp file so that the class can access the game object stuff. This worked fine in vs.net but apparently dev-c++ has issue with it. Am I doing something wrong here? I thought this was the right way to do it but my knowledge is still pretty limited.

Share this post


Link to post
Share on other sites
You don't want to be declaring things extern in a cpp file. You declare it extern in a header file that everything that uses it includes, then actually define it (without extern) in a cpp file somewhere.

Example

game.h

class Game
{
public:
Game(int State);
};

extern Game game;




game.cpp

Game game(42);




main.cpp

#include "game.h"

int main(whatever)
{
// use game;
}




HTH Paul

Share this post


Link to post
Share on other sites
Thanks EC. I think that is how I originally had it in VS but I was having problems with it. I'll try switching things over that way again and see what happens. [smile]

Share this post


Link to post
Share on other sites
Ok, I thought these were all errors but they are just warnings. I am able to run it and man is it slow on this laptop. I guess it will be good practice for performance tweaking? lol My little pacman moves slower than poo. It still says I'm getting 60fps though so maybe my fps code is wrong or something. [grin]

Share this post


Link to post
Share on other sites
Dev-C++ is the MinGW variant of GCC which is much more standards-compliant than VC++ although the later versions of VC++ are better than the earlier ones. This would explain all the warnings that MinGW is generating.

-edit- One more thing to check for is that some early graphics chips don't support alpha blending so make sure your overlays are using colorkey or 256-color mode to do the transparency blitting.

Share this post


Link to post
Share on other sites
Thanks for the info samuraicrow. I'm pretty sure my bitmaps are 256 color with the pink for masked blits. I think while I'm on vacation I will just rework the entire program and try to see what I can do to improve performance on such an old system. I think this thing is like a pentium 1 with 48 mb RAM hehe. According to device manager the video card is an S3 Aurora64V+. I'm gonna guess that's nothing spectacular. I wish I could afford a decent laptop so I wouldn't have to borrow this thing. [grin]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dev-C++ is an IDE (Integrated Development Enviroment) and can use variants of GCC like MinGW and Cygwin.

Share this post


Link to post
Share on other sites
Quote:
Original post by nomichi
Ok, I thought these were all errors but they are just warnings. I am able to run it and man is it slow on this laptop. I guess it will be good practice for performance tweaking? lol My little pacman moves slower than poo. It still says I'm getting 60fps though so maybe my fps code is wrong or something. [grin]


Get yourself a copy of FRAPS on the laptop and confirm the real fps. If your code is frame-based for movement speeds and you really are getting the same frame rate as before, you should be getting the same movement speed as before (Dr Obvious statement of the day). FRAPS is a dead easy and reliable way to find this out without messing about.

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.

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!