Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
super charlie
Baaaaa!
Baaaaa!
Posts: 1809
Joined: Wed Mar 31, 2004 7:53 pm 0
Location: Ipswich, suffolk
Contact:

Re: Show us yer programming projects!

Post by super charlie »

Some more images from my latest project. starting to come together properly now, just need some more interfacy bits and it won't be far off gameplay wise...


Image

Image

Cheers
Charlie
Visit my website here to have a look at my game.
User avatar
tufty
Sheepie Whore
Sheepie Whore
Posts: 12525
Joined: Fri Jan 07, 2005 4:52 pm 0
Location: French Alps

Re: Show us yer programming projects!

Post by tufty »

That looks well mental. Attack of the T-Nuts?
"massive retard™", "full of shit™", "tiny bitch™", "retarted™", "a bit of a one trick pony™", "petty™", "simple minded idealistic twat™", "miserable humourless fucker™"
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

KlaxonCow wrote:
nyogtha993 wrote:Anyway, here it is:
http://rapidshare.com/files/139143321/B ... -21-08.rar
I can't get it to work.

WinRAR is convinced that it's a corrupt archive and won't extract it at all. 7zip will read it and extract the files, but the EXE file won't run because Windows says that it's "invalid" (although, the graphics and sound files in the "data" folder all seem to be just fine).

It looks like whatever program you've used to RAR up the files has cocked it up and created a bad archive there. :(
Um...it's worked on 3 different computers for me, I archived it with WinRAR.
User avatar
nyarla
Baaaaaa!
Baaaaaa!
Posts: 2820
Joined: Tue Jan 14, 2003 1:53 pm 0
Location: i said kiss me you're beautiful these are truly the last days
Contact:

Re: Show us yer programming projects!

Post by nyarla »

nyogtha993 wrote:
KlaxonCow wrote:
nyogtha993 wrote:Anyway, here it is:
http://rapidshare.com/files/139143321/B ... -21-08.rar
I can't get it to work.

WinRAR is convinced that it's a corrupt archive and won't extract it at all. 7zip will read it and extract the files, but the EXE file won't run because Windows says that it's "invalid" (although, the graphics and sound files in the "data" folder all seem to be just fine).

It looks like whatever program you've used to RAR up the files has cocked it up and created a bad archive there. :(
Um...it's worked on 3 different computers for me, I archived it with WinRAR.
Hmm.. winRAR extracts it fine here, but the .exe won't run.. I get:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

(I'm running XP)... Could it be that it needs some extra library or something which I don't have, and isn't included?

PS welcome to YakYak :)
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: Show us yer programming projects!

Post by KlaxonCow »

nyarla wrote:
nyogtha993 wrote:
KlaxonCow wrote:I can't get it to work.

WinRAR is convinced that it's a corrupt archive and won't extract it at all. 7zip will read it and extract the files, but the EXE file won't run because Windows says that it's "invalid" (although, the graphics and sound files in the "data" folder all seem to be just fine).

It looks like whatever program you've used to RAR up the files has cocked it up and created a bad archive there. :(
Um...it's worked on 3 different computers for me, I archived it with WinRAR.
Hmm.. winRAR extracts it fine here, but the .exe won't run.. I get:

"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

