delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/06/14/10:41:31

X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: gcc with glib
Date: Thu, 14 Jun 2007 16:40:52 +0200
Message-ID: <BAF83494CE653943A97B9F755016A066050FA5CF@ftrdmel1.rd.francetelecom.fr>
From: "PRIEUR Christophe RD-TECH-ISS" <christophe DOT prieur AT orange-ftgroup DOT com>
To: <cygwin AT cygwin DOT com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id l5EEfIo2008430

Hi there,

I'm trying to compile some C program using glib 2.0 and i have some
trouble.

Here is my command line:
gcc -I"/usr/include/glib-2.0" -l glib-2.0 TestGLib.c

First gcc told me it didn't find glibconfig.h, that happened to be in an
awkward directory, namely
/usr/lib/glib-2.0/include/
Awkward because there was no other files in this directory and all glib
header files are in /usr/include/glib-2.0 (in particular glib/gtypes.h
that includes glibconfig.h)

So i've copied it to the proper directory (and don't ask me why it
wasn't there already).
First problem fixed.

Now my real problem is that gcc doesn't look able to manage link
edition:

----------------------------
/cygdrive/c/me/LOCALS~1/Temp/ccgMXEyg.o:TestGLib.c:(.text+0x2e):
undefined reference to `_g_int_equal'
/cygdrive/c/me/LOCALS~1/Temp/ccgMXEyg.o:TestGLib.c:(.text+0x35):
undefined reference to `_g_int_hash'
/cygdrive/c/me/LOCALS~1/Temp/ccgMXEyg.o:TestGLib.c:(.text+0x3a):
undefined reference to `_g_hash_table_new'
collect2: ld returned 1 exit status
----------------------------

It didn't find the binary code for functions that were declared in
glib.h etc.
The file "/usr/lib/libglib-2.0.a" is there though.

My version of cygwin: CYGWIN_NT-5.1

Any clues?

--	Christophe.
prieur AT liafa DOT jussieu DOT fr

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019