New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIBHPDF_EXAMPLES #104
Comments
Change HPDF_Boolean |
Type
So proper fix is probably to add |
It works for compilation of the library and probably for some samples. |
I solved the problem as you proposed: and for my case commented all redefined types in hpdf.h: #ifndef HPDF_EXPORT #include "hpdf_consts.h" //#ifndef _HPDF_OBJECTS_H #else Now it works, and solve as well additional issue, which I had with the including u3d (this one |
I'm not sure this "fix" is acceptable for upstream. There should be a reason for these type redefinitions. Maybe previous maintaner @tony2001 could answer this? |
Having the same issue here using Windows and MinGW. Not sure what the proper fix is for this problem. It seems the typedefs related to exported library functions should have been defined in one place rather than split accross hpdf.h and hpdf_objects.h. Any thoughts on how to proceed? |
After a little more poking around I see that HPDF_Boolean was introduced into hpdf.h by the commit large U3D-related patch by Michael Vidiassov made on Oct 30, 2013 by @tony2001. This seems to be the smoking gun rather than the typedefs @termi3 proposed in his fix. I believe the change @termi3 initially suggested is the correct fix. As @vdmit noted, HPDF_BOOL and HPDF_Boolean have different definitions, but looking at how the boolean "zoom" parameter is actually used in the offending HPDF_Page_CreateXObjectFromImage function suggests this is a valid change: From hdf_pages.c (line 680) if (zoom) { I propose changing the zoom parameter on HPDF_Page_CreateXObjectFromImage to HPDF_BOOL in both hpdf_pages.c and in hpdf.h. Any thoughts? |
…_BOOL to fix issue libharu#104 (LIBHPDF_EXAMPLES)
Thank you for fixing my error. |
@mvidiassov my pleasure. Thanks for your many contributions! |
@extensia - for me is your change OK. It seems I have not done correct my pull request for changing hpdf.h with the double definitions. I will try now again to create pull request |
While trying to test libHaru with Visual Studio, I came across this error when I activate LIBHPDF_EXAMPLES in cmake.
include\hpdf.h(464): error C2146: syntax error : missing ')' before identifier 'zoom'
include\hpdf.h(464): error C2081: 'HPDF_Boolean' : name in formal parameter list illegal
repeated often, probably for each example.
Intellisense tells me:
Error: Identifier "HPDF_Boolean" is undefined
I tested with CMake 2.8 and 3.2, and with Visual Studio 2012 and 2013.
I tried adding
#include "hpdf_objects.h"
in hpdf.h because HPDF_Boolean seems to be defined here, but now I have redefinition errors. I'm not actually a C programmer so I don't know how to fix that.The text was updated successfully, but these errors were encountered: