I'm trying ot build a podofo library and it gets up to 65% and the below error occures.
The entire code snipped is below. Not sure what this means or the faintest idea on how to fix it.
Basically I've generated a makefile with CMAKE and tried to bild the library with mingw32-make in the command line. I've attached the Makefile for reference too.

Any clues how to attack the below error? Thanks

C:\CodeBlocks\MinGW\bin\windres.exe: invalid option -- W
    Usage: C:\CodeBlocks\MinGW\bin\windres.exe [option(s)] [input-file] [output-file]





[ 65%] Building RC object src/CMakeFiles/podofo_static.dir/doc/podofo-doc.rc.obj

C:\CodeBlocks\MinGW\bin\windres.exe: invalid option -- W
Usage: C:\CodeBlocks\MinGW\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
  -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:\CodeBlocks\MinGW\bin\windres.exe: supported targets: pe-i386 pei-i386 elf32-i
386 elf32-little elf32-big srec symbolsrec tekhex binary ihex
mingw32-make[2]: *** [src/CMakeFiles/podofo_static.dir/doc/podofo-doc.rc.obj] Er
ror 1
mingw32-make[2]: Target `src/CMakeFiles/podofo_static.dir/build' not remade beca
use of errors.
mingw32-make[1]: *** [src/CMakeFiles/podofo_static.dir/all] Error 2
mingw32-make[1]: Target `all' not remade because of errors.
mingw32-make: *** [all] Error 2

Edited 4 Years Ago by daino

Attachments
# CMAKE generated file: DO NOT EDIT!
# Generated by "MinGW Makefiles" Generator, CMake Version 2.8

# Default target executed when no arguments are given to make.
default_target: all
.PHONY : default_target


#=============================================================================
# Special targets provided by cmake.

# Disable implicit rules so canonical targets will work.
.SUFFIXES:

# Remove some rules from gmake that .SUFFIXES does not remove.
SUFFIXES =




.SUFFIXES: .hpux_make_needs_suffix_list

# Suppress display of executed commands.
$(VERBOSE).SILENT:

# A target that is always out of date.
cmake_force:
.PHONY : cmake_force

#=============================================================================
# Set environment variables for the build.

SHELL = cmd.exe

# The CMake executable.
CMAKE_COMMAND = "C:\Program Files\CMake 2.8\bin\cmake.exe"

# The command to remove a file.
RM = "C:\Program Files\CMake 2.8\bin\cmake.exe" -E remove -f

# Escaping for special characters.
EQUALS = =

# The program to use to edit the cache.
CMAKE_EDIT_COMMAND = "C:\Program Files\CMake 2.8\bin\cmake-gui.exe"

# The top-level source directory on which CMake was run.
CMAKE_SOURCE_DIR = C:\podofo-0.9.1

# The top-level build directory on which CMake was run.
CMAKE_BINARY_DIR = C:\podofo-0.9.1\podofo-debug

#=============================================================================
# Targets provided globally by CMake.

# Special rule for the target edit_cache
edit_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
	"C:\Program Files\CMake 2.8\bin\cmake-gui.exe" -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : edit_cache

# Special rule for the target edit_cache
edit_cache/fast: edit_cache
.PHONY : edit_cache/fast

# Special rule for the target install
install: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	"C:\Program Files\CMake 2.8\bin\cmake.exe" -P cmake_install.cmake
.PHONY : install

# Special rule for the target install
install/fast: preinstall/fast
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
	"C:\Program Files\CMake 2.8\bin\cmake.exe" -P cmake_install.cmake
.PHONY : install/fast

# Special rule for the target install/local
install/local: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
	"C:\Program Files\CMake 2.8\bin\cmake.exe" -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local

# Special rule for the target install/local
install/local/fast: install/local
.PHONY : install/local/fast

# Special rule for the target install/strip
install/strip: preinstall
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
	"C:\Program Files\CMake 2.8\bin\cmake.exe" -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip

# Special rule for the target install/strip
install/strip/fast: install/strip
.PHONY : install/strip/fast

# Special rule for the target list_install_components
list_install_components:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components

# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast

# Special rule for the target rebuild_cache
rebuild_cache:
	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
	"C:\Program Files\CMake 2.8\bin\cmake.exe" -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
