Das ist der Code von Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 | #include "desktoptest.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <bit>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "DesktopTest_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
DesktopTest w;
w.show();
return a.exec();
}
|
Welche Fehlermeldung möchtest du sehen? Ich komme nicht zum Kompilieren. Das Ganze stockt bereits früher.
Die beiden Zeilen, welche ich angegeben habe, sind gelb unterlegt. Wenn ich mit der Maus darüber gehe, dann kommt die Meldung, dass die Datei nicht existiert oder kein Verzeichnis mit diesem Namen existiert.
Vielleicht hilft der Eintrag unter dem Tab Problem:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 |
<html><body><code style="white-space:pre;font-family:Source Code Pro">
"/bin/clang++-14"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: '/home/renato/cProjekte/DesktopTest/build/Desktop_Qt_6_10_0-Release/CMakeFiles/CMakeScratch/TryCompile-H7DAcO'
Run Build Command(s): /home/renato/Qt/Tools/Ninja/ninja -v cmTC_4df24
[1/2] /bin/clang++-14 -MD -MT CMakeFiles/cmTC_4df24.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_4df24.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_4df24.dir/testCXXCompiler.cxx.o -c /home/renato/cProjekte/DesktopTest/build/Desktop_Qt_6_10_0-Release/CMakeFiles/CMakeScratch/TryCompile-H7DAcO/testCXXCompiler.cxx
[2/2] : && /bin/clang++-14 CMakeFiles/cmTC_4df24.dir/testCXXCompiler.cxx.o -o cmTC_4df24 && :
FAILED: cmTC_4df24
: && /bin/clang++-14 CMakeFiles/cmTC_4df24.dir/testCXXCompiler.cxx.o -o cmTC_4df24 && :
/bin/ld: -lstdc++ kann nicht gefunden werden: Datei oder Verzeichnis nicht gefunden
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.</code></body></html>
|
Und noch die CMakeList.txt
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
32
33
34
35
36
37
38
39
40 | cmake_minimum_required(VERSION 3.19)
project(DesktopTest LANGUAGES CXX)
find_package(Qt6 6.5 REQUIRED COMPONENTS Core Widgets LinguistTools)
qt_standard_project_setup()
qt_add_executable(DesktopTest
WIN32 MACOSX_BUNDLE
main.cpp
desktoptest.cpp
desktoptest.h
desktoptest.ui
)
qt_add_translations(
TARGETS DesktopTest
TS_FILES DesktopTest_de_CH.ts
)
target_link_libraries(DesktopTest
PRIVATE
Qt::Core
Qt::Widgets
)
include(GNUInstallDirs)
install(TARGETS DesktopTest
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
qt_generate_deploy_app_script(
TARGET DesktopTest
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
)
install(SCRIPT ${deploy_script})
|
Hilft das weiter?
Gruss Renato