0
0

Hi, I am trying to compile minifmod 1.6 using Visual C++ 6.0 without using the default libraries in order to minimize the executable size (otherwise its 30kb – hardly ‘mini’)
I was just wondering if anyone else has managed to do this (and may I have the source?), as I have tried a few times, and have not yet managed to get a fully working version.
Specifically I either get random noise, or I get an access violation in FSOUND_Mixer_FPU_Ramp, or the play procedure complains about “0x0badf00d”, or I get an access violation at some random place I can’t decipher.

Thanks.

  • You must to post comments
0
0

Hi, thanks for the quick reply, and sorry if I made it sound like minifmod isn’t one of the best bits of software I have come accross, because it is. :)

Anyway, when I compile an empty program (well builds a window and all that junk) it comes to around 4.5kb, then when I include minifmod it will jump to around 30k (or 28 – whichever).
Since I suspect this comes from including the standard libraries, and not the minifmod code, I wanted to try and include minifmod without them. (In fact when I compile without the standard libraries it jumps from 4.5kb to around 18kb – significantly smaller than 30kb, but then the program does not generate the right output, or crashes..)

Dont get me wrong, using UPX and getting 5kb is definately not still too big, its just that I >know< there is wasted space in there somewhere :)

As for my replacement routines, I suspect they are buggy, which is why I asked if anyone else has managed to do this.
Here they are anyway, in case anyone knows whats wrong:

[code:2oak2r8g]
//fix #1 – fltused

if defined (__cplusplus)

extern "C" {

endif

int _fltused;

if defined (__cplusplus)

};

endif

//fix #2 – calloc

include <windows.h>

void calloc(size_t num, size_t size) {
return GlobalAlloc(GMEM_FIXED|GMEM_ZEROINIT,num
size);
}
//fix #3 – free
void free(void *data) {
GlobalFree(data);
}
//fix #4 – ftol
int _ftol(float x) {
int y;
__asm {
fld DWORD PTR x
fistp DWORD PTR y
}
return y;
}
[/code:2oak2r8g]

  • You must to post comments
0
0

hi.. interesting topic :) i’m having troubles linking a project with nodefaultlib and minifmod. it still gives me unresolved external symbol [b:1361kue4]__ftol[/b:1361kue4] errors after i compiled minifmod.lib with [b:1361kue4]/QIfist[/b:1361kue4] (which, for those who don’t know, should suppress the use of _ftol).

[code:1361kue4]minifmod.lib(Fmusic.obj) : error LNK2001: Nichtaufgeloestes externes Symbol __ftol[/code:1361kue4]
__ftol appears in Fmusic.obj, music_formatxm.obj and Fsound.obj.

i could of course simply rewrite _ftol, but that shouldn’t be necessary when using /QIfist. can anyone tell me why _ftol is still referenced..? maybe i should take that to a general programming/vc forum, but since it’s with fmod, there are possibly other users on this forum that encountered similar problems and solved them.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.