Please scroll to the bottom to list the updated short question
I am building PoDoFo. In the final step, I am using cmake to create the Visual Studio 2010 .sln file for PoDoFo. However when I build this solution file, it can't find header files of dependent libraries. For example, it doesn't find boost library header files.
c:\pdf\podofo-0.9.1\src\base\PdfDefines.h(66): fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory
If I disable boost, I get similar error for freetype library headers
2>..\..\src\doc\PdfFontCache.cpp(55): fatal error C1083: Cannot open include file: 'ft2build.h': No such file or directory
Here is my build.cmd file
del cmakecache.txt
set BOOST_ROOT=C:\pdf\boost_1_51_0_code
set BOOST_INCLUDE_DIR=C:\pdf\boost\boost_1_51_0\staging\include
set BOOSTLIBDIR=C:\workspace\lib\boost\boost_1_51_0\staging\lib
set FT_INCLUDE=C:\PDF\freetype-2.4.0\include\freetype
set FTDIR=C:\PDF\freetype-2.4.0\objs\win32\vc2008
set JPEGDIR=C:\PDF\jpeg-8d\Release\lib
set TIFDIR=C:\PDF\tiff-4.0.3\lib
set ZLIBDIR=C:\pdf\zlib-1.2.8
set BUILD_FLAGS="/MT"
cmake -G "Visual Studio 10" "C:\pdf\podofo-0.9.1" ^
-DCMAKE_CXX_FLAGS_RELEASE:STRING=%BUILD_FLAGS% ^
-DFREETYPE_INCLUDE_DIR=%FT_INCLUDE% ^
-DLIBJPEG_LIBRARY_RELEASE=jpeg ^
-DCMAKE_INCLUDE_PATH="%INCLUDE%;%BOOST_INCLUDE_DIR%;%FT_INCLUDE%;%FT_INCLUDE%\freetype;%JPEGDIR%\jpeg;%TIFDIR%\tiff;%ZLIBDIR%\zlib" ^
-DCMAKE_LIBRARY_PATH="%LIB%;%BOOSTLIBDIR%;%FTDIR%;%JPEGDIR%\lib;%TIFDIR%;%ZLIBDIR%\lib" ^
-DPODOFO_BUILD_SHARED:BOOL=FALSE ^
-DPODOFO_BUILD_STATIC:BOOL=TRUE ^
-DWANT_BOOST:BOOL=0 ^
-DLIBJPEG_LIBRARY_NAMES_RELEASE=jpeg ^
-DFREETYPE_LIBRARY_NAMES_RELEASE=freetype240MT ^
-DZLIB_LIBRARY_NAMES_RELEASE=zlibstat
I am new to CMake and I don't understand how the library dependencies carry through to the Visual Studio projects?.
Here is the screen shot of the paths in resulting solution file. I can't understand how these paths carry through from the small script file? They don't exactly correspond to DCMAKE_LIBRARY_PATH
so where they come from?
How can I fix these include errors in the solution file? I tried adding these paths to Project Properites >> VC++ Directories >> 'Include Directories' but it still doesn't want to build. I am afraid even if I eliminate these include errors, I will get linker errors because the library paths are probably incorrect too. How can I fix these error and get the project to build? Thanks.
Updated question
I fixed the include error by changing the path to:
FT_INCLUDE=C:\PDF\freetype-2.4.0\include\
Now as I expected, I get lots of linker errors. However I noticed that it did created PoDoFo.lib file so now I took the tast to use this in an example demo. I got that to compile as well successfully but I get the following linker errors:
1>podofo.lib(PdfFont.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfDifferenceEncoding.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfFontSimple.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfIdentityEncoding.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfFontTrueType.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfFontMetricsObject.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
1>podofo.lib(PdfEncodingObjectFactory.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
I did made sure the the dependent libraries are added in project settings along with paths but why do I still get these errors?