Compile error for emf-win32-inout.cpp under Windows

Bug #594528 reported by Sadeq
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

I got a compiling error while building inkscape-0.48pre0 under Windows XP SP3, using gcc (tdm-1) 4.5.0.

I did every single step as in http://wiki.inkscape.org/wiki/index.php/Win32Port, but the problem didn't went away.

It seems that the problem is in file "emf-win32-inout.cpp." Apparently, the compiler expects an argument of type "ENHMETARECORD*", while it received a type of "const ENHMETARECORD*".

I couldn't dig this error much, since it's my first time compiling Inkscape.

Here's a log of the error:

============================================================

C:\src\inkscape>btool.exe
####################################################
# BuildTool v0.9.9
####################################################
######## PARSE : build.xml
============ cmd ============
bzr revno
=============================
######## PARSE COMPLETE
######## EXECUTE
##### Target : init
##### Do all preparatory tasks, like make directories and copy files
--- init / mkdir
    mkdir : build
--- init / mkdir
    mkdir : build/java
--- init / mkdir
    mkdir : build/java/classes
--- init / mkdir
    mkdir : build/java/lib
--- init / mkdir
    mkdir : inkscape
--- init / copy
    copy : src/helper/sp-marshal.h.mingw to src/helper/sp-marshal.h
    copy : skipped
--- init / copy
    copy : src/helper/sp-marshal.cpp.mingw to src/helper/sp-marshal.cpp
    copy : skipped
--- init / makefile
============ cmd ============
bzr revno
=============================
    makefile : src/inkscape-version.cpp
    makefile : skipped
--- init / makefile
    makefile : config.h
    makefile : skipped
##### Target : cxxtest
##### generate test files
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestroot
##### Target : compile
##### compile the source to .o
--- compile / cc
    cc : compile of build/obj/extension/internal/emf-win32-inout.o required by s
ource: src/extension/internal/emf-win32-inout.cpp
============ cmd ============
mingw32-g++ -c -Wall -Wformat -Werror=format-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -O2 -mms-bitfields -fopenmp -DVERSION=\"0.47+devel\" -DHAVE_CONFIG_H -D_INTL_REDIRECT_INLINE -DHAVE_SSL -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" -DPOPPLER_NEW_GFXFONT -I. -Ic:\devlibs/include -Ic:\devlibs/include/gtkmm-2.4 -Ic:\devlibs/lib/gtkmm-2.4/include -Ic:\devlibs/include/glibmm-2.4 -Ic:\devlibs/lib/glibmm-2.4/include -Ic:\devlibs/include/glib-2.0 -Ic:\devlibs/lib/glib-2.0/include -mms-bitfields -Ic:\devlibs/include/sigc++-2.0 -Ic:\devlibs/lib/sigc++-2.0/include -Ic:\devlibs/include/giomm-2.4 -Ic:\devlibs/lib/giomm-2.4/include -Ic:\devlibs/include/gdkmm-2.4-Ic:\devlibs/lib/gdkmm-2.4/include -Ic:\devlibs/include/pangomm-1.4 -Ic:\devlibs/lib/pangomm-1.4/include -Ic:\devlibs/include/gtk-2.0 -Ic:\devlibs/lib/gtk-2.0/include -Ic:\devlibs/include/gtk-2.0 -Ic:\devlibs/include/pango-1.0 -Ic:\devlibs/include/pango-1.0 -Ic:\devlibs/include/pango-1.0 -Ic:\devlibs/include/cairo -Ic:\devlibs/include/cairomm-1.0 -Ic:\devlibs/lib/cairomm-1.0/include -Ic:\devlibs/include/atkmm-1.6 -Ic:\devlibs/include/atk-1.0 -Ic:\devlibs/include/gtk-2.0 -mms-bitfields -Ic:\devlibs/include/gtk-2.0 -Ic:\devlibs/lib/gtk-2.0/include -Ic:\devlibs/include/ImageMagick -Ic:\devlibs/include/ImageMagick -fopenmp -D_MAGICKDLL_ -Ic:\devlibs/include/libxml2 -Ic:\devlibs/include/freetype2 -Ic:\devlibs/include -Ic:\devlibs/include/cairo -Ic:\devlibs/include/poppler -Ic:\devlibs/include/gc -Ic:\devlibs/include/libwpg-0.1 -Ic:\devlibs/include/libwpd-0.8 -Ic:\devlibs/include/libwpg-0.1 -Ic:\devlibs/include/libwpd-0.8 -Icxxtest -Ic:\devlibs/python/include -Isrc/bind/javainc -Isrc/bind/javainc/win32 -Isrc -Isrc/2geom -Isrc/2geom/numeric -Isrc/application -Isrc/bind -Isrc/debug -Isrc/dialogs -Isrc/display -Isrc/dom -Isrc/dom/io -Isrc/dom/odf -Isrc/dom/util -Isrc/extension -Isrc/extension/implementation -Isrc/extension/internal -Isrc/extension/internal/bitmap -Isrc/extension/internal/filter -Isrc/extension/internal/pdfinput -Isrc/extension/script -Isrc/filters -Isrc/helper -Isrc/io -Isrc/jabber_whiteboard -Isrc/jabber_whiteboard/dialog -Isrc/libavoid -Isrc/libcola -Isrc/libcroco -Isrc/libgdl -Isrc/libnr -Isrc/libnrtype -Isrc/libvpsc -Isrc/libvpsc/pairingheap -Isrc/livarot -Isrc/live_effects -Isrc/live_effects/parameter -Isrc/pedro -Isrc/svg -Isrc/trace -Isrc/trace/potrace -Isrc/ui -Isrc/ui/cache -Isrc/ui/dialog -Isrc/ui/tool -Isrc/ui/view -Isrc/ui/widget -Isrc/util -Isrc/widgets -Isrc/xml src/extension/internal/emf-win32-inout.cpp -o build/obj/extension/internal/emf-win32-inout.o
=============================
Make error line 299: problem compiling: In file included from src/2geom/d2.h:36:
0,
                 from src/2geom/rect.h:40,
                 from src/libnr/nr-rect.h:28,
                 from src/sp-item.h:25,
                 from src/sp-lpe-item.h:17,
                 from src/sp-shape.h:18,
                 from src/sp-path.h:16,
                 from src/extension/internal/emf-win32-inout.cpp:29:
