Static link issue on Windows

Bug #989972 reported by David Mathog
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

I'm beating my head on the wall trying to get a dynamic memory debugger working with Inkscape on Windows.

A first attempt at Dr.Memory didn't work (it would not even run "inkscape -V" to completion). The documentation for
Dr. Memory says that it wants the applications to be linked with static libgcc and libstdc++. The problem is, inkscape wouldn't build like that (in build.xml, change all strip="true" to strip="false", and add
   -static-libgcc -static-libstdc++
to the linker flags.) For some obscure reason these two lines in

 src/ui/tool/path-manipulator.cpp

943: if (!first) throw std::invalid_argument("Subdivide after invalid iterator");
946: if (!second) throw std::invalid_argument("Subdivide after last node in open path");

cause a link problem.

multiple definition of `std::invalid_argument::~invalid_argument()'

Other people have seen this in other projects using mingw, like:
http://forums.wesnoth.org/viewtopic.php?f=5&t=18877&start=150#p512983

Oddly other similar constructs like "throw std::logic_error" did not cause the same problem. The std::invalid_argument function is not used anywhere else in the code, so these two instances were both changed to just the form

   throw "message";

and that allowed the link to complete.

This could be a bug in gcc, which is 4.6.2. If it is, it probably would do the same thing on other platforms should a static link
be attempted there.

Windows XP SP3
trunk 11289.
mingw was (re)installed with all new parts from sourceforge earlier in the week.

As it turned out, Dr. Memory did no better with "inkscape -V" when inkscape was linked using the static libraries. A bug report has been filed on Dr. Memory for this issue: http://code.google.com/p/drmemory/issues/detail?id=876

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

<off-topic>
mathog wrote in bug #989201:
> At this point I am opening the floor for suggestions about how to go forward from here.
and in bug #989972:
> I'm beating my head on the wall trying to get a dynamic memory
> debugger working with Inkscape on Windows.

Neither of these reports belong into the bug tracker at this stage IMHO: please move such discussions about best practices to develop and debug inkscape on a specific platform (Windows) to the mailing list 'inkscape-devel'.
</off-topic>

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

Closing - as mentioned before, this ought to discussed on the mailing list, not in the bug tracker (at this stage).

On 25/10/2012 18:40, mathog wrote:
> Remind me again why TDM is suggested?

<http://article.gmane.org/gmane.comp.graphics.inkscape.devel/33124>

Changed in inkscape:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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