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

Recommended Answers

All 5 Replies

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.