[PATCH] Fedora MinGW cross-compiling patch, version 2
![](https://secure.gravatar.com/avatar/a18b9d67f6592020ed01f073d690d4ec.jpg?s=120&d=mm&r=g)
This is the second version of the patch to get Inkscape to cross-compile from Fedora MinGW.
(1) I've tested that this doesn't break the build on Linux.
(2) You cannot set INKSCAPE_CFLAGS in the Win32 test, because then PKG_CHECK_MODULES(INKSCAPE, ...) refuses to update this variable. Thus I introduced a separate WIN32_CFLAGS variable.
(3) You need to check for fontconfig before checking for Xft. Otherwise the cross-compiler erroneously picks up the platform native version of Xft, which leads to incorrect linker flags.
(4) Use g_getenv / g_setenv instead of getenv / setenv.
(5) is_os_vista no longer needs to be commented out.
Rich.
![](https://secure.gravatar.com/avatar/b47d036b8f12e712f4960ba78404c3b2.jpg?s=120&d=mm&r=g)
Everything fixed in revision 20079. I hope I didn't break anything (though I verified that the build is not broken for me). Pull the current version from SVN and check whether it works out of the box.
Regards, Krzysztof Kosiński
![](https://secure.gravatar.com/avatar/2e8e84fee7efe5ef62dfd57f596e7599.jpg?s=120&d=mm&r=g)
I got some compile errors with rev. 20082 on XP:
problem compiling: In file included from src/file.cpp:52: src/ui/dialog/ocaldialogs.h:153: error: 'FileType' was not declared in this scope src/ui/dialog/ocaldialogs.h:153: error: template argument 1 is invalid src/ui/dialog/ocaldialogs.h:153: error: template argument 2 is invalid src/ui/dialog/ocaldialogs.h:247: error: 'SVGPreview' has not been declared src/ui/dialog/ocaldialogs.h:260: error: ISO C++ forbids declaration of 'SVGPreview' with no type src/ui/dialog/ocaldialogs.h:260: error: expected ';' before '*' token src/ui/dialog/ocaldialogs.h: In constructor 'Inkscape::UI::Dialog::FileListViewText::FileListViewText(guint, int&, Gtk::Label&, Gtk::Button&)': src/ui/dialog/ocaldialogs.h:250: error: 'myPreview' was not declared in this scope src/ui/dialog/ocaldialogs.h: At global scope: src/ui/dialog/ocaldialogs.h:310: error: ISO C++ forbids declaration of 'SVGPreview' with no type src/ui/dialog/ocaldialogs.h:310: error: expected ';' before '*' token
cc : compile of build/obj/main.o required by included: src/extension/internal/win32.h
problem compiling: src/ui/dialog/filedialog.cpp: In member function 'void Inkscape::UI::Dialog::FileSaveDialog::appendExtension(Glib::ustring&, Inkscape::Extension::Output*)': src/ui/dialog/filedialog.cpp:147: error: invalid use of incomplete type 'struct Inkscape::Extension::Output' src/ui/dialog/filedialog.h:27: error: forward declaration of 'struct Inkscape::Extension::Output' src/ui/dialog/filedialog.cpp:156: error: invalid use of incomplete type 'struct Inkscape::Extension::Output' src/ui/dialog/filedialog.h:27: error: forward declaration of 'struct Inkscape::Extension::Output' src/ui/dialog/filedialog.cpp: In static member function 'static Inkscape::UI::Dialog::FileExportDialog* Inkscape::UI::Dialog::FileExportDialog::create(Gtk::Window&, const Glib::ustring&, Ink scape::UI::Dialog::FileDialogType, const char*, const Glib::ustring&)': src/ui/dialog/filedialog.cpp:177: error: expected type-specifier before 'FileExportDialogImpl' src/ui/dialog/filedialog.cpp:177: error: cannot convert 'int*' to 'Inkscape::UI::Dialog::FileExportDialog*' in initialization src/ui/dialog/filedialog.cpp:177: error: expected ',' or ';' before 'FileExportDialogImpl' src/ui/dialog/filedialog.cpp: At global scope: src/ui/dialog/filedialog.cpp:175: warning: unused parameter 'parentWindow' src/ui/dialog/filedialog.cpp:175: warning: unused parameter 'path' src/ui/dialog/filedialog.cpp:175: warning: unused parameter 'fileTypes' src/ui/dialog/filedialog.cpp:175: warning: unused parameter 'title' src/ui/dialog/filedialog.cpp:175: warning: unused parameter 'default_key'
cc : compile of build/obj/ui/dialog/filedialogimpl-gtkmm.o required by source: src/ui/dialog/filedialogimpl-gtkmm.cpp
problem compiling: In file included from src/ui/dialog/ocaldialogs.cpp:22: src/ui/dialog/ocaldialogs.h:94: error: 'FileDialogType' does not name a type src/ui/dialog/ocaldialogs.h:119: error: 'FileDialogType' has not been declared src/ui/dialog/ocaldialogs.h:153: error: 'FileType' was not declared in this scope src/ui/dialog/ocaldialogs.h:153: error: template argument 1 is invalid src/ui/dialog/ocaldialogs.h:153: error: template argument 2 is invalid src/ui/dialog/ocaldialogs.h:247: error: 'SVGPreview' has not been declared src/ui/dialog/ocaldialogs.h:260: error: ISO C++ forbids declaration of 'SVGPreview' with no type src/ui/dialog/ocaldialogs.h:260: error: expected ';' before '*' token src/ui/dialog/ocaldialogs.h: In constructor 'Inkscape::UI::Dialog::FileListViewText::FileListViewText(guint, int&, Gtk::Label&, Gtk::Button&)': src/ui/dialog/ocaldialogs.h:250: error: 'myPreview' was not declared in this scope src/ui/dialog/ocaldialogs.h: At global scope: src/ui/dialog/ocaldialogs.h:279: error: 'FileDialogType' has not been declared src/ui/dialog/ocaldialogs.h:310: error: ISO C++ forbids declaration of 'SVGPreview' with no type src/ui/dialog/ocaldialogs.h:310: error: expected ';' before '*' token src/ui/dialog/ocaldialogs.cpp:61: error: 'FileDialogType' has not been declared src/ui/dialog/ocaldialogs.cpp: In constructor 'Inkscape::UI::Dialog::FileExportToOCALDialog::FileExportToOCALDialog(Gtk::W indow&, int, const Glib::ustring&)': src/ui/dialog/ocaldialogs.cpp:75: error: 'dialogType' was not declared in this scope src/ui/dialog/ocaldialogs.cpp:91: error: 'findEntryWidgets' was not declared in this scope src/ui/dialog/ocaldialogs.cpp: In member function 'virtual void Inkscape::UI::Dialog::FileListViewText::on_cursor_changed()': src/ui/dialog/ocaldialogs.cpp:363: warning: label 'fail' defined but not used src/ui/dialog/ocaldialogs.cpp:365: warning: label 'failquit' defined but not used src/ui/dialog/ocaldialogs.cpp: At global scope: src/ui/dialog/ocaldialogs.cpp:537: error: 'FileDialogType' has not been declared src/ui/dialog/ocaldialogs.cpp: In constructor 'Inkscape::UI::Dialog::FileImportFromOCALDialog::FileImportFromOCALDialog(Gt k::Window&, const Glib::ustring&, int, const Glib::ustring&)': src/ui/dialog/ocaldialogs.cpp:546: error: 'dialogType' was not declared in this scope src/ui/dialog/ocaldialogs.cpp:564: error: 'filesPreview' was not declared in this scope src/ui/dialog/ocaldialogs.cpp:564: error: expected type-specifier before 'SVGPreview' src/ui/dialog/ocaldialogs.cpp:564: error: expected `;' before 'SVGPreview' src/ui/dialog/ocaldialogs.cpp:594: error: 'findEntryWidgets' was not declared in this scope
Preben
-----Original Message----- From: Krzysztof Kosiński [mailto:tweenk.pl@...400...] Sent: 28 October, 2008 18:37 To: inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] [PATCH] Fedora MinGW cross-compiling patch, version 2
Everything fixed in revision 20079. I hope I didn't break anything (though I verified that the build is not broken for me). Pull the current version from SVN and check whether it works out of the box.
Regards, Krzysztof Kosiński
View this message in context: http://www.nabble.com/-PATCH--Fedora-MinGW- cross-compiling-patch%2C-version-2-tp20192794p20205623.html Sent from the Inkscape - Dev mailing list archive at Nabble.com.
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
![](https://secure.gravatar.com/avatar/a18b9d67f6592020ed01f073d690d4ec.jpg?s=120&d=mm&r=g)
On Tue, Oct 28, 2008 at 09:11:15PM +0700, Preben Soeberg wrote:
I got some compile errors with rev. 20082 on XP:
problem compiling: In file included from src/file.cpp:52: src/ui/dialog/ocaldialogs.h:153: error: 'FileType' was not declared in this scope
[...]
I'm getting these errors too .. I'm not sure it's connected to windows though.
Rich.
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
Please, before committing this kind of patches to svn, check the build on linux *and* windows. Especially on windows for this patch because it involves adding a "#ifndef win32" clause around a whole file. Now we again have a broken SVN build :(
-----Original Message----- From: Krzysztof Kosiński [mailto:tweenk.pl@...400...] Sent: dinsdag 28 oktober 2008 12:37 To: inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] [PATCH] Fedora MinGW cross-compiling patch, version 2
Everything fixed in revision 20079. I hope I didn't break anything (though I verified that the build is not broken for me). Pull the current version from SVN and check whether it works out of the box.
Regards, Krzysztof Kosiński
View this message in context: http://www.nabble.com/-PATCH--Fedora-MinGW-cross-compiling-pat ch%2C-version-2-tp20192794p20205623.html Sent from the Inkscape - Dev mailing list archive at Nabble.com.
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
![](https://secure.gravatar.com/avatar/a18b9d67f6592020ed01f073d690d4ec.jpg?s=120&d=mm&r=g)
On Tue, Oct 28, 2008 at 04:00:43PM +0100, J.B.C.Engelen@...1578... wrote:
Please, before committing this kind of patches to svn, check the build on linux *and* windows. Especially on windows for this patch because it involves adding a "#ifndef win32" clause around a whole file.
The problem here is that the compiler on Windows doesn't allow an empty translation unit?
With cross-compiling, we're still using gcc, so we won't catch this unless we compile with -ansi -pedantic-errors (? IIRC)
Rich.
![](https://secure.gravatar.com/avatar/15f5e6abf26f57e1838c29a8356ce7f8.jpg?s=120&d=mm&r=g)
-----Original Message----- From: Richard W.M. Jones [mailto:rjones@...43...] Sent: dinsdag 28 oktober 2008 16:24 To: Engelen, J.B.C. (Johan) Cc: tweenk.pl@...400...; inkscape-devel@lists.sourceforge.net Subject: Re: [Inkscape-devel] [PATCH] Fedora MinGW cross-compiling patch,version 2
On Tue, Oct 28, 2008 at 04:00:43PM +0100, J.B.C.Engelen@...1578... wrote:
Please, before committing this kind of patches to svn,
check the build
on linux *and* windows. Especially on windows for this
patch because
it involves adding a "#ifndef win32" clause around a whole file.
The problem here is that the compiler on Windows doesn't allow an empty translation unit?
With cross-compiling, we're still using gcc, so we won't catch this unless we compile with -ansi -pedantic-errors (? IIRC)
Empty translation units are not a problem, otherwise we could never write #ifndef __FILE_DIALOGIMPL_H__ #define __FILE_DIALOGIMPL_H__ at the start of any header file!
The problem is that now a whole file is excluded from windows builds by #ifndef WIN32, and this file defines a type needed by other files, hence: src/ui/dialog/ocaldialogs.h:153: error: 'FileType' was not declared in this scope
Dumb question I guess, but does your cross-compiler set WIN32?
I removed the #ifndef WIN32, now Inkscape builds again.
![](https://secure.gravatar.com/avatar/a18b9d67f6592020ed01f073d690d4ec.jpg?s=120&d=mm&r=g)
On Tue, Oct 28, 2008 at 08:02:52PM +0100, J.B.C.Engelen@...1578... wrote:
Dumb question I guess, but does your cross-compiler set WIN32?
Yes it does.
Rich.
![](https://secure.gravatar.com/avatar/dc940f48c5635785f32941f1fbe6b601.jpg?s=120&d=mm&r=g)
On Oct 28, 2008, at 12:02 PM, J.B.C.Engelen@...1578... wrote:
Empty translation units are not a problem, otherwise we could never write #ifndef __FILE_DIALOGIMPL_H__ #define __FILE_DIALOGIMPL_H__ at the start of any header file!
Just a minor note, those defines are technically "naughty"
Starting with underscores like that is reserved.
Instead we've been switching files to
#ifndef FILE_DIALOGIMPL_H_SEEN #define FILE_DIALOGIMPL_H_SEEN
![](https://secure.gravatar.com/avatar/b47d036b8f12e712f4960ba78404c3b2.jpg?s=120&d=mm&r=g)
J.B.C.Engelen wrote:
Dumb question I guess, but does your cross-compiler set WIN32?
I removed the #ifndef WIN32, now Inkscape builds again.
Sorry for the breakage. The problem was that the OCAL import/export dialogs used the gtkmm implementation of file dialogs even on Windows, and I wasn't aware of that. I thought gtkmm file dialogs are only used on non-Windows platforms.
Regards, Krzysztof Kosiński
![](https://secure.gravatar.com/avatar/a18b9d67f6592020ed01f073d690d4ec.jpg?s=120&d=mm&r=g)
So I did this comparison showing Inkscape running natively under Linux, in Wine, and on Windows XP:
http://camltastic.blogspot.com/2008/10/mingw-inkscape-cross-compiled-from.ht...
Note the icons problem on the final screenshot. Is it possible that inkscape could pick up its data directory through an environment variable or a command-line option? That would be really helpful in those cases where we just want to tell inkscape to gets its icons/data from /some/path without needing to recompile everything.
Rich.
participants (5)
-
unknown@example.com
-
Jon A. Cruz
-
Krzysztof Kosiński
-
Preben Soeberg
-
Richard W.M. Jones