src/2geom/interval.h: In member function 'bool Geom::OptInterval::isEmpty()':
src/2geom/interval.h:241:46: warning: converting 'false' to pointer type for argument 2 of 'bool boost::operator==(const boost::optional<T>&, void (*)(boost::detail::none_helper)) [with T = Geom::Interval, void (*)(boost::detail::none_helper) = void (*)(boost::detail::none_helper)]'
In file included from src/2geom/d2.h:429:0,
                 from src/2geom/rect.h:40,
                 from src/libnr/nr-rect.h:28,
                 from src/sp-item.h:25,
                 from src/sp-lpe-item.h:17,
                 from src/sp-shape.h:18,
                 from src/sp-path.h:16,
                 from src/extension/internal/emf-win32-inout.cpp:29:
src/2geom/rect.h: In member function 'bool Geom::OptRect::isEmpty() const':
src/2geom/rect.h:218:52: warning: converting 'false' to pointer type for argument 2 of 'bool boost::operator==(const boost::optional<T>&, void (*)(boost::detail::none_helper)) [with T = Geom::D2<Geom::Interval>, void (*)(boost::detail::none_helper) = void (*)(boost::detail::none_helper)]'
src/extension/internal/emf-win32-inout.cpp: In member function 'virtual SPDocument* Inkscape::Extension::Internal::EmfWin32::open(Inkscape::Extension::Input*, const gchar*)':
src/extension/internal/emf-win32-inout.cpp:2356:73: error: invalid conversion from 'int (*)(HDC__*, HANDLETABLE*, ENHMETARECORD*, int, LPARAM)' to 'int (*)(HDC__*, HANDLETABLE*, const ENHMETARECORD*, int, LPARAM)'
src/extension/internal/emf-win32-inout.cpp:2356:73: error: initializing argument 3 of 'BOOL EnumEnhMetaFile(HDC__*, HENHMETAFILE__*, int (*)(HDC__*, HANDLETABLE*, const ENHMETARECORD*, int, LPARAM), void*, const RECT*)'

C:\src\inkscape>
==================================================================

