Archived

This topic is now archived and is closed to further replies.

not using default libraries (visual c 6)

This topic is 5601 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi, for reasons that you dont want to worry about, I want to compile a program without the default libraries. Needless to say, when I do this I get a whole stack of errors. I cant seem to get anything working when I replace the functions, and I have gotten stuck on one function, which I am not too sure as to what it does. So, can anyone tell me if something is wrong with this:
//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;
}

And the one last thing I cant figure out is what "error LNK2001: unresolved external symbol __CIpow" is supposed to do. (Is this just supposed to be a normal power function? - (Ive tried this) ) Also, does someone know of a freely available implementation of the standard libraries (so I can use printf & fopen etc..) ? Thanks! EDIT: Also, does anyone know how to implement the functionality of __chkesp ? (I know you can disable /GZ, but that always makes the program crash) [edited by - aboeing on August 10, 2003 12:51:00 PM]

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5
khawk
14

• 9
• 11
• 11
• 23
• 12
• Forum Statistics

• Total Topics
633654
• Total Posts
3013168
×