Bonjour,
Je travaille sous Solaris 5.8. Sur la machine y'a g++ d'installer en version 2.7.2 () et CC, donc c'est CC que j'utilise pour compiler mon code.
Mon makefile est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 CC -V CC: Sun WorkShop 6 update 1 C++ 5.2 Patch 109508-08 2002/03/07
Lorsque je fais 'gmake', voici les résultats :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 CC=CC CFLAGS=-I/home/xxx/libSql/include/ -I/home/xxx/libSql/include/mysql/ LDFLAGS=-L/home/xxx/libSql/lib/ -lmysqlclient all: main main: main.o LibSql.o @echo "--------------------" @echo "- MAIN -" @echo "--------------------" $(CC) $(LDFLAGS) -o main bin/main.o bin/LibSql.o main.o: main.cc @echo "--------------------" @echo "- MAIN.o -" @echo "--------------------" $(CC) $(CFLAGS) -o bin/main.o -c main.cc LibSql.o: src/LibSql.cc @echo "--------------------" @echo "- LibSQL.o -" @echo "--------------------" $(CC) $(CFLAGS) -o bin/LibSql.o -c src/LibSql.cc clean: rm -f bin/*.o
Le fichier libmysqlclient.a est pourtant bien présent dans le répertoire lib/ que je précise. De plus lorsque je fais 'nm lib/libmysqlclient.a | grep mysql_init' par exemple j'obtiens :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40 -------------------- - MAIN.o - -------------------- CC -I/home/xxx/libSql/include/ -I/home/xxx/libSql/include/mysql/ -o bin/main.o -c main.cc -------------------- - LibSQL.o - -------------------- CC -I/home/xxx/libSql/include/ -I/home/xxx/libSql/include/mysql/ -o bin/LibSql.o -c src/LibSql.cc -------------------- - MAIN - -------------------- CC -L/home/xxx/libSql/lib/ -lmysqlclient -o main bin/main.o bin/LibSql.o Undefined first referenced symbol in file mysql_rollback bin/LibSql.o mysql_stmt_init bin/LibSql.o mysql_close bin/LibSql.o mysql_fetch_lengths bin/LibSql.o mysql_num_fields bin/LibSql.o mysql_num_rows bin/LibSql.o mysql_fetch_row bin/LibSql.o mysql_real_query bin/LibSql.o mysql_real_connect bin/LibSql.o mysql_commit bin/LibSql.o mysql_stmt_close bin/LibSql.o mysql_fetch_field bin/LibSql.o mysql_stmt_error bin/LibSql.o mysql_stmt_execute bin/LibSql.o mysql_autocommit bin/LibSql.o mysql_errno bin/LibSql.o mysql_stmt_param_count bin/LibSql.o mysql_error bin/LibSql.o mysql_store_result bin/LibSql.o mysql_affected_rows bin/LibSql.o mysql_stmt_prepare bin/LibSql.o mysql_stmt_bind_param bin/LibSql.o mysql_init bin/LibSql.o ld: fatal: Symbol referencing errors. No output written to main gmake: *** [main] Error 1
Ceci prouve bien que les symboles existent, non ? J'ai essayé avec une version 32 bits de la libmysqlclient.a, une 64 bits, pour les version 5.9, 5.10 de solaris ... bref je comprends pas le problème ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 [197] | 0| 0|FUNC |GLOB |0 |UNDEF |mysql_init [120] | 7892| 224|FUNC |GLOB |0 |2 |mysql_init [134] | 8724| 516|FUNC |GLOB |0 |2 |mysql_init_character_set![]()
Merci de m'éclairer sur le sujet
edit : Faute de place sur le serveur, je ne peux compiler la librairie via les sources de MySQL, donc je télécharge la version 5.8 64 bits de MySQL et je récupère la bibliothèque contenue dans le .tar, peut-être est-ce cela ?![]()
![]()
![]()
Partager