(I'm running XP)... Could it be that it needs some extra library or something which I don't have, and isn't included?
I've got a somewhat ancient copy of winRAR - I don't normally use it ordinarily, but it's (unsurprisingly) the default association for RAR files - which might explain the corrupt archive thing I was getting, as 7zip had no problems extracting it. I guess I misdiagnosed the problem there.

Otherwise, what you describe sounds exactly like what I was getting. Also running XP.
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
nyarla
Baaaaaa!
Baaaaaa!
Posts: 2820
Joined: Tue Jan 14, 2003 1:53 pm 0
Location: i said kiss me you're beautiful these are truly the last days
Contact:

Re: Show us yer programming projects!

Post by nyarla »

Yeah, sounds right... I believe winrar 2.x and earlier won't open winrar 3.x rars.
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

Hmm. I'm using Allegro with this game, so that could be why you're getting these errors, Allegro may not be installed on your system.
User avatar
nyarla
Baaaaaa!
Baaaaaa!
Posts: 2820
Joined: Tue Jan 14, 2003 1:53 pm 0
Location: i said kiss me you're beautiful these are truly the last days
Contact:

Re: Show us yer programming projects!

Post by nyarla »

Looks like there are two Allegro dlls included in the RAR, alleg42.dll and alfont.dll, so that shouldn't be the problem..

I tried running it from command prompt and it said "The system cannot execute the specified program" (I guess that's the "dos" version of the other error message we were getting)...

Googled for it, and found a page saying that programs compiled with Visual Studio SP1 will not run on XP SP2, and will give that error... you using SP1? I am using XP SP2.

Another page says that it could be that we are lacking some dependent Visual C++ libs.

I dunno anything about Visual Studio...maybe we need the .NET framework or something? I don't think I have that installed currently....
User avatar
evilpaul
Baaaa!
Baaaa!
Posts: 811
Joined: Wed Sep 29, 2004 2:01 pm 0
Location: #ukscene, helsinki branch
Contact:

Re: Show us yer programming projects!

Post by evilpaul »

I had (possibly) the same problem today:

An exe built with Visual Studio 2008 would not run on a machine that didn't have the same version of VS installed. Reason? VS projects seem to build against the DLL versions of the runtime libraries by default, and these aren't included in a standard Windows installation. Solution? Change the project to use the statically linked version instead. Look in Project Settings -> C/C++ -> Code Generation -> Runtime Library.
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

evilpaul wrote:I had (possibly) the same problem today:

An exe built with Visual Studio 2008 would not run on a machine that didn't have the same version of VS installed. Reason? VS projects seem to build against the DLL versions of the runtime libraries by default, and these aren't included in a standard Windows installation. Solution? Change the project to use the statically linked version instead. Look in Project Settings -> C/C++ -> Code Generation -> Runtime Library.
Ah, perfect! Thanks. I'm working on it right now.
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

Problem solved! Not only that, but now it works on Vista. Uploading new version now...
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: Show us yer programming projects!

Post by KlaxonCow »

Still not working for me.

Checking out the EXE's imports, it has external dependencies on "alleg42.dll", "alfont.dll", "fmod.dll", "MSVCP80.dll" and "MSVCR80.dll" (plus, of course, "KERNEL32.dll" - but we can overlook that)..

The first three DLLs are okay - "alleg42.dll", "alfont.dll" and "fmod.dll" - because you've bundled the DLLs along with your program.

But you've still got dependencies on the dynamic C run-time - "MSVCP80.dll" and "MSVCR80.dll" - which aren't necessarily on everyone's system, and you're not supplying the "redistributable" DLL files with your program.

(Unfortunately, Microsoft have made supplying the redistributable DLLs a bit awkward and complicated, for security reasons. You can't just dump the DLL files in the program folder - you need "assemblies" and "manifests" and to put it in a folder with the right name in the right place and other such bollocks.

The fact that this hasn't been done correctly is what's generating the "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem." error message. Your program has an "assembly" at the end looking for these files (note that, in fact, you can see this by just dropping your program into Notepad and scrolling to the end - the stuff dealing with "assemblies" is actually tacked on as plain text at the end, so it's perfectly readable. Wich is handy if you want to check whether it's right or not. For example, using this method, I could see that your first upload was linked against the debug DLLs rather than the release DLLs. Whoops) and when they can't be found this is what it means by "the application configuration is incorrect").

If you're interested in that, then scroll down to the "deployment" section at the bottom of this Allegro Wiki page:

http://wiki.allegro.cc/index.php?title= ... press_2005

...and there's a basic explanation of what you need to do. Note that you have to compile your program against the release libraries and not the debug libraries, because Microsoft do not permit the redistribution of the debug DLLs.)

Mind you, I have tried installing these "redistributable" files myself and it still doesn't seem to work, even then.

The simplest and best thing to do is just link the C run-time into your program statically (i.e. compile the needed routines directly into the EXE itself, so that you don't need any external DLL files).

Note that, technically (and slightly ironically), if you're "redistributing" the DLL files with your program, which are version-specific (as the MSVC DLL files are - because they rename them with each new version, e..g MSVC70.dll, MSVC80.DLL, etc.), then this actually completely undermines the whole point of using dynamic libraries in the first place. Nice one, Microsoft!

It doesn't make your download any smaller. It, in fact, makes it bigger. Because when you statically link the routines into your program, then only the needed routines get compiled in. But when you package the redistributable DLLs along with your program, these DLL files contain ALL the C run-time routines, whether you need them or not.

And the other advantage of DLL files - which is that you can upgrade them without re-compiling and re-packaging all your programs - is negated by the fact that Microsoft fail miserably to maintain proper "backwards compatibility", and rename the DLL files every time they substantially upgrade them anyway (e.g. MSVC60.DLL, MSVC70.DLL, MSVC80.DLL, etc.), then that benefit is implicitly lost too. Because the version number is stuck into the filename itself - they are different DLLs and if your program links to "MSVC80.DLL" then it's stuck linked to version 8 forever.

Indeed, all Microsoft's naming policy does is actually mean that you need shitloads of what is essentially the same DLL (just with minor improvements, extra routines and the odd redesign) clogging up your system. It completely flies in the face of what the purpose and benefits of using shared libraries are supposed to be.

Thus, due to Microsoft's bizarre "let's undermine our own design" policy, you're basically gaining nothing beneficial. Only gaining larger download sizes, more "bloat" on your system as you have to install what's essentially the same DLL file multiple times to cope with all the different "version numbers" that your programs could potentially be using and, of course, the ever-present problem that it could all go tits up when the user doesn't have the right DLLs on their system and you're plunged into "DLL Hell".

The theory of shared libraries is good, when done right. But Microsoft insist on constantly doing it wrong.

They need a built-in system installer - which checks dependencies and fetches "redistributables" when they're not present. You know, like what most *NIXen do these days.

Anyway, yes, you've not statically linked in the libraries properly, by the looks of things, as there are still external dependencies on "MSVCP80.dll" and "MSVCR80.dll" in your program's import table.

But if you can sort that out properly, then static linking will solve the problem because all the necessary code will simply just be compiled into the EXE itself - so zero problems with things being missing on different machines from that point forth (albeit with a larger EXE size - but if you're going to be bundling "redistributables" with your program instead, that'll end up being no smaller and potentially much larger again).

You might want to look into getting yourself a utility like "DumpPE" (or maybe a debugger that has similar functionality - listing the dependent DLLs and imports / exports from the program's headers) to verify that when you ask for "static", that's what it's actually given you.

Libraries can be a pain in the arse sometimes, eh? :wink:
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

Heh, you think? Anyway, looks like I have a bit of work to do now.
nyogtha993
Posts: 13
Joined: Thu Aug 21, 2008 9:29 pm 0

Re: Show us yer programming projects!

Post by nyogtha993 »

Well, you were much more helpful than any of the websites I was going to before! Anyway, I used the DLL deployment method found at the bottom of the page you linked me. Everything's in there now, so do you think it should work? I might as well know before I start posting more links.
Post Reply