Hello,
C'est la première fois que je rencontre ce problème (mais aussi la première fois que j'écris un truc aussi moche hybride entre C et C++):
Ca ne doit pas venir du Makefile je pense, j'ai fait un copier-coller d'un ancien Makefile qui fonctionne; le voici quand même au cas où:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 ensisun:~/IndSens>make g++ -o main indEntrop.o fonctions.o sample.o -Wall -O3 -funroll-loops -foptimize-register-move -felide-constructors -frerun-loop-opt -fexpensive-optimizations Undefined first referenced symbol in file main /usr/sfw/lib/gcc/sparc-sun-solaris2.10/3.4.3/crt1.o ld: fatal: Symbol referencing errors. No output written to main collect2: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for target `main'
J'ai 4 fichiers .cpp: main,indEntrop,sample,fonctions; et 3 fichiers .h: indEntrop,sample et fonctions.
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 CXX=g++ CXXFLAGS=-Wall LDFLAGS=-Wall OPTFLAGS=-O3 -funroll-loops -foptimize-register-move -felide-constructors -frerun-loop-opt -fexpensive-optimizations #-frename-registers EXEC=main all: $(EXEC) main: indEntrop.o fonctions.o sample.o $(CXX) -o $@ $^ $(LDFLAGS) $(OPTFLAGS) %.o: %.cpp $(CXX) -o $@ -c $< $(CXXFLAGS) $(OPTFLAGS) clean: rm -f *.o rm -f $(EXEC)
Merci d'avance ^^
Benjamin.
Partager