/usr/bin/ld: cannot find : No such file or directory

Bin ich nach diese SDL-tutorial, um zu versuchen, und nutzen einige SDL-Bibliotheken. Mein code ist identisch zu ihrigen aber ich bin immer noch nicht make die Datei, die führt mich zu glauben, das problem ist in meinen makefile die wie folgt aussieht:

CXX = g++
# Update these paths to match your installation
# You may also need to update the linker option rpath, which sets where to look for
# the SDL2 libraries at runtime to match your install
SDL_LIB = -L/usr/local/lib -lSDL2 -Wl,-rpath=/usr/local/lib, -lSDL2_image
SDL_INCLUDE = -I/usr/local/include
# You may need to change -std=c++11 to -std=c++0x if your compiler is a bit older
CXXFLAGS = -Wall -c -std=c++11 $(SDL_INCLUDE)
LDFLAGS = $(SDL_LIB)
EXE = SDL_Lesson3

all: $(EXE)

$(EXE): main.o
    $(CXX) $< $(LDFLAGS) -o $@

main.o: main.cpp
    $(CXX) $(CXXFLAGS) $< -o $@

clean:
    rm *.o && rm $(EXE)

Dass makefile funktionierte gut für die vorangegangenen Beispiele. Das einzige, was sich geändert hat in diesem Beispiel ist Zeile 5 Hinzugefügt, wo ich -lSDL2_image als pro-tutorial. Wenn ich versuche make die Datei bekomme ich folgenden traceback:

rony@comet:~/Documents/cpp/helloworld/lesson3$ make
g++ main.o -L/usr/local/lib -lSDL2 -Wl,-rpath=/usr/local/lib, -lSDL2_image -o SDL_Lesson3
/usr/bin/ld: cannot find : No such file or directory
collect2: error: ld returned 1 exit status
make: *** [SDL_Lesson3] Error 1

Ist es ein Fehler mit meinem makefile? Hab ich nicht installiert die Bibliothek richtig?

Sie haben eine falsche Komma in der end-of-Wl-option.

InformationsquelleAutor Nanor | 2013-12-16

Schreibe einen Kommentar