Thread: [Podofo-users] cmake -W flags in ADD_DEFINITION throw windres.exe
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
From: John L. P. <jlp...@gm...> - 2012-07-30 14:23:12
Attachments:
jlpoole56.vcf
|
I am trying to build podofo-0.9.1 on Windows 7 using MinGW32 (20120426). My MingGW was built by selecting the minimal install and not selecting any compiler, then installing the compilers from the mingw-w64project per the build recipe at http://ingar.satgnu.net/devenv/mingw32/base.html Here's what I do: cd /build32 tar zxf podofo-0.9.1.tar.gz mkdir podo-build cd podo-build cmake -G "MinGW Makefiles" ../podofo-0.9.1 \ -DCMAKE_INCLUDE_PATH=/local32/include \ -DCMAKE_LIBRARY_PATH=/local32/lib \ -DPODOFO_BUILD_SHARED:BOOL=FALSE \ -DZLIB_INCLUDE_DIR=/local32/bin \ -DZLIB_LIBRARY_NAMES=zlib1.dll \ -DFREETYPE_LIBRARY_NAMES=libfreetype-6.dll # # have to run twice as cmake objects to a sh.exe in the path # in empty directories. # cmake -G "MinGW Makefiles" ../podofo-0.9.1 \ -DCMAKE_INCLUDE_PATH=/local32/include \ -DCMAKE_LIBRARY_PATH=/local32/lib \ -DPODOFO_BUILD_SHARED:BOOL=FALSE \ -DZLIB_INCLUDE_DIR=/local32/bin \ -DZLIB_LIBRARY_NAMES=zlib1.dll \ -DFREETYPE_LIBRARY_NAMES=libfreetype-6.dll mingw32-make ... What happens is the build fails here: jlpoole@jlpoole-PC /build32/podo-build$ mingw32-make VERBOSE=1 C:\MinGW1\opt\bin\cmake.exe -HC:\MinGW1\build32\podofo-0.9.1 -BC:\MinGW1\build32\podo-build --check-build-system CMakeFiles\Makefile.cmake 0 C:\MinGW1\opt\bin\cmake.exe -E cmake_progress_start C:\MinGW1\build32\podo-build\CMakeFiles C:\MinGW1\build32\podo-build\CMakeFiles\progress.marks C:/MinGW1/mingw32/bin/mingw32-make -f CMakeFiles\Makefile2 all mingw32-make[1]: Entering directory `C:/MinGW1/build32/podo-build' C:/MinGW1/mingw32/bin/mingw32-make -f src\CMakeFiles\podofo_shared.dir\build.make src/CMakeFiles/podofo_shared.dir/depend mingw32-make[2]: Entering directory `C:/MinGW1/build32/podo-build' C:\MinGW1\opt\bin\cmake.exe -E cmake_depends "MinGW Makefiles" C:\MinGW1\build32\podofo-0.9.1 C:\MinGW1\build32\podofo-0.9.1\src C:\MinGW1\build32\podo-build C:\MinGW1\build32\podo-build\src C:\MinGW1\build32\podo-build\src\CMakeFiles\podofo_shared.dir\DependInfo.cmake --color= mingw32-make[2]: Leaving directory `C:/MinGW1/build32/podo-build' C:/MinGW1/mingw32/bin/mingw32-make -f src\CMakeFiles\podofo_shared.dir\build.make src/CMakeFiles/podofo_shared.dir/build mingw32-make[2]: Entering directory `C:/MinGW1/build32/podo-build' C:\MinGW1\opt\bin\cmake.exe -E cmake_progress_report C:\MinGW1\build32\podo-build\CMakeFiles 74 [ 1%] Building RC object src/CMakeFiles/podofo_shared.dir/doc/podofo-doc.rc.obj cd /d C:\MinGW1\build32\podo-build\src && C:\MinGW1\mingw32\bin\windres.exe -O coff -IC:\MinGW1\local32\include -IC:\MinGW1\local32\bin -IC:\MinGW1\build32\podo-build -IC:\MinGW1\build32\podofo-0.9.1 -IC:\MinGW1\build32\podofo-0.9.1\src -IC:\MinGW1\local32\include\freetype2 -IC:\MinGW1\build32\podofo-0.9.1\vcincludes -Wall -Woverloaded-virtual -Wswitch-enum -Wcast-qual -Wwrite-strings -Wredundant-decls -Wreorder -Wold-style-cast -DBUILDING_PODOFO -Dpodofo_shared_EXPORTS -D_CRT_SECURE_NO_DEPRECATE C:\MinGW1\build32\podofo-0.9.1\src\doc\podofo-doc.rc CMakeFiles\podofo_shared.dir\doc\podofo-doc.rc.obj C:\MinGW1\mingw32\bin\windres.exe: invalid option -- W Usage: C:\MinGW1\mingw32\bin\windres.exe [option(s)] [input-file] [output-file] The options are: -i --input=<file> Name input file -o --output=<file> Name output file -J --input-format=<format> Specify input format -O --output-format=<format> Specify output format -F --target=<target> Specify COFF target --preprocessor=<program> Program to use to preprocess rc file --preprocessor-arg=<arg> Additional preprocessor argument -I --include-dir=<dir> Include directory when preprocessing rc file -D --define <sym>[=<val>] Define SYM when preprocessing rc file -U --undefine <sym> Undefine SYM when preprocessing rc file -v --verbose Verbose - tells you what it's doing -c --codepage=<codepage> Specify default codepage -l --language=<val> Set language when reading rc file --use-temp-file Use a temporary file instead of popen to read the preprocessor output --no-use-temp-file Use popen (default) -r Ignored for compatibility with rc @<file> Read options from <file> -h --help Print this help message -V --version Print version information FORMAT is one of rc, res, or coff, and is deduced from the file name extension if not specified. A single file name is an input file. No input-file is stdin, default rc. No output-file is stdout, default rc. C:\MinGW1\mingw32\bin\windres.exe: supported targets: pe-i386 pei-i386 elf32-i386 elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex mingw32-make[2]: *** [src/CMakeFiles/podofo_shared.dir/doc/podofo-doc.rc.obj] Error 1 mingw32-make[2]: Leaving directory `C:/MinGW1/build32/podo-build' mingw32-make[1]: *** [src/CMakeFiles/podofo_shared.dir/all] Error 2 mingw32-make[1]: Leaving directory `C:/MinGW1/build32/podo-build' mingw32-make: *** [all] Error 2 jlpoole@jlpoole-PC /build32/podo-build$ An entry from the cmake bug database states: add_definitions() should only be used to add preprocessor defines (-D or /D flag), not compiler flags. See http://www.cmake.org/Bug/view.php?id=12871 In fact, the podofo project has in its zip file, /CMakeLists.txt at line 279: ============ START 279 /CMakeLists.txt ===================== ADD_DEFINITIONS( -Wall -Woverloaded-virtual -Wswitch-enum -Wcast-qual -Wwrite-strings -Wredundant-decls -Wreorder -Wold-style-cast ) ============ END ===================== What is the best way to overcome the problem I encountered with windres.exe? I tried various hacks such as removing the -W flags (and it compiles fine, but then I runto a problem with the <cstddef> being unrecognized in PdfCompilerCompat.h ), but thought it best to present this issue up to this stage to see what recommendations come forth. Should I log a bug? John |
From: Ryan <ur...@ho...> - 2012-07-30 20:58:58
|
> I am trying to build podofo-0.9.1 on Windows 7 using MinGW32 (20120426). > What is the best way to overcome the problem I encountered with > windres.exe? H John, What version of cmake are you using? You must use 2.8.3 or earlier as there is a bug in later versions Cheers, Ryan |
From: John L. P. <jlp...@gm...> - 2012-07-31 19:40:23
Attachments:
jlpoole56.vcf
|
On 7/30/2012 1:58 PM, Ryan wrote: >> I am trying to build podofo-0.9.1 on Windows 7 using MinGW32 (20120426). >> What is the best way to overcome the problem I encountered with >> windres.exe? > H John, > > What version of cmake are you using? You must use 2.8.3 or earlier as there > is a bug in later versions > > Cheers, > Ryan > Ryan, Can you provide a bit more information about the bug you reference? As I indicated in my last response, the build was successful when I downgraded cmake to 2.8.3. The problem I now face is that other dependencies require a later version of cmake so I'd like to get a better understanding of what bug in cmake is breaking Podofo. My initial post to this forum was about including "-W" in ADD_DEFINITIONS when it appears "-W" may not be appropriate. My previous reply was sent in HTML format and does not readily appear in the Archive, so I'll restate it here: I followed your advice and installed 2.8.3 and I successfully built and installed the Podofo project. Wow. Thank you very much. Again, thank you. John |
From: Ryan <ur...@ho...> - 2012-08-02 13:01:05
|
Just realised I didn't post this to the list. > Can you provide a bit more information about the bug you reference? I could not find where I initially got the information about the bug, and after a bit of searching it appears that you are be correct about the wrong use of ADD_DEFINITIONS. Cmake 2.8.3 and earlier were silently ignoring .rc files, thus the error never showed up. AFAICT the .rc file is just used to add version information, so the simplest hack to get things working is just to comment it out of src\CMakeLists.txt (line 107). I have no idea why it can't find the includes for the .rc file Ryan |