Snippet from Recompiling libiconv, gettext undefined symbols occurring after an already successful install ; thought to make it its own question.Lors de l'installation d'une bibliothèque est-il l'un de `ar`,` libtool`, `ranlib`, ou autre qui décide si c'est 32 ou 64 bits?
Essayer d'utiliser libiconv
dans un fichier .c
simple:
#include <iconv.h>
// works: gcc -m32 -I/usr/local/include -liconv -o test-iconv.exe test-iconv.c
// does NOT work: gcc -I/usr/local/include -liconv -o test-iconv.exe test-iconv.c
int main(int argc, char **argv) {
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
if (conv != (iconv_t) -1) {
return 0;
}
return 1;
}
Si je ne spécifie pas -m32
pour gcc
je reçu l'erreur suivante:
$ gcc -I/usr/local/include -liconv -o test-iconv.exe test-iconv.c
Undefined symbols for architecture x86_64:
"_libiconv_open", referenced from:
_main in ccr9tTic.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
Vous passez '-m32' à ** gcc **, comment cela ne répond-il pas déjà à votre question? –
Désolé, j'essaie de garder le reste des programmes 64bit. 'libiconv' est l'une de leurs dépendances –