Re: "Can't link to Pango"



On 02/13/2014 12:37 PM, Bric wrote:
On 02/13/2014 07:03 AM, Kang Hu wrote:
sorry for my previous misinfomation
it seems that the error happens here in your configure log file:
---------------------------------------------------------------------------------------------------------

configure:24295: gcc -o conftest -march=i686 -mtune=i686 -Wall
-pthread -I/usr/local/include/pango-1.0 -I/usr/local/include/glib-2.0
-I/usr/local/lib/glib-2.0/include -I/usr/local/include/cairo
-I/usr/local/include -I/usr/local/include/freetype2
-I/usr/local/include/libpng12 -I/usr/include/pixman-1      -ldl
conftest.c -L/usr/local/lib -lpangocairo-1.0 -lpango-1.0 -lcairo
-lgobject-2.0 -lglib-2.0    >&5
/usr/local/lib/libpangocairo-1.0.so  <http://libpangocairo-1.0.so>:
undefined reference to `pango_fc_font_create_base_metrics_for_context'
collect2: ld returned 1 exit status
-----------------------------------------------------------------

Bric,

You shouldn't be getting this
"undefined reference to `pango_fc_font_create_base_metrics_for_context'"
linker error.

You haven't provided your entire source code project to compile and link
with.  That said there is a pango example c++ project out there that I
found:
1)go get this sample project:
https://git.gnome.org/browse/gtkmm-documentation/plain/examples/book/drawingarea/pango_text/

The following makefile isn't the most elegant, but it gets the job done.
##########################################################
# Makefile
##########################################################
all: pangotextcpp

pangotextcpp:
        g++ -v -std=gnu++11  -c main.cc  `pkg-config gtkmm-3.0 --cflags --libs`
-lboost_system -lboost_filesystem -lboost_serialization
-lboost_iostreams -lboost_date_time
        g++ -v -std=gnu++11  -c myarea.cc  `pkg-config gtkmm-3.0 --cflags
--libs` -lboost_system -lboost_filesystem -lboost_serialization
-lboost_iostreams -lboost_date_time
        g++ -v -std=gnu++11  main.o myarea.o -o pangotextcpp   `pkg-config
gtkmm-3.0 --cflags --libs` -lboost_system -lboost_filesystem
-lboost_serialization -lboost_iostreams -lboost_date_time
##########################################################
# End of Makefile
##########################################################

2)then run make rebuild:
make -B

I wanted to send you the extended verbose output for this build, but the
mailing list refused me.  You will have to build to see them.

I do believe this Makefile will put you back on the right track.

There are others who don't agree with using Makefiles.  Please disregard
their comments because I am simplifying it for you.  There are no other
tools for you that are necessary to use.  The one thing you need to do
however is to install the necessary dependencies on your computer and do
heed the advice to upgrade your computer to the latest os.  It is well
worth it simply to save your time with older less-secure versions of not
only gnome, but all the other packages as well.

Cheers,
David Marceau



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]