This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
KUbuntu 10.10 with cppunit Scenario: - Create Qt project - Open main.h file - Create easy function void c() { } - Call context menu and select "Create Test|New CppUnit Test..." - Select All and press Next button, Press Finish button - Run Test alt + F6 Get Error Log (multiple definition of `main') "/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE=/home/dix/qtsdk-2010.05/qt/bin/qmake SUBPROJECTS= .build-conf make[1]: Вход в каталог `/home/dix/NetBeansProjects/QtApplication_1' /home/dix/qtsdk-2010.05/qt/bin/qmake VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro mv -f qttmp-Debug.mk nbproject/qt-Debug.mk "/usr/bin/make" -f nbproject/qt-Debug.mk dist/Debug/GNU-Linux-x86/QtApplication_1 make[2]: Вход в каталог `/home/dix/NetBeansProjects/QtApplication_1' g++ -m64 -Wl,-rpath,/home/dix/qtsdk-2010.05/qt/lib -o dist/Debug/GNU-Linux-x86/QtApplication_1 build/Debug/GNU-Linux-x86/newsimpletest.o build/Debug/GNU-Linux-x86/main.o -L/home/dix/qtsdk-2010.05/qt/lib -lQtGui -L/home/dix/qtsdk-2010.05/qt/lib -L/usr/X11R6/lib64 -lQtCore -lpthread make[2]: Выход из каталога `/home/dix/NetBeansProjects/QtApplication_1' build/Debug/GNU-Linux-x86/main.o: In function `main': make[1]: Выход из каталога `/home/dix/NetBeansProjects/QtApplication_1' /home/dix/NetBeansProjects/QtApplication_1/main.cpp:13: multiple definition of `main' build/Debug/GNU-Linux-x86/newsimpletest.o:/home/dix/NetBeansProjects/QtApplication_1/tests/newsimpletest.cpp:24: first defined here collect2: ld returned 1 exit status make[2]: *** [dist/Debug/GNU-Linux-x86/QtApplication_1] Ошибка 1 make[1]: *** [.build-conf] Ошибка 2 make: *** [.build-impl] Ошибка 2 ПОСТРОИТЬ FAILED (значение выхода 2, общее время: 698мс)
we do not support unit tests for Qt projects yet. you could try to create test targets manually: http://nnnnnk.name/unittests/nb69unittests_for_existing.html
I don't using QT. I have a similar problem when generating multiple cppunit tests as described here: http://netbeans.org/kb/docs/cnd/c-unit-test.html#addmore If I only have one cppunit-test everything compiles fine. Whenever I create a second test then I got following compile warnings and errors: "make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make[1]: Entering directory `/home/ha/NetBeansProjects/cpputils/tags/1.0/db' nbproject/Makefile-Debug.mk:107: warning: overriding commands for target `build/Debug/GNU-Linux-x86/tests/TestFiles/f2' nbproject/Makefile-Debug.mk:73: warning: ignoring old commands for target `build/Debug/GNU-Linux-x86/tests/TestFiles/f2' "make" -f nbproject/Makefile-Debug.mk build/Debug/GNU-Linux-x86/tests/TestFiles/f2 make[2]: Entering directory `/home/ha/NetBeansProjects/cpputils/tags/1.0/db' nbproject/Makefile-Debug.mk:107: warning: overriding commands for target `build/Debug/GNU-Linux-x86/tests/TestFiles/f2' nbproject/Makefile-Debug.mk:73: warning: ignoring old commands for target `build/Debug/GNU-Linux-x86/tests/TestFiles/f2' mkdir -p build/Debug/GNU-Linux-x86/tests/TestFiles g++ -std=c++0x -o build/Debug/GNU-Linux-x86/tests/TestFiles/f2 build/Debug/GNU-Linux-x86/tests/tests/DbResultTestClass.o build/Debug/GNU-Linux-x86/tests/tests/dbresulttestrunner.o build/Debug/GNU-Linux-x86/DbRow_nomain.o build/Debug/GNU-Linux-x86/Db_nomain.o build/Debug/GNU-Linux-x86/DbCtrl_nomain.o build/Debug/GNU-Linux-x86/DbResult_nomain.o build/Debug/GNU-Linux-x86/postgre_nomain.o build/Debug/GNU-Linux-x86/DbRow.o build/Debug/GNU-Linux-x86/Db.o build/Debug/GNU-Linux-x86/DbCtrl.o build/Debug/GNU-Linux-x86/DbResult.o build/Debug/GNU-Linux-x86/postgre.o -lcppunit -lcppunit -lcppunit build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::operator<<(std::basic_ostream<char, std::char_traits<char> >&, ape::db::DbRow&)': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:15: multiple definition of `ape::db::operator<<(std::basic_ostream<char, std::char_traits<char> >&, ape::db::DbRow&)' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:15: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::DbRow::operator bool()': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:33: multiple definition of `ape::db::DbRow::operator bool()' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:33: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::DbRow::operator[](int)': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:45: multiple definition of `ape::db::DbRow::operator[](int)' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:45: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `DbRow': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:23: multiple definition of `ape::db::DbRow::DbRow(ape::db::DbRow const&)' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:23: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::DbRow::operator=(ape::db::DbRow const&)': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:27: multiple definition of `ape::db::DbRow::operator=(ape::db::DbRow const&)' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:27: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::DbRow::operator[](ape::String)': /home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:37: multiple definition of `ape::db::DbRow::operator[](ape::String)' build/Debug/GNU-Linux-x86/DbRow_nomain.o:/home/ha/NetBeansProjects/cpputils/tags/1.0/db/DbRow.cpp:37: first defined here build/Debug/GNU-Linux-x86/DbRow.o: In function `ape::db::DbRow::operator[](char const*)': .... and so on