嗨我試圖在Windows 7上用MinGW編譯PoDoFo 0.9.2。我已成功編譯freetype2,OpenSSL和zlib。因爲我想創建一個64位應用程序,必須將MinGW x64編譯器設置爲cmake。所以我跑cmake的這樣在Windows上創建PoDoFo MinGW
cmake -G "MinGW Makefiles" -DCMAKE_C_COMPILER=c:/MinGW/x64/bin/gcc.exe -DCMAKE_RANLIB=c:/MinGW/x64/bin/ranlib.exe -DCMAKE_INSTALL_PREFIX=. -DPODOFO_NO_MULTITHREAD=TRUE -DCMAKE_RC_COMPILER=c:/MinGW/x64/bin/windres.exe -DCMAKE_MAKE_PROGRAM=c:/MinGW/x64/bin/mingw32-make.exe -DCMAKE_CXX_COMPILER=c:/MinGW/x64/bin/g++.exe -DCMAKE_INCLUDE_PATH=c:/MinGW/x64/include -DCMAKE_LIBRARY_PATH=c:/MinGW/x64/lib -DPODOFO_BUILD_STATIC=TRUE ..
,但我發現一些未知錯誤
CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at
C:/Users/Honza/Downloads/podofo-0.9.2/CMakeLists.txt:144:36
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at
C:/Users/Honza/Downloads/podofo-0.9.2/CMakeLists.txt:145:45
Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 4.7.2
-- The CXX compiler identification is GNU 4.7.2
-- Check for working C compiler: c:/MinGW/x64/bin/gcc.exe
-- Check for working C compiler: c:/MinGW/x64/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: c:/MinGW/x64/bin/g++.exe
-- Check for working CXX compiler: c:/MinGW/x64/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
WANT_LIB64 unset; assuming normal library directory names
Will install libraries to C:/Users/Honza/Downloads/podofo-0.9.2/build/lib
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for arpa/inet.h
-- Looking for arpa/inet.h - not found
-- Looking for winsock2.h
-- Looking for winsock2.h - found
-- Looking for mem.h
-- Looking for mem.h - found
-- Looking for ctype.h
-- Looking for ctype.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for BaseTsd.h
-- Looking for BaseTsd.h - found
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
Both PODOFO_BUILD_SHARED and PODOFO_BUILD_STATIC set
so disabling shared library generation (win32)
Using gcc specific compiler options
Have gcc 4.x
-- Found ZLIB: C:/Program Files/TortoiseGit/bin/zlib1.dll
Found zlib headers in c:/MinGW/x64/include, library at C:/Program Files/Tortoise
Git/bin/zlib1.dll
-- Found LIBCRYPTO: c:/MinGW/x64/lib/libcrypto.a
Found OpenSSL's libCrypto headers in c:/MinGW/x64/include, library at c:/MinGW/x
64/lib/libcrypto.a
-- Could NOT find LIBIDN (missing: LIBIDN_LIBRARY LIBIDN_INCLUDE_DIR)
Libidn not found. AES-256 Encryption support will be disabled
-- Could NOT find LIBJPEG (missing: LIBJPEG_INCLUDE_DIR)
libjpeg not found: Library c:/Program Files/Java/jre7/bin/jpeg.dll, headers LIBJ
PEG_INCLUDE_DIR-NOTFOUND
Libjpeg not found. JPEG support will be disabled
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
Libtiff not found. TIFF support will be disabled
CMake Warning (dev) at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/
FindPNG.cmake:34 (find_package):
File C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPNG.cmake
includes C:/Users/Honza/Downloads/podofo-0.9.2/cmake/modules/FindZLIB.cmake
(found via CMAKE_MODULE_PATH) which shadows C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/FindZLIB.cmake. This may cause errors later on
.
Policy CMP0017 is not set: Prefer files from the CMake module directory
when including from there. Run "cmake --help-policy CMP0017" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Call Stack (most recent call first):
CMakeLists.txt:349 (FIND_PACKAGE)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
LibPng not found. PNG support will be disabled
-- Ensure you cppunit installed version is at least 1.12.0
Cppunit not found. No unit tests will be built.
-- Found OpenSSL: c:/MinGW/x64/lib/libssl.a
Found freetype library at c:/MinGW/x64/lib/libfreetype.dll.a, headers c:/MinGW/x
64/include;c:/MinGW/x64/include
-- Could NOT find Fontconfig (missing: FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_
DIR)
-- Could NOT find Lua50 (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
-- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR)
Lua not found - PoDoFoImpose and PoDoFoColor will be built without Lua support
Building non multithreaded version of PoDoFo.
Building static PoDoFo library
CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
PNG_LIBRARY (ADVANCED)
linked by target "podofo_static" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/src
linked by target "ContentParser" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/ContentParser
linked by target "ContentParser" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/ContentParser
linked by target "CreationTest" in directory C:/Users/Honza/Downloads/podofo
-0.9.2/test/CreationTest
linked by target "CreationTest" in directory C:/Users/Honza/Downloads/podofo
-0.9.2/test/CreationTest
linked by target "DeviceTest" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/test/DeviceTest
linked by target "DeviceTest" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/test/DeviceTest
linked by target "FilterTest" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/test/FilterTest
linked by target "FilterTest" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/test/FilterTest
linked by target "FormTest" in directory C:/Users/Honza/Downloads/podofo-0.9
.2/test/FormTest
linked by target "FormTest" in directory C:/Users/Honza/Downloads/podofo-0.9
.2/test/FormTest
linked by target "ObjectParserTest" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/test/ObjectParserTest
linked by target "ObjectParserTest" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/test/ObjectParserTest
linked by target "ParserTest" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/test/ParserTest
linked by target "SignatureTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/SignatureTest
linked by target "SignatureTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/SignatureTest
linked by target "TokenizerTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/TokenizerTest
linked by target "TokenizerTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/TokenizerTest
linked by target "VariantTest" in directory C:/Users/Honza/Downloads/podofo-
0.9.2/test/VariantTest
linked by target "VariantTest" in directory C:/Users/Honza/Downloads/podofo-
0.9.2/test/VariantTest
linked by target "WatermarkTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/WatermarkTest
linked by target "WatermarkTest" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/test/WatermarkTest
linked by target "podofobox" in directory C:/Users/Honza/Downloads/podofo-0.
9.2/tools/podofobox
linked by target "podofocolor" in directory C:/Users/Honza/Downloads/podofo-
0.9.2/tools/podofocolor
linked by target "podofocountpages" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/tools/podofocountpages
linked by target "podofocrop" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/tools/podofocrop
linked by target "podofoencrypt" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/tools/podofoencrypt
linked by target "podofogc" in directory C:/Users/Honza/Downloads/podofo-0.9
.2/tools/podofogc
linked by target "podofoimgextract" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/tools/podofoimgextract
linked by target "podofoimg2pdf" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/tools/podofoimg2pdf
linked by target "podofomerge" in directory C:/Users/Honza/Downloads/podofo-
0.9.2/tools/podofomerge
linked by target "podofopages" in directory C:/Users/Honza/Downloads/podofo-
0.9.2/tools/podofopages
linked by target "podofopdfinfo" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/tools/podofopdfinfo
linked by target "podofotxt2pdf" in directory C:/Users/Honza/Downloads/podof
o-0.9.2/tools/podofotxt2pdf
linked by target "podofotxtextract" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/tools/podofotxtextract
linked by target "podofouncompress" in directory C:/Users/Honza/Downloads/po
dofo-0.9.2/tools/podofouncompress
linked by target "podofoimpose" in directory C:/Users/Honza/Downloads/podofo
-0.9.2/tools/podofoimpose
linked by target "podofoincrementalupdates" in directory C:/Users/Honza/Down
loads/podofo-0.9.2/tools/podofoincrementalupdates
linked by target "podofoxmp" in directory C:/Users/Honza/Downloads/podofo-0.
9.2/tools/podofoxmp
linked by target "helloworld" in directory C:/Users/Honza/Downloads/podofo-0
.9.2/examples/helloworld
linked by target "helloworld-base14" in directory C:/Users/Honza/Downloads/p
odofo-0.9.2/examples/helloworld-base14
-- Configuring incomplete, errors occurred!
See also "C:/Users/Honza/Downloads/podofo-0.9.2/build/CMakeFiles/CMakeOutput.log
".
See also "C:/Users/Honza/Downloads/podofo-0.9.2/build/CMakeFiles/CMakeError.log"
.
CMakeOutput.log conatins這http://pastebin.com/tBr5G4Mr
CMakeError.log包含此http://pastebin.com/rdYMFfKr
似乎PNG仍然需要構建的某些部分,而其他部分將被禁用。 – drescherjm
是CMake需要PNG庫,但它是CMake的錯誤。我從CMakeLists.txt中刪除了PNG檢查併成功創建了Makefile。但是在windres.exe unkonwn選項-W中建立停止時間爲65%。我發現它是2.8.3以後版本中的CMake錯誤。我已經安裝了CMake 2.8.3,現在一切正常,我有我的libpodofo.a :) – chatoooo