Tags: build win32
su_v (suv-lp)
tags: added: build win32
Revision history for this message
hbin (itxyga) wrote :

See the change recommended in an earlier thread about compiling Inkscape
on Windows:
<http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/34225/focus=34270>

from friend :~suv <email address hidden>

Revision history for this message
su_v (suv-lp) wrote :

Attaching the proposed fix by Krzysztof Kosiński as patch for easier use.

The problem apparently does not occur on every windows platform - IMHO it still needs to be investigated and the proposed change verified to not break the build for those who don't see this compile error.

Revision history for this message
su_v (suv-lp) wrote :

Changing status to 'Confirmed' because the issue has been asked about at least twice on inkscape-devel.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Committed in revision 9682 by Jasper van de Gronde
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/9682>

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
su_v (suv-lp) wrote :

…and in revision 9684 "reinterpret_cast to work around a difference of opinion between gcc versions".

Revision history for this message
su_v (suv-lp) wrote :

About r9684 see also:

Subject: Problem compiling rev.9683
<http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/34645>

Revision history for this message
hbin (itxyga) wrote : Re:[Bug 594528] Re: Compile error for emf-win32-inout.cpp under Windows
Download full text (7.7 KiB)

I have to solve this problem. Thank you!

------------------ Original ------------------
From: "~suv"<email address hidden>;
Date: 2010年8月5日(星期四) 凌晨1:09
To: "itxyga"<email address hidden>;
Subject: [Bug 594528] Re: Compile error for emf-win32-inout.cpp under Windows

About r9684 see also:

Subject: Problem compiling rev.9683
<http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/34645>

--
Compile error for emf-win32-inout.cpp under Windows
https://bugs.launchpad.net/bugs/594528
You received this bug notification because you are a direct subscriber
of the bug.

Status in Inkscape: A Vector Drawing Tool: Fix Committed

Bug description:
I got a compiling error while building inkscape-0.48pre0 under Windows XP SP3, using gcc (tdm-1) 4.5.0.

I did every single step as in http://wiki.inkscape.org/wiki/index.php/Win32Port, but the problem didn't went away.

It seems that the problem is in file "emf-win32-inout.cpp." Apparently, the compiler expects an argument of type "ENHMETARECORD*", while it received a type of "const ENHMETARECORD*".

I couldn't dig this error much, since it's my first time compiling Inkscape.

Here's a log of the error:

============================================================

C:\src\inkscape>btool.exe
####################################################
# BuildTool v0.9.9
####################################################
######## PARSE : build.xml
============ cmd ============
bzr revno
=============================
######## PARSE COMPLETE
######## EXECUTE
##### Target : init
##### Do all preparatory tasks, like make directories and copy files
--- init / mkdir
    mkdir : build
--- init / mkdir
    mkdir : build/java
--- init / mkdir
    mkdir : build/java/classes
--- init / mkdir
    mkdir : build/java/lib
--- init / mkdir
    mkdir : inkscape
--- init / copy
    copy : src/helper/sp-marshal.h.mingw to src/helper/sp-marshal.h
    copy : skipped
--- init / copy
    copy : src/helper/sp-marshal.cpp.mingw to src/helper/sp-marshal.cpp
    copy : skipped
--- init / makefile
============ cmd ============
bzr revno
=============================
    makefile : src/inkscape-version.cpp
    makefile : skipped
--- init / makefile
    makefile : config.h
    makefile : skipped
##### Target : cxxtest
##### generate test files
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestpart
--- cxxtest / cxxtestroot
##### Target : compile
##### compile the source to .o
--- compile / cc
    cc : compile of build/obj/extension/internal/emf-win32-inout.o required by s
ource: src/extension/internal/emf-win32-inout.cpp
============ cmd ============
mingw32-g++ -c -Wall -Wformat -Werror=format-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch -O2 -mms-bitfields -fopenmp -DVERSION=\"0.47+devel\" -DHAVE_CONFIG_H -D_INTL_REDIRECT_INLINE -DHAVE_SSL -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" ...

Read more...

Revision history for this message
su_v (suv-lp) wrote :

Backported to inkscape/0.48.x as part of revision 9785.

Changed in inkscape:
milestone: none → 0.48.2
Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.