|
This thread is locked; no one can reply to it. |
1
2
|
My game doesn't starts on any computer :( |
LennyLen
Member #5,313
December 2004
|
Quote: I'm probably going to uninstall DevC++ and allegro then, because all of these weird problems I've had. I think that something maybe went wrong in the installation process of allegro. I have also heard that DevC++ compiler etc. is kind of otherwise and sometimes weird. While I personally dislike the Dev-C++ IDE, it's not the source of your problem. There are many people on this forum who use it regularly without experiencing any of the problems you describe. Based on this, and what you've said so far in this thread, it's more likely that the problem is simply that you have no idea what you are doing.
|
James Stanley
Member #7,275
May 2006
|
Do you have the allegro runtimes on the computers it doesn't work on? Try putting alleg42.dll in your executables directory. I don't know... |
LennyLen
Member #5,313
December 2004
|
@ _mEck0: Can you zip up and attach your code?
|
_mEck0
Member #7,650
August 2006
|
Yes, I can... I showed the game for my teacher, it was ok, but I must fix the problem so it executes on any computer... Maybe something is wrong with the paths. Thank you very much, I really appreciate your help, because this problem is very important for me. |
Indeterminatus
Member #737
November 2000
|
_mEck0, please see this. _______________________________ |
_mEck0
Member #7,650
August 2006
|
Quote: _mEck0, please see this [dashumankapital.net]. Okey, I understand that now. |
Tobias Dammers
Member #2,604
August 2002
|
I'll say it again: Real men don't need IDE's. Really, to learn programming, I can only advise to use nothing but a good editor and the command line. This way, you learn how to do things on your own; you'll understand what a compiler is, what a linker is, and what all those different file types (.cpp, .h, .o, .a, .dll, .exe, makefile) are for. You'll also learn to use proper coding style. Once you've gone through that hell and know what you're doing, then go and use an IDE to make your life easier (unless you like the amount of direct control the 'spartan's IDE' gives you). My personal choice is command line + SciTE. SciTE is basically an editor with syntax highlighting, a light app that starts quickly and doesn't use resources to do unnecessary fancy stuff, but it still has some rudimentary IDE functions like F7 to invoke make, and it understands g++ output so you can jump to the error directly. --- |
_mEck0
Member #7,650
August 2006
|
Thanks for the tips! |
piccolo
Member #3,163
January 2003
|
great choose msvs 2005 is nice but see if you can get your hands on msvs6 ,it has much more goodies to help you do flasher things with ease. and its is very stable;D wow |
Richard Phipps
Member #1,632
November 2001
|
Flames Tobias with a IDE +1 spell! |
LennyLen
Member #5,313
December 2004
|
Um... I thought you said you didn't use absolute paths: BITMAP* load_6 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_6.tga",palette); BITMAP* load_5 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_5.tga",palette); BITMAP* load_4 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_4.tga",palette); BITMAP* load_3 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_3.tga",palette); BITMAP* load_2 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_2.tga",palette); Your code also throws up several compiler warnings, some of which you shouldn't have ignored (I'm giving you the benefit of the doubt, and am hoping that the ones refering to unused BITMAPS are for as yet unimplimented features). And while I can get the code to eventually compile without warnings, it crashes immediately when I run it. You haven't implemented any error checking, and I'm not in the mood to add any to see if I can find out why it's crashing. Your program also needlessly includes "winalleg.h", and I think you need to ask your teacher what the purpose of header files is, as you have function declarations and defnitions scattered willy nilly through your source and header file. I second Tobias, learn how to program using just a text editor and the command line. Once you understand how things work, then start using more complicated tools like an IDE.
|
Michael Faerber
Member #4,800
July 2004
|
Quote: I second Tobias, learn how to program using just a text editor and the command line. Once you understand how things work, then start using more complicated tools like an IDE. However, I think that using the command line in Windows SUCKS. If commandline, then Linux. -- |
Tobias Dammers
Member #2,604
August 2002
|
Lenny, look out for the tiny blue monsters! Right, to the point: Go on, flame me. [edit] --- |
Richard Phipps
Member #1,632
November 2001
|
|
_mEck0
Member #7,650
August 2006
|
Quote: Um... I thought you said you didn't use absolute paths: BITMAP* load_6 = load_tga("C:/bilspel/RallyCross/Graphics/Splashscreen/load_6.tga",palette); These sentences I just wrote when I tested som stuff, because I don't have absolute paths on any other place in the code. Quote: Your program also needlessly includes "winalleg.h", and I think you need to ask your teacher what the purpose of header files is, as you have function declarations and defnitions scattered willy nilly through your source and header file. I'll accidently forgot to remove the include of winalleg.h. From start I wanted to make an win32 gui, but this programming course was pretty small so I didn't have much time to program. I just got one warning when I compile, but I'll take a look and try to fix it. Yes I know what a headerfile is, I have programmed before, but not anything "big" as this project, just small stuff we needed to do in school, and I haven't barely used allegro, so can you please explain what you mean by function declarations and definitions scattered willy nilly through the source code? I have programmed before, but I still see myself like a newbie (even I can a lot more then a "real" newbie who just started to code), so can you give an example what is wrong with my declarations and definitions? Actually this is the way I've learned to write from school. Because I want to correct and learn from my errors and by the way, everyone is a newbie from start and doesn't program like a more experienced programmer. It takes time to learn I'll remove the link to my project files now, but thanks for helping me. |
BAF
Member #2,981
December 2002
|
Once, again, ignore piccolo about MSVC 6. If you're actually interested in it, you can find more info, including on setting up Allegro, here MSVC Express is free. |
_mEck0
Member #7,650
August 2006
|
Okey, I understand. |
LennyLen
Member #5,313
December 2004
|
Quote: Actually this is the way I've learned to write from school. Then you either need new teachers, or to pay more attention. A header file should NOT include any funtion definitions, just declarations. If you're going to put them both into the same file, then you may as well just rename it .c/.cpp as it's a source file, not a header file. Try reading this: http://en.wikipedia.org/wiki/Header_file
|
_mEck0
Member #7,650
August 2006
|
Quote:
Quote: A header file should NOT include any funtion definitions, just declarations. If you're going to put them both into the same file, then you may as well just rename it .c/.cpp as it's a source file, not a header file. Try reading this: http://en.wikipedia.org/wiki/Header_file I can't remember that my teacher said that you shouldn't do so and when she looked at my source code, she didn't asked why I did so, probably she doesn't know it either (she doesn't have so much programming experience as far as I know). But I'm glad I've found this site so you guys can correct my mistakes Thanks for the link, I'll read that now and correct the fault in my code. |
Arthur Kalliokoski
Second in Command
February 2005
|
The reason you don't want functions declared in a header file is because the header file gets included into many .c/.cpp files. (or otherwise just put the #defines etc. in the one file unless it's for a library). BUT if you have a function in that header file, all the .c/.cpp files will all tell the linker that THEY have the one true function. So the linker complains that it can't tell which one to use or just picks one at random. Similarly you don't want to have variable names that are the same as function names (in C anyway) since compilers/linkers aren't smart enough all the time. They all watch too much MSNBC... they get ideas. |
_mEck0
Member #7,650
August 2006
|
Oh, I'm so happy now that it's indescribable I have fixed the bug which did that I couldn't execute my game on any computer! I copied the game-dir to a computer which I don't have allegro and DevC++ installed on, and it worked correctly, Windows doesn't search for dll-files anymore... I fixed some warnings (there is one left to fix), then I corrected som paths and I moved the functiondefinition (for the "settings"-function) from my headerfile to the main cpp-file, and that's it Thank you guys, without your tips and comments I don't think I've had fixed it so fast... |
Dragonsoulj
Member #7,678
August 2006
|
Granted it looks like this problem is solved, I would like to mention _mEck0 that Dev-C++ does have a debugger that does just as Tobias Dammers said: |
Tobias Dammers
Member #2,604
August 2002
|
Quote: So the linker complains that it can't tell which one to use or just picks one at random. The linker won't pick one at random - that would be just fine in most cases (except that it generates unnecessarily long compile times). It will complain that several distinct functions with identical signature exist. --- |
Matt Smith
Member #783
November 2000
|
Quote: It will complain that several distinct functions with identical signature exist. gcc link will not. It will always use the first one in the list of libs you give it. This is useful sometimes as it allows you to override functions in Allegro (e.g. you copy the Allegro function into your source file and add extra debugging code) |
CursedTyrant
Member #7,080
April 2006
|
Quote: So, I think I'll install Visual Studio 2005 Express instead and allegro to it, is it a good choice? Uhhh... no? Visual Studio is weird. I've been using Dev-Cpp for a few years before I switched to plain old Programmer's Notepad 2 and MinGW32 and never had any serious problems with it. --------- |
|
1
2
|