# Can't compile Inkscape



## jeltoesolnce (Jun 14, 2013)

Hello, I try _to_ compile graphics/inkscape and _I_ get th_ese_ errors:

```
/usr/local/lib/libwpg-0.2.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
/usr/local/lib/libglibmm-2.4.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
/usr/local/lib/libgtkmm-2.4.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
/usr/local/lib/libwpg-0.2.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11'
/usr/local/lib/libglibmm-2.4.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()@GLIBCXX_3.4.15'
/usr/local/lib/libgtkmm-2.4.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)@GLIBCXX_3.4.15'
gmake[2]: *** [inkview] ÐžÑˆÐ¸Ð±ÐºÐ° 1
```

I have installed gcc46, but I have tried _to_ compile with and without th_ese_ settings _i_n make.conf:

```
CPUTYPE?=core2
NO_CPU_CFLAGS=false
NO_CPU_COPTFLAGS=false

CFLAGS= -O2 -pipe -fno-strict-aliasing
COPTFLAGS= -O2 -pipe
OPTIMIZED_CFLAGS=YES
WITH_CPUFLAGS=YES
WITH_OPTIMIZED_CFLAGS=YES
MAKE_JOBS_NUMBER?=3
WITH_NEW_XORG=YES

.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc46)
CC=gcc46
CXX=g++46
CPP=cpp46
CFLAGS+=-mssse3

# Legacy ports
LEGACY_PORTS=   multimedia/cuse4bsd-kmod \
                net/libproxy \
                sysutils/fusefs-kmod \
                x11/libXtst \
                www/webkit-gtk2 \
                editors/openoffice-3 \
                audio/espeak \
                sysutils/fusefs-kmod \
                graphics/graphviz \
                x11/nvidia-driver-304

.for port in ${LEGACY_PORTS}
.if ${.CURDIR:M*/ports/$(port)}
CC=             cc
CXX=            c++
CPP=            cpp
CFLAGS= -O2 -pipe -fno-strict-aliasing
.endif
.endfor
.endif
```

What can I do?


----------



## SirDice (Jun 14, 2013)

jeltoesolnce said:
			
		

> ```
> CFLAGS= -O2 -pipe -fno-strict-aliasing
> COPTFLAGS= -O2 -pipe
> ```


Remove these. They do not do what you think they do. Everything already uses the most optimal compiler switches. Setting them by hand usually does more damage than good.


----------



## jeltoesolnce (Jun 14, 2013)

Thank you, SirDice, I did that, but the error is the same...


----------



## SirDice (Jun 14, 2013)

Does x11-toolkits/gtkmm24 build and install fine? Looking at the errors they may be related to it.


----------



## kpa (Jun 14, 2013)

Since you're using a gcc compiler from ports you may have to adjust libmap.conf(5) to get the C++ stuff to link.

http://www.freebsd.org/doc/en/articles/custom-gcc/article.html


----------



## jeltoesolnce (Jun 15, 2013)

Well, I read the article, thanks.

I have reinstalled libraries:

devel/glibmm (glibmm-2.34.1,1 -> glibmm-2.34.1,1)
graphics/libwpg (libwpg-0.2.2 -> libwpg-0.2.2)
x11-toolkits/gtkmm24 (gtkmm-2.24.2_1 -> gtkmm-2.24.2_1)
and I looked at /usr/local/lib/gcc46 and I did not find there a target for above sources. Maybe, I did not understand this article. Now I run this command: `portupgrade -Rf graphics/libwpg -l <some_file>`. 
Maybe this will help.


----------



## jozze (Jun 15, 2013)

You can also use script(1)() to do save the output of your compilation process (I have a bad experience with [cmd=""]portupgrade -l[/cmd]), like

```
# script /var/tmp/mycompile.out
# portupgrade -Rf graphics/libwpg
# exit
```
and then inspect its contents with your favorite text editor. I would also suggest removing [cmd=""]MAKE_JOBS_NUMBER?=3[/cmd] from your /etc/make.conf -- that's what the -pipe flag is for.

In any case, know that not all ports are sure to build with a non-standard gcc compiler. Consider building those ports with clang.


----------



## kpa (Jun 15, 2013)

jozze said:
			
		

> In any case, know that not all ports are sure to build with a non-standard gcc compiler. Consider building those ports with clang.



Many ports come from Linux where gcc version 4.6 or newer is the default compiler, those ports should compile fine with gcc from ports.


----------



## jeltoesolnce (Jun 18, 2013)

I did a rollback of the system, now everything works. Why it was so, I don't know, but thanks for all.


----------

