Précédent   Forum des professionnels en informatique > Systèmes > Autres systèmes > Unix > AIX
AIX Forum d'entraide sur le système AIX. Avant de poster -> FAQ AIX et cours AIX
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
Vieux 22/02/2010, 15h50   #1
Membre du Club
 
Inscription : juillet 2009
Messages : 198
Détails du profil
Informations forums :
Inscription : juillet 2009
Messages : 198
Points : 66
Points : 66
Par défaut XLC et makefile

Bonjour,

Je dois compiler un programme C++ et j'utilise le makefile suivant :
Code :
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
# =====================================================================

TARGETLIB       = api.exe
CODESRC         = api.cpp
TARGETOBJ       = api.o

CC          = /usr/vacpp/bin/xlC_r
CCOPTIONS   =  -+ -O -g  -I/produits/include
LIBCC       = $(CC)
LDOPTIONS   = -G -qmkshrobj=1000 -L/applis/dsgu/data/cpp -lvmdsapi

.SUFFIXES: .cpp .c .o

# ---------------------------------------------------------------------
# Rules
# ---------------------------------------------------------------------

all: $(TARGETLIB)

$(TARGETLIB):   $(TARGETOBJ)
        $(LIBCC) $(LDOPTIONS) $(TARGETOBJ) -o $(TARGETLIB)

$(TARGETOBJ): $(CODESRC)
        $(CC) $(CCOPTIONS) -c $(CODESRC) -o $(TARGETOBJ)

clean:
        @rm -f $(TARGETOBJ) $(TARGETLIB)

# ---------------------------------------------------------------------
# End of makefile
# ---------------------------------------------------------------------
J'obtiens avec le make :

Code :
1
2
3
4
ld: 0711-224 WARNING: Duplicate symbol: .bcopy
ld: 0711-224 WARNING: Duplicate symbol: .memcpy
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Target "all" is up to date.
Quand je lance la programme api.exe j'ai l'erreur suivante :

Code :
1
2
3
4
exec(): 0509-036 Cannot load program api.exe because of the following errors:
        0509-151 The program does not have an entry point or
                   the o_snentry field in the auxiliary header is invalid.
        0509-194 Examine file headers with the 'dump -ohv' command.
DSGSLA est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/04/2010, 16h44   #2
Membre du Club
 
Inscription : juillet 2009
Messages : 198
Détails du profil
Informations forums :
Inscription : juillet 2009
Messages : 198
Points : 66
Points : 66
Ca marche (et en 64 bits) avec le makefile comme ceci :

Code :
1
2
3
4
CC          = /usr/vacpp/bin/xlC_r
CCOPTIONS   = -+ -O -g -q64
LIBCC       = $(CC)
LDOPTIONS   = -q64
DSGSLA est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +1. Il est actuellement 05h24.


 
 
 
 
Partenaires

Hébergement Web