Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[DEV] Edition de liens GTK+ qui merde... [RESOLU]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
davidou2a
Guru
Guru


Joined: 15 Dec 2006
Posts: 574
Location: Ajaccio

PostPosted: Sat Oct 16, 2010 11:16 am    Post subject: [DEV] Edition de liens GTK+ qui merde... [RESOLU] Reply with quote

Salut les gars, ca fait un bail que j'avais pas eu trop besoin de votre aide mais la je seche et meme je ne comprends pas... peut etre que c est annodin et que je cherche la ou il faut pas, je sais pas... bref

Voila le resultat c'est plus simple.

La commande lancée :
Code:
david@TheEvil ~/Desktop $ gcc `pkg-config gtk+-2.0 --cflags` -Wl, -c ./main.c
david@TheEvil ~/Desktop $ gcc `pkg-config gtk+-2.0 --cflags` -Wl, -o ./main ./main.o
/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: : No such file: No such file or directory
collect2: ld returned 1 exit status


La sortie de pkg-config :
Code:
david@TheEvil ~/Desktop $ pkg-config gtk+-2.0 --cflags
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm 


Le code en question que j'ai regroupé dans "main.c" pour être sur que c’était pas moi qui avait oublié quelque chose.
Code:
#include <stdlib.h>
#include <gtk/gtk.h>

#define DESTROY "destroy"
#define MAINUI_TITLE "Mon Titre"
#define GTK_INIT            gtk_init (& argc, & argv);
#define GTK_MAIN            gtk_main();

void wMainUi(void);
void wMainUi_Destroy(GtkWidget *widget, gpointer user_data);

int main(int argc, char *argv[])
{

    GTK_INIT

    wMainUi();

    GTK_MAIN

    return EXIT_SUCCESS;

}

void wMainUi(void)
{

    GtkWidget *wMainUi = NULL;

    wMainUi = gtk_window_new(GTK_WINDOW_TOPLEVEL);

    gtk_window_set_title(GTK_WINDOW(wMainUi), MAINUI_TITLE);

    g_signal_connect(G_OBJECT(wMainUi), DESTROY, G_CALLBACK(wMainUi_Destroy), NULL);

    gtk_widget_show(wMainUi);

}

void wMainUi_Destroy(GtkWidget *widget, gpointer user_data)
{
    gtk_main_quit();
}


Mon emerge --info :
Code:
TheEvil Desktop # emerge --info
Portage 2.1.9.19 (default/linux/x86/10.0, gcc-4.4.4, glibc-2.12.1-r1, 2.6.35-gentoo-r10 i686)
=================================================================
System uname: Linux-2.6.35-gentoo-r10-i686-Intel-R-_Pentium-R-_Dual_CPU_T2310_@_1.46GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 16 Oct 2010 10:15:01 +0000
app-shells/bash:     4.1_p9
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.6, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.3
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.13, 2.68
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.4-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.35 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=prescott -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=prescott -fomit-frame-pointer -msse -msse2 -msse3 -mmmx -m3dnow -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://gentoo.imj.fr/pub/gentoo/       http://mirrors.linuxant.fr/distfiles.gentoo.org/       ftp://mirrors.ipv6.linuxant.fr/distfiles.gentoo.org/       http://mirrors.ipv6.linuxant.fr/distfiles.gentoo.org/       ftp://mirrors.linuxant.fr/distfiles.gentoo.org/       http://gentoo.modulix.net/gentoo/       ftp://mirror.ovh.net/gentoo-distfiles/       http://mirror.ovh.net/gentoo-distfiles/"
LANG="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X acl acpi alsa berkdb branding bzip2 cairo cdrom cleartype cli consolekit cracklib crypt cups cxx dbus dri fbcon fbcondecor fbsplash foomaticdb fortran fortune gdbm gif glade glib gpm gstreamer gtk gzip hal iconv imagemagick ipv6 jpeg libnotify logrotate mmx mmxext modules mpeg mudflap ncurses nls nptl nptlonly ntfs opengl openmp openssl pam pcmcia pcre perl png pppd python rar raw rdesktop readline reflection samba session sse sse2 sse3 ssh ssl ssse3 sysfs tcpd truetype udev unicode wifi x86 xcomposite xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="fr" PHP_TARGETS="php-5.2" RUBY_TARGETS="ruby18" SANE_BACKENDS="canon canon630u canon_dr canon_pp plustek plustek_pp" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY


J'aurai un problème avec GCC?
Code:
[ebuild   R   ] sys-devel/gcc-4.4.4-r2  USE="fortran gtk mudflap nls nptl openmp (-altivec) -bootstrap -build -doc (-fixed-point) -gcj -graphite (-hardened) (-libffi) (-multilib) -multislot (-n32) (-n64) -nocxx -nopie -nossp -objc -objc++ -objc-gc -test -vanilla" 0 kB


Code:
TheEvil Desktop # gcc-config -c
i686-pc-linux-gnu-4.4.4


Code:
TheEvil Desktop # gcc-config -l
 [1] i686-pc-linux-gnu-4.4.4 *


La je sèche... vous avez une idée?

Dans l'absolu c'est ça qui m'interpelle :
Code:
/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: : No such file: No such file or directory


