Ich benutze Makefile, um meine einfache Anwendung zu kompilieren. Hier ist es:Linke statische Bibliothek mit gnu g ++: Keine solche Datei oder Verzeichnis, Makefile
Allerdings scheint es, dass ich ein Problem mit der Verknüpfung statischer Bibliothek habe. Das ist mein Ausgang nach der Ausführung make all
:
$ make all
g++ -Wall -c main.cpp
g++ -Wall -c section.cpp
g++ -Wall -c circle.cpp
g++ -Wall -c triangle.cpp
g++ -Wall -c rectangle.cpp
ar rv libfigures.a section.o triangle.o rectangle.o circle.o
ar: creating libfigures.a
a - section.o
a - triangle.o
a - rectangle.o
a - circle.o
g++ -o main.x -Wall main.o section.o circle.o triangle.o rectangle.o libfigures.a main.x main.o section.o circle.o triangle.o rectangle.o
g++: error: main.x: No such file or directory 1
make: *** [main.x] Error 1
Irgendwelche Ideen, was soll ich mit dieser Make-Datei falsch?
'g ++ -o main.x ... main.x ...' sieht seltsam . main.x kommt auf main.x an, was offensichtlich nicht existiert ... –