.PHONY : rebuild_cache

# Special rule for the target rebuild_cache
rebuild_cache/fast: rebuild_cache
.PHONY : rebuild_cache/fast

# The main all target
all: cmake_check_build_system
	$(CMAKE_COMMAND) -E cmake_progress_start C:\podofo-0.9.1\podofo-debug\CMakeFiles C:\podofo-0.9.1\podofo-debug\CMakeFiles\progress.marks
	$(MAKE) -f CMakeFiles\Makefile2 all
	$(CMAKE_COMMAND) -E cmake_progress_start C:\podofo-0.9.1\podofo-debug\CMakeFiles 0
.PHONY : all

# The main clean target
clean:
	$(MAKE) -f CMakeFiles\Makefile2 clean
.PHONY : clean

# The main clean target
clean/fast: clean
.PHONY : clean/fast

# Prepare targets for installation.
preinstall: all
	$(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall

# Prepare targets for installation.
preinstall/fast:
	$(MAKE) -f CMakeFiles\Makefile2 preinstall
.PHONY : preinstall/fast

# clear depends
depend:
	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles\Makefile.cmake 1
.PHONY : depend

#=============================================================================
# Target rules for targets named uninstall

# Build rule for target.
uninstall: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 uninstall
.PHONY : uninstall

# fast build rule for target.
uninstall/fast:
	$(MAKE) -f CMakeFiles\uninstall.dir\build.make CMakeFiles/uninstall.dir/build
.PHONY : uninstall/fast

#=============================================================================
# Target rules for targets named podofo_static

# Build rule for target.
podofo_static: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 podofo_static
.PHONY : podofo_static

# fast build rule for target.
podofo_static/fast:
	$(MAKE) -f src\CMakeFiles\podofo_static.dir\build.make src/CMakeFiles/podofo_static.dir/build
.PHONY : podofo_static/fast

#=============================================================================
# Target rules for targets named ContentParser

# Build rule for target.
ContentParser: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 ContentParser
.PHONY : ContentParser

# fast build rule for target.
ContentParser/fast:
	$(MAKE) -f test\ContentParser\CMakeFiles\ContentParser.dir\build.make test/ContentParser/CMakeFiles/ContentParser.dir/build
.PHONY : ContentParser/fast

#=============================================================================
# Target rules for targets named CreationTest

# Build rule for target.
CreationTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 CreationTest
.PHONY : CreationTest

# fast build rule for target.
CreationTest/fast:
	$(MAKE) -f test\CreationTest\CMakeFiles\CreationTest.dir\build.make test/CreationTest/CMakeFiles/CreationTest.dir/build
.PHONY : CreationTest/fast

#=============================================================================
# Target rules for targets named DeviceTest

# Build rule for target.
DeviceTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 DeviceTest
.PHONY : DeviceTest

# fast build rule for target.
DeviceTest/fast:
	$(MAKE) -f test\DeviceTest\CMakeFiles\DeviceTest.dir\build.make test/DeviceTest/CMakeFiles/DeviceTest.dir/build
.PHONY : DeviceTest/fast

#=============================================================================
# Target rules for targets named FilterTest

# Build rule for target.
FilterTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 FilterTest
.PHONY : FilterTest

# fast build rule for target.
FilterTest/fast:
	$(MAKE) -f test\FilterTest\CMakeFiles\FilterTest.dir\build.make test/FilterTest/CMakeFiles/FilterTest.dir/build
.PHONY : FilterTest/fast

#=============================================================================
# Target rules for targets named FormTest

# Build rule for target.
FormTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 FormTest
.PHONY : FormTest

# fast build rule for target.
FormTest/fast:
	$(MAKE) -f test\FormTest\CMakeFiles\FormTest.dir\build.make test/FormTest/CMakeFiles/FormTest.dir/build
.PHONY : FormTest/fast

#=============================================================================
# Target rules for targets named ObjectParserTest

# Build rule for target.
ObjectParserTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 ObjectParserTest
.PHONY : ObjectParserTest

# fast build rule for target.
ObjectParserTest/fast:
	$(MAKE) -f test\ObjectParserTest\CMakeFiles\ObjectParserTest.dir\build.make test/ObjectParserTest/CMakeFiles/ObjectParserTest.dir/build
.PHONY : ObjectParserTest/fast

#=============================================================================
# Target rules for targets named ParserTest

# Build rule for target.
ParserTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 ParserTest
.PHONY : ParserTest

# fast build rule for target.
ParserTest/fast:
	$(MAKE) -f test\ParserTest\CMakeFiles\ParserTest.dir\build.make test/ParserTest/CMakeFiles/ParserTest.dir/build
.PHONY : ParserTest/fast

#=============================================================================
# Target rules for targets named SignatureTest

# Build rule for target.
SignatureTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 SignatureTest
.PHONY : SignatureTest

# fast build rule for target.
SignatureTest/fast:
	$(MAKE) -f test\SignatureTest\CMakeFiles\SignatureTest.dir\build.make test/SignatureTest/CMakeFiles/SignatureTest.dir/build
.PHONY : SignatureTest/fast

#=============================================================================
# Target rules for targets named TokenizerTest

# Build rule for target.
TokenizerTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 TokenizerTest
.PHONY : TokenizerTest

# fast build rule for target.
TokenizerTest/fast:
	$(MAKE) -f test\TokenizerTest\CMakeFiles\TokenizerTest.dir\build.make test/TokenizerTest/CMakeFiles/TokenizerTest.dir/build
.PHONY : TokenizerTest/fast

#=============================================================================
# Target rules for targets named VariantTest

# Build rule for target.
VariantTest: cmake_check_build_system
	$(MAKE) -f CMakeFiles\Makefile2 VariantTest
.PHONY : VariantTest

# fast build rule for target.
VariantTest/fast:
	$(MAKE) -f test\V

I believe this is what is causing the error but I don't know how to fix it???
What is the replacement for the -W for the below RC Flags. I can see the CXX flags have been prefixed with a -W as well but the issue is with the RC Flags?.

The error message says the below.

C:\CodeBlocks\MinGW\bin\windres.exe: invalid option -- W

The RC Flags have the below settings.

RC_FLAGS = -IC:\jpeg-6b -IC:\libpng -IC:\zlib -IC:\podofo-0.9.1\podofo-debug -IC:\podofo-0.9.1 -IC:\podofo-0.9.1\src -IC:\freetype-2.4.10\include -IC:\podofo-0.9.1\vcincludes -Wall -Woverloaded-virtual -Wswitch-enum -Wcast-qual -Wwrite-strings -Wredundant-decls -Wreorder -Wold-style-cast

Refer to the PoDoFo mailing list archive. Specifically, this thread which talks about your exact problem. For specific problems about building PoDoFo, they are probably better equipped to help you.

I actually just checked out the source for PoDoFo and built the library. There were a few annoying hurdles, and the build is very dirty (full of warnings), but successful. It seems that the main problem is that they use a rather misconstruded cmake script for the build. They provide a number of modules (in ./cmake/modules) to find some of the external dependencies. However, these are outdated and buggy, so it's better to use the modules installed with cmake for those external dependencies that have one (you can do so by simply renaming the Find*.cmake file in question to something else that won't be picked up by cmake). On top of that, there is a bug in their top-level CMakeLists.txt at Line 30, they override the CMAKE_MODULE_PATH which is a terrible thing to do, the line should be replaced by either:

SET(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

or

SET(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

Also, they use the old-style variable names like *_INCLUDE_DIR, as opposed to the new style *_INCLUDE_DIRS (e.g., they use ${FREETYPE_INCLUDE_DIR} instead of ${FREETYPE_INCLUDE_DIRS}), which is pretty outdated, too outdated for many of the more modern package-finding modules to provide them as backward compatibility (that may be why they provide their own outdated modules).

So, again, direct your build problems to the maintainers of that library, and petition them to modernize / fix their cmake scripts.

Thanks for coming back. This is now solved. As per the link you provided almost all issues were solved by reverting back to CMAKE 2.8.3. I was using CMAKE 2.8.9 which apparrently contains a bug.

Podofo now builds to 100% which is a relief. Any more time spent on this an I would have completely lost the plot. Cheers

This question has already been answered. Start a new discussion instead.