dev-c++

Started by
14 comments, last by nomichi 17 years, 10 months ago
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
Regards,nomichi
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.

- Jason Astle-Adams

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.
Regards,nomichi
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
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]
Regards,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]
Regards,nomichi
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.
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]
Regards,nomichi
Dev-C++ is an IDE (Integrated Development Enviroment) and can use variants of GCC like MinGW and Cygwin.
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.

This topic is closed to new replies.

Advertisement