Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Netbeans + Qt + Build Problem

Empfohlene Antworten

Veröffentlicht

Hallo Leute!

Ich bin noch totaler Anfänger was Netbeans und Qt angeht. Ich habe folgendes Problem:

Ich habe eine Qt Application mithilfe eines

Tutorials (Working with Qt Applications - NetBeans IDE 6.7/6.8 Tutorial) erstellt und wollte mir das Resultat anschauen. Allerdings bekomme ich folgende Fehlermeldung beim bauen des Projekts:

/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf

make[1]: Entering directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

/E/Qt/qt/bin/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro

mv -f qttmp-Debug.mk nbproject/qt-Debug.mk

/bin/make -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/QtApplication_1.exe

make[2]: Entering directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o dist/Debug/MinGW-Windows/QtApplication_1.exe build/Debug/MinGW-Windows/TestForm.o build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/moc_TestForm.o -L'e:/Qt/qt/lib' -lmingw32 -lqtmaind build/Debug/MinGW-Windows/QtApplication_1_resource_res.o -lm -lz -lpthread -lQtGuid4 -lQtCored4

e:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lz

collect2: ld returned 1 exit status

make[2]: *** [dist/Debug/MinGW-Windows/QtApplication_1.exe] Error 1

make[2]: Leaving directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

make[1]: *** [.build-conf] Error 2

make[1]: Leaving directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 2s)

Meine Systemvariable Path ist folgendermaßen eingestellt:

E:\MSYS\bin;E:\Qt\bin;E:\Qt\qt\bin;E:\MinGW\bin;E:\MinGW\lib;E:\MinGW\include;e:\ENTWIC~1\BORLAN~1\Projects\Bpl;e:\ENTWIC~1\BORLAN~1\Bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;E:\Cygwin\bin;

Ich hoffe, dass sich hier jemand damit auskennt und mir sagt woran dieser Fehler liegen kann. Konsolenanwendungen funktionieren übrigens tadelos. Also nehme ich an, dass das etwas mit Qt zu tun haben muss.

Mfg

Filemaker

Ich hab mal im lib Ordner des MinGW nachgeschaut. Die libs, die du gesagt hast sind nicht enthalten.

Ich habe unter folgendem Verzeichnis nachgeguckt:

E:\MinGW\lib

Wie kann ich die Libs nun hinzufügen bzw. wo gibt es diese Libs?

So, ich habe mir die Dateien mal heruntergeladen (Ich hoffe das sind die Richtigen).

Ich habe nun folgende Dateien:

libz.a

libz.dll.a

zconf.h

zlib.h

libz-1.dll

Die ersten zwei habe ich in das Verzeichnis E:\MinGW\lib gepackt und die zwei Headerdateien in E:\MinGW\include

Die letzte habe ich in E:\MinGW\bin gepackt.

Ich hoffe, dass ich das so richtig gemacht habe.

Das Ganze funktioniert aber leider immer noch nicht, stattdessen bekomme ich jetzt eine andere Fehlermeldung:

/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf

make[1]: Entering directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

/E/Qt/qt/bin/qmake.exe VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro

mv -f qttmp-Debug.mk nbproject/qt-Debug.mk

/bin/make -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/QtApplication_1.exe

make[2]: Entering directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -Wl,-subsystem,windows -o dist/Debug/MinGW-Windows/QtApplication_1.exe build/Debug/MinGW-Windows/TestForm.o build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/moc_TestForm.o -L'e:/Qt/qt/lib' -lmingw32 -lqtmaind build/Debug/MinGW-Windows/QtApplication_1_resource_res.o -lQtGuid4 -lQtCored4

e:/Qt/qt/lib/libqtmaind.a(qtmain_win.o): In function `WinMain@16':

C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/qtmain_win.cpp:93: undefined reference to `_Unwind_Resume'

C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'

e:/Qt/qt/lib/libqtmaind.a(qtmain_win.o):C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:481: undefined reference to `_Unwind_Resume'

e:/Qt/qt/lib/libqtmaind.a(qtmain_win.o):C:\qt-greenhouse\Trolltech\Code_less_create_more\Trolltech\Code_less_create_more\Troll\4.6\qt\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:482: undefined reference to `_Unwind_Resume'

e:/Qt/qt/lib/libqtmaind.a(qtmain_win.o):qtmain_win.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'

collect2: ld returned 1 exit status

make[2]: *** [dist/Debug/MinGW-Windows/QtApplication_1.exe] Error 1

make[2]: Leaving directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

make[1]: *** [.build-conf] Error 2

make[1]: Leaving directory `/c/Users/Guido/Documents/NetBeansProjects/QtApplication_1'

make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 2s)

Ich hab so das Gefühl, dass die Fehlermeldung irgendwie gar nichts mit der Lib zu tun hat.

Ich weiß jetzt überhaupt nicht was ich noch machen soll, damit Netbeans dieses Projekt endlich baut.

Sieht so aus, als ob libstdc++ nicht dazugelinkt wird. Eigentlich sollte der g++ das von selbst machen.

Ich weiß nicht, inwieweit du die Compiler-Kommandozeilenoptionen in deiner Entwicklungsumgebung beeinflussen kannst, aber da scheint mir ein -lstdc++ zu fehlen.

jetzt leider keine Antowrt auf deine frage. Aber warum nimmst du net einfach den QT Creator? Der Wurde extra von Nokia für Entwicklungen unter QT Entwickelt und hat sogar eine Dokumentation mit drinne. Wodurch du dir viele Tutorials sparen kannst.

Zu deiner Direkten Frage:

Für mich sieht das so aus als ob die Datei

qtmain_win.o fehlerhaft ist. Versuch das gesammte Projekt mal neu zu Compilieren nachdem du alle dateien gelöscht hast die du nicht selbst geschrieben hast.

Alles klar!

Danke für die Antworten!

Ich werde die Vorschläge mal ausprobieren.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.