De plus :
Code:
TheEvil Desktop # ls -la /usr/i686-pc-linux-gnu/bin/
total 8
drwxr-xr-x 2 root root 4096  5 oct.  19:17 .
drwxr-xr-x 6 root root 4096  5 oct.  16:24 ..
lrwxrwxrwx 1 root root   52 10 oct.  15:21 addr2line -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/addr2line
lrwxrwxrwx 1 root root   45 10 oct.  15:21 ar -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/ar
lrwxrwxrwx 1 root root   45 10 oct.  15:21 as -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/as
lrwxrwxrwx 1 root root   50 10 oct.  15:21 c++filt -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/c++filt
lrwxrwxrwx 1 root root   48 10 oct.  15:21 gprof -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/gprof
lrwxrwxrwx 1 root root   45 10 oct.  15:21 ld -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/ld
lrwxrwxrwx 1 root root   45 10 oct.  15:21 nm -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/nm
lrwxrwxrwx 1 root root   50 10 oct.  15:21 objcopy -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/objcopy
lrwxrwxrwx 1 root root   50 10 oct.  15:21 objdump -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/objdump
lrwxrwxrwx 1 root root   49 10 oct.  15:21 ranlib -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/ranlib
lrwxrwxrwx 1 root root   50 10 oct.  15:21 readelf -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/readelf
lrwxrwxrwx 1 root root   47 10 oct.  15:21 size -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/size
lrwxrwxrwx 1 root root   50 10 oct.  15:21 strings -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/strings
lrwxrwxrwx 1 root root   48 10 oct.  15:21 strip -> /usr/i686-pc-linux-gnu/binutils-bin/2.20.1/strip


PS : en root même punition... pourtant "ld" est là... je comprends pas... je fais recompiler "binutils" on verra bien...
_________________
L'enfer je connais, il s'appelle Windows...


Last edited by davidou2a on Sat Oct 16, 2010 12:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
davidou2a
Guru
Guru


Joined: 15 Dec 2006
Posts: 574
Location: Ajaccio

PostPosted: Sat Oct 16, 2010 11:48 am    Post subject: Reply with quote

apres un :
Code:
# emerge -1 binutils libtool


Code:
TheEvil Desktop # gcc `pkg-config gtk+-2.0 --cflags` -c main.c
TheEvil Desktop # gcc `pkg-config gtk+-2.0 --cflags` -o main main.o
main.o: In function `main':
main.c:(.text+0x17): undefined reference to `gtk_init'
main.c:(.text+0x21): undefined reference to `gtk_main'
main.o: In function `wMainUi':
main.c:(.text+0x42): undefined reference to `gtk_window_new'
main.c:(.text+0x4a): undefined reference to `gtk_window_get_type'
main.c:(.text+0x59): undefined reference to `g_type_check_instance_cast'
main.c:(.text+0x69): undefined reference to `gtk_window_set_title'
main.c:(.text+0x81): undefined reference to `g_type_check_instance_cast'
main.c:(.text+0xad): undefined reference to `g_signal_connect_data'
main.c:(.text+0xb8): undefined reference to `gtk_widget_show'
main.o: In function `wMainUi_Destroy':
main.c:(.text+0xc9): undefined reference to `gtk_main_quit'
collect2: ld a retourné 1 code d'état d'exécution


Alors la je seche...
_________________
L'enfer je connais, il s'appelle Windows...
Back to top
View user's profile Send private message
davidou2a
Guru
Guru


Joined: 15 Dec 2006
Posts: 574
Location: Ajaccio

PostPosted: Sat Oct 16, 2010 12:25 pm    Post subject: Reply with quote

Bon petit à petit j'avance :

Code:
david@TheEvil ~ $ pkg-config --libs gtk+-2.0 --cflags-pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0


donc si je fais :
Code:
david@TheEvil ~/Desktop $ gcc -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -c main.c
david@TheEvil ~/Desktop $ gcc -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -I/usr/include/libdrm  -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 -o main.bin main.o


Ca serait pas un problème de pkg-config? ou peut être moi qui utilise une mauvais ligne de commande?
_________________
L'enfer je connais, il s'appelle Windows...
Back to top
View user's profile Send private message
davidou2a
Guru
Guru


Joined: 15 Dec 2006
Posts: 574
Location: Ajaccio

PostPosted: Sat Oct 16, 2010 12:29 pm    Post subject: Reply with quote

Bon je suis un idiot sur ce coup...

Code:
david@TheEvil ~/Desktop $ gcc `pkg-config --libs gtk+-2.0 --cflags` -Wl, main.c/usr/lib/gcc/i686-pc-linux-gnu/4.4.4/../../../../i686-pc-linux-gnu/bin/ld: : No such file: No such file or directory
collect2: ld a retourné 1 code d'état d'exécution
david@TheEvil ~/Desktop $ gcc `pkg-config --libs gtk+-2.0 --cflags` main.c


J'en conclut que -Wl, pose probleme... et qu'il fallait que j'ajoute --libs devant gtk+-2.0

Code:
david@TheEvil ~/Desktop $ gcc --help | grep Wl
  -Wl,<options>            passer les <options> séparées par des virgules  à l'éditeur de liens


Bah voila, au final j'ai resolu ca seul comme un grand... grosse intention de ma part, j'aurai du réfléchir avant de poster, ça m'apprendra tiens...
_________________
L'enfer je connais, il s'appelle Windows...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum