Compile Error
-
Tipp: da fehlt irgendwo ein static
-
@patrick246 da fehlt kein static
-
patrick246 schrieb:
Tipp: da fehlt irgendwo ein static
nope, eher das die logger.cpp nicht mit übersetzt und das ergebnis mit gelinkt wird
-
Und das ist BTW ein Linker Fehler. Alles mit "undefined reference" oder "multiple definition" sind Linker Fehler.
-
Nathan schrieb:
Und das ist BTW ein Linker Fehler. Alles mit "undefined reference" oder "multiple definition" sind Linker Fehler.
static_assert(false, "undefined reference");
-
Und wie könnte ich das mit Cmake fixen?
-
Soljer schrieb:
Und wie könnte ich das mit Cmake fixen?
logger.cpp zu den Sourcedateien gelistet bei add_executable hinzufügen.
@Arcoth:
-
Doch ich enthalte bereits dies. Hier meine CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(***)set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES src)
add_executable(*** src/main.cpp)include_directories(include)
-
Soljer schrieb:
Doch ich enthalte bereits dies. Hier meine CMakeLists.txt
cmake_minimum_required(VERSION 2.8.4)
project(***)set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES src)
add_executable(*** src/main.cpp)include_directories(include)
ich sehe da keine logger.cpp
-
Mit dies meinte ich die funktion add_executable(). Sie kann doch nur einmal ausgeführt werden´?
Output wenn ich es ein 2. mal versuche:
Error:add_executable cannot create target "***" because another target with the same name already exists. The existing target is an executable created in source directory "C:/***". See documentation for policy CMP0002 for more details.
-
Du kannst hinter add_executable beliebig viele Dateien auflisten:
add_executable(... src/main.cpp src/logger.cpp)
-
Ok Vielen Dank Nathan das hat geholfen