Re: "Can't link to Pango"



Bric,

Please install gtkmm-dev.  You should also install boost-all-dev.
That will bring in all the gtkmm/boost libs along with all the necessary
include files for them.  After that you should be good to go.

Cheers :)

David Marceau


On 02/15/2014 06:07 AM, Bric wrote:
On 02/14/2014 05:13 PM, David Marceau wrote:
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

David,

thank you for trying to help.  You may have forgotten about gtkmm. It
depends on gtk+, and I don't have it yet, any version whatsoever.
(Neither gtkmm, nor gtk+, of course)

So, here is what I get when I run  "make -B" on your example source:

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
Package gtkmm-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkmm-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkmm-3.0' found
Using built-in specs.
COLLECT_GCC=g++
Target: i686-pc-linux-gnu
Configured with: ./configure
Thread model: posix
gcc version 4.8.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=gnu++11' '-c' '-shared-libgcc'
'-mtune=generic' '-march=pentiumpro'
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.8.2/cc1plus -quiet -v
-D_GNU_SOURCE main.cc -quiet -dumpbase main.cc -mtune=generic
-march=pentiumpro -auxbase main -std=gnu++11 -version -o /tmp/cc5MiXGw.s
GNU C++ (GCC) version 4.8.2 (i686-pc-linux-gnu)
    compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version
3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/../../../../i686-pc-linux-gnu/include"

#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/../../../../include/c++/4.8.2
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/../../../../include/c++/4.8.2/i686-pc-linux-gnu

 /usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/../../../../include/c++/4.8.2/backward

 /usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/include
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.8.2/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.8.2 (i686-pc-linux-gnu)
    compiled by GNU C version 4.8.2, GMP version 5.1.3, MPFR version
3.1.2, MPC version 1.0.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 199428ac179d70aeab288aaafff446f0
In file included from main.cc:17:0:
myarea.h:20:31: fatal error: gtkmm/drawingarea.h: No such file or directory
 #include <gtkmm/drawingarea.h>
                               ^
compilation terminated.
Makefile:7: recipe for target 'pangotextcpp' failed
make: *** [pangotextcpp] Error 1

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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