When I compile common/unzip.cpp, the compiler does not complain that there is any .h missing, however it fails to recognize the symbols "voidp", "uInt", and a few other custom types.
Where should they be declared? Where do they come from?
In zlib maybe?
[SOLVED] Conflict: common/zlib.h , SCUMMVM_LIBS/include
Moderator: ScummVM Team
-
- Posts: 80
- Joined: Fri Oct 19, 2007 5:48 pm
[SOLVED] Conflict: common/zlib.h , SCUMMVM_LIBS/include
Last edited by monsieurouxx on Thu Jan 20, 2011 11:41 am, edited 1 time in total.
Re: Cannot compile common/unzip.cpp
In case you have zlib installed they should be defined inside zconf.h (which is included by zlib.h). In case you do not have zlib installed they are defined right inside common/unzip.cpp. Of course in the latter case you might not be able to use the .zip themes anymore.monsieurouxx wrote:When I compile common/unzip.cpp, the compiler does not complain that there is any .h missing, however it fails to recognize the symbols "voidp", "uInt", and a few other custom types.
Where should they be declared? Where do they come from?
In zlib maybe?
-
- Posts: 80
- Joined: Fri Oct 19, 2007 5:48 pm
Re: Cannot compile common/unzip.cpp
LordHoto wrote:Hmmm, that's weird, because the compiler doesn't use either definitions.monsieurouxx wrote: In case you have zlib installed they should be defined inside zconf.h (which is included in zlib.h). In case you do not have zlib installed they are defined right inside common/unzip.cpp.
I noticed there is a #if to decide what inclusions to make.
If the relevant compilation variable is not defined automatically by create_project, then I don't know which one(s) it should be...
Re: Cannot compile common/unzip.cpp
I think by default create_project sets the ZLIB feature to enabled, thus it should define "USE_ZLIB" and thus the code should include <zlib.h> and thus it should take the definition from zconf.h. You just might want to check that there is a proper uInt typedef in zconf.h.monsieurouxx wrote:Hmmm, that's weird, because the compiler doesn't use either definitions.LordHoto wrote: In case you have zlib installed they should be defined inside zconf.h (which is included in zlib.h). In case you do not have zlib installed they are defined right inside common/unzip.cpp.
I noticed there is a #if to decide what inclusions to make.
If the relevant compilation variable is not defined automatically by create_project, then I don't know which one(s) it should be...
-
- Posts: 80
- Joined: Fri Oct 19, 2007 5:48 pm
Re: Cannot compile common/unzip.cpp
Super useful tip, thanks.LordHoto wrote:"USE_ZLIB"
I'll try it as soon as possible.
Re: Cannot compile common/unzip.cpp
create_project should do that for you, theoretically it should set USE_ZLIB on its own by defaultmonsieurouxx wrote:Super useful tip, thanks.LordHoto wrote:"USE_ZLIB"
I'll try it as soon as possible.
-
- Posts: 80
- Joined: Fri Oct 19, 2007 5:48 pm
Re: Cannot compile common/unzip.cpp
EDIT: see next post
Last edited by monsieurouxx on Thu Jan 20, 2011 10:55 am, edited 1 time in total.
-
- Posts: 80
- Joined: Fri Oct 19, 2007 5:48 pm
I've found the cause:
There's a conflict between <scummvm>/common/zlib.h and SCUMMVM_LIBS/include/zlib.h
It's caused by the fact that both folders are included in the search path of the compiler by create_project.
Since zlib.h is included with the command #include <zlib.h>, there is an ambiguity -- unproperly resolved by the compiler.
EDIT: It's solved simply by reverting the search directories (that is by moving SCUMMVM_LIBS/include hihgher than ../../common in the list of the IDE )
If it's confirmed, that should be changed in create_project.
I haven't had the opportunity to see if it does it in a MSVC project too. It's the nightly build (obviously, since ScummVM 1.2.1 doesn't use create_project).[/b]
There's a conflict between <scummvm>/common/zlib.h and SCUMMVM_LIBS/include/zlib.h
It's caused by the fact that both folders are included in the search path of the compiler by create_project.
Since zlib.h is included with the command #include <zlib.h>, there is an ambiguity -- unproperly resolved by the compiler.
EDIT: It's solved simply by reverting the search directories (that is by moving SCUMMVM_LIBS/include hihgher than ../../common in the list of the IDE )
If it's confirmed, that should be changed in create_project.
I haven't had the opportunity to see if it does it in a MSVC project too. It's the nightly build (obviously, since ScummVM 1.2.1 doesn't use create_project).[/b]