[physfs] precompiled libraries

Kenneth Armstrong kenneth.l.armstrong at us.army.mil
Sat Feb 4 10:45:42 EST 2006


Kenneth Armstrong wrote:
> Ryan C. Gordon wrote:
>>
>>> I wouldn't even know where to begin to copy the files.  There are so 
>>> many of them.
>>
>> physfs.c
>> physfs.h
>> physfs_internal.h
>> platform/win32.c
>> archivers/*.c
>>
>> If you want .zip file support:
>> zlib123/*.c
>> zlib123/*.h
>>
>> And make sure these get #defined in your project files, depending on 
>> the archives you want:
>>
>> PHYSFS_SUPPORTS_ZIP
>> PHYSFS_SUPPORTS_GRP
>> PHYSFS_SUPPORTS_WAD
>> PHYSFS_SUPPORTS_QPAK
>> PHYSFS_SUPPORTS_HOG
>> PHYSFS_SUPPORTS_MVL
>>
>>
>> That should be it. Most of the crap in the source tree is support for 
>> various Unix build systems and don't have much to do with PhysicsFS 
>> specfically.
>>
>> --ryan.
>>
> Thanks a bunch, I'll give this a shot this afternoon!
>
> Kenny
Wow, I get all kinds of errors, here is my include list then my error log:

#ifdef __cplusplus
    #include <cstdlib>
#else
    #include <stdlib.h>
#endif
#include <SDL/SDL.h>
#include <physfs/physfs.h>
#include <physfs/physfs.c>
#include <physfs/physfs_internal.h>
#include <physfs/platform/win32.c>          // for windows support
#include <physfs/archivers/zip.c>           // for zip file support
#include <physfs/archivers/qpak.c>          // for qpak file support
#include <physfs/zlib123/adler32.c>
#include <physfs/zlib123/compress.c>
#include <physfs/zlib123/crc32.c>
#include <physfs/zlib123/deflate.c>
#include <physfs/zlib123/gzio.c>
#include <physfs/zlib234/infback.c>
#include <physfs/zlib123/inffast.c>
#include <physfs/zlib123/inflate.c>
#include <physfs/zlib123/inftrees.c>
#include <physfs/zlib123/trees.c>
#include <physfs/zlib123/uncompr.c>
#include <physfs/zlib123/zutil.c>
#inlcude <physfs/zlib123/crc32.h>
#include <physfs/zlib123/deflate.h>
#include <physfs/zlib123/inffast.h>
#include <physfs/zlib123/inffixed.h>
#include <physfs/zlib123/inflate.h>
#include <physfs/zlib123/inftrees.h>
#include <physfs/zlib123/trees.h>
#include <physfs/zlib123/zconf.h>
#include <physfs/zlib123/zlib.h>
#include <physfs/zlib123/zutil.h>

#define PHYSFS_SUPPORTS_ZIP     true
#define PHYSFS_SUPPORTS_QPAK    true



Compiling: main.cpp
In file included from main.cpp:8:
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`DirHandle* createDirHandle(const char*, const char*, int)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:585: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:585: error: 
(Each undeclared identifier is reported only once for each function it 
appears in.)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`int PHYSFS_mkdir(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1369: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`int PHYSFS_delete(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1412: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`const char* PHYSFS_getRealDir(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1433: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`void PHYSFS_enumerateFilesCallback(const char*, void (*)(void*, const 
char*), void*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1551: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`PHYSFS_sint64 PHYSFS_getLastModTime(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1595: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`int PHYSFS_isDirectory(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1624: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`int PHYSFS_isSymbolicLink(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1653: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`PHYSFS_File* doOpenWrite(const char*, int)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1680: error: 
`alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c: In function 
`PHYSFS_File* PHYSFS_openRead(const char*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:1738: error: 
`alloca' undeclared (first use this function)
In file included from main.cpp:10:
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:24:29: 
physfs_internal.h: No such file or directory
In file included from main.cpp:10:
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: At 
global scope:
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:58: 
error: redefinition of `char*userDir'
C:/Program Files (x86)/CodeBlocks/include/physfs/physfs.c:174: error: 
`char*userDir' previously defined here
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: In 
function `void __PHYSFS_platformEnumerateFiles(const char*, int, void 
(*)(void*, const char*), void*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:452: 
error: `alloca' undeclared (first use this function)
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: In 
function `int loadLibraries()':
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:677: 
error: invalid conversion from `void*' to `HINSTANCE__*'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:677: 
error:   initializing argument 1 of `int (* GetProcAddress(HINSTANCE__*, 
const CHAR*))()'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:688: 
error: invalid conversion from `void*' to `HINSTANCE__*'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:688: 
error:   initializing argument 1 of `BOOL FreeLibrary(HINSTANCE__*)'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: In 
function `int __PHYSFS_platformDeinit()':
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:717: 
error: invalid conversion from `void*' to `HINSTANCE__*'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:717: 
error:   initializing argument 1 of `BOOL FreeLibrary(HINSTANCE__*)'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: In 
function `int __PHYSFS_platformSeek(void*, PHYSFS_uint64)':
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:840: 
error: integer constant is too large for "long" type
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:858: 
error: invalid conversion from `DWORD*' to `LONG*'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:858: 
error:   initializing argument 3 of `DWORD SetFilePointer(void*, LONG, 
LONG*, DWORD)'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c: In 
function `PHYSFS_sint64 __PHYSFS_platformTell(void*)':
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:878: 
error: invalid conversion from `DWORD*' to `LONG*'
C:/Program Files (x86)/CodeBlocks/include/physfs/platform/win32.c:878: 
error:   initializing argument 3 of `DWORD SetFilePointer(void*, LONG, 
LONG*, DWORD)'
In file included from main.cpp:13:
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c: At 
global scope:
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:57: 
error: `uLong adler32' redeclared as different kind of symbol
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/zlib.h:1260: 
error: previous declaration of `uLong adler32(uLong, const Bytef*, uInt)'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:57: 
error: declaration of `uLong adler32'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/zlib.h:1260: 
error: conflicts with previous declaration `uLong adler32(uLong, const 
Bytef*, uInt)'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:57: 
error: `adler' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:57: 
error: `buf' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:57: 
error: `len' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:58: 
error: initializer expression list treated as compound expression
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:58: 
error: expected `,' or `;' before "uLong"
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:61: 
error: expected unqualified-id before '{' token
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:61: 
error: expected `,' or `;' before '{' token
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:128: 
error: `uLong adler32_combine' redeclared as different kind of symbol
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/zlib.h:1276: 
error: previous declaration of `uLong adler32_combine(uLong, uLong, long 
int)'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:128: 
error: declaration of `uLong adler32_combine'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/zlib.h:1276: 
error: conflicts with previous declaration `uLong adler32_combine(uLong, 
uLong, long int)'
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:128: 
error: `adler1' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:128: 
error: `adler2' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:128: 
error: `len2' was not declared in this scope
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:129: 
error: initializer expression list treated as compound expression
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:129: 
error: expected `,' or `;' before "uLong"
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:132: 
error: expected unqualified-id before '{' token
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/adler32.c:132: 
error: expected `,' or `;' before '{' token
In file included from main.cpp:14:
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/compress.c:22: 
error: `int compress2' redeclared as different kind of symbol
C:/Program Files (x86)/CodeBlocks/include/physfs/zlib123/zlib.h:1024: 
error: previous declaration of `int compress2(Bytef*, uLongf*, const 
Bytef*, uLong, int)'
Process terminated with status 1 (0 minutes, 2 seconds)
 

I downloaded the latest PhysFS file, and I haven't used any of the 
functions yet, I just wanted to see if would compile with all of my 
includes first.  My directories are correct, am I doing something wrong?



More information about the physfs mailing list