Hello,
When compiling PoDoFo with Borland (nowadays Codegear) the following 25
adjustments have to be made:
9) Build PoDoFo
md PoDoFo-dll
cd PoDoFo-dll
cmake -G "Borland Makefiles" ..\podofo
-DCMAKE_INCLUDE_PATH=..\zlib;..\jpeg;..\freetype\include
-DCMAKE_LIBRARY_PATH=..\zlib;..\jpeg;..\freetype\objs
-DPODOFO_BUILD_SHARED=TRUE
9.01) Edit PdfVariant.h (error: call to undefined function floor)
Replace #include <cmath> with #include <math.h>
9.02) Edit PdfOutputDevice.h (error on FILE*):
#include <stdio.h>
9.03) Edit PdfDate.h (error on time_t):
#include <time.h>
9.04) Edit PdfColor.cpp (error on _stricmp, memcpy, islower):
#include <mem.h>
#include <ctype.h>
Replace "_stricmp" with "stricmp"
9.05) Edit PdfDate.cpp (error on snprintf):
#include <stdio.h>
9.06) Edit PdfDifferenceEncoding.cpp (error on snprintf):
#include <stdio.h>
9.07) Edit PdfInputStream.h (error on FILE*):
#include <stdio.h>
9.08) Edit PdfEncrypt.cpp (error on memcmp,memcpy
#include <mem.h>
Comment out in the MD5 part: //#include <sys/types.h>
9.09) Edit PdfField.cpp
void PdfCheckBox::SetChecked( bool bChecked )
{
m_pObject->GetDictionary().AddKey( PdfName("V"), (bChecked ?
PdfName("Yes") : PdfName("Off")) );
m_pObject->GetDictionary().AddKey( PdfName("AS"), (bChecked ?
PdfName("Yes") : PdfName("Off")) );
}
9.10) Edit PdfFiltersPrivate.cpp (error on memset,memcpy)
#include <mem.h>
9.11) Edit PdfFontMetrics.cpp (error on strncasecmp)
void PdfFontMetrics::SetFontTypeFromFilename( const char* pszFilename
)
Replace "#ifdef _MSC_VER" with "#ifdef _WIN32"
Replace "_strnicmp" with "strnicmp"
9.12) Edit PdfFontTTFSubset.cpp (error on _stricmp)
Replace "_stricmp" with "stricmp"
9.13) Edit PdfImage.cpp (error on "multiple declaration for 'boolean'",
strncasecmp)
In the top, adjust the inclusion of jpeglib.h
#ifdef PODOFO_HAVE_JPEG_LIB
#define XMD_H
#define HAVE_BOOLEAN
extern "C" {
#include "jpeglib.h"
}
#endif // PODOFO_HAVE_JPEG_LIB
Replace "#ifdef _MSC_VER" with "#ifdef _WIN32"
Replace "_strnicmp" with "strnicmp"
9.14) Edit PdfInputStream.cpp (error on memcpy)
#include <mem.h>
9.15) Edit PdfMemStream.cpp (error on memcpy)
#include <mem.h>
9.16) Edit PdfOutputDevice.cpp (error on memcpy)
#include <mem.h>
9.17) Edit PdfOutputStream.h (error on FILE*)
#include <stdio.h>
9.18) Edit PdfOutputStream.cpp (error on memcpy)
#include <mem.h>
9.19) Edit PdfParser.cpp (error on free)
Replace "#include <cstdlib>" with "#include <stdlib.h>"
9.20) Edit PdfRefCountedBuffer.cpp (error on memcpy,memcmp)
#include <mem.h>
9.21) Edit PdfRijndael.cpp (error on memcpy,memset)
#include <mem.h>
9.22) Edit PdfTable.h (error on memcpy)
#include <mem.h>
9.23) Edit PdfTokenizer.cpp (error on memset,isdigit, __FUNCTION__)
#include <mem.h>
#include <ctype.h>
Replace "__FUNCTION__" with "__FUNC__"
9.24) Edit test\PdfError_Test.cpp (error on printf)
#include <stdio.h>
9.25) Edit test\PdfString_Test.cpp (error on memcpy)
When opening this file the editor complains about codepage problems.
So adjust test\PdfTest.h and #include <mem.h>
9.26) BUILD:
make
Summarizing the problems for compiling with Borland (nowadays Codegear Rad
Studio):
1) When memcpy,memset or memcmp is used the #include <mem.h> is missing
2) Problems with _stricmp, _strnicmp and strncasecmp
"#ifdef _MSC_VER" is used in stead of "#ifdef _WIN32"
The _stricmp and _strnicmp functions should be strcmp and strnicmp
3) When snprintf or printf is used the #include <stdio.h> is missing
4) When islower or isdigit is used the #include <ctype.h> is missing
5) When FILE* structure is used the #include <stdio.h> is missing
6) When time_t structure is used the #include <time.h> is missing
7) The "floor" function is defined in math.h (and not <cmath>)
8) The 9.8 and 9.9 problems are real bugs.
9) The 9.13 problem with the LIBJPEG header was also a problem when
compiling with MinGW
I hope this can be fixed.
Regards,
Mirco
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users