Sequence: A simple project to test Netbeans setup / build
- Install the Gnu build system
- Test Gnu build system with a simple helloworld C++ program
- Install the Qt libraries you want to use.
- Test the Qt libraries with another small test program that utilizes the Qt libraries
- Appears according to various locations that Sun / Oracle NetBeans Java JDK etc are not available in the package repositories. I downloaded the everything pack from Oracle directly. Download here.
- Create a program per normal NetBeans with Qt procedure.
The entire batch of settings appeared to set themselves automatically in netbeans. I assume this is because of setting all the path variables to get Qt to work under command line interface builds.
The only snag I hit was when I tried to run the first test program it reported: "App does not exist or is not an executable." I must have goofed a setting – when first installed netbeans I thought I had to specify where the Qt libraries were. This was not necessary.
As per this page I started from scratch with another test project and everything worked.
A more complex import to netbeans: Chapter 4 of Qt3 book source code SpreadSheet Example
NetBeans Problem: App does not exist or is not an executable
- To see where the target is placed in a netbeans project started from scratch: right click project in the NetBeans object browser > properties > packaging > packaging files >
- When a netbeans project is generated from scratch it puts the compiled target in a subfolder:= dist/Debug/GNU-Linux=x86/ProjectName/{OUTPUT_PATH} ="" in the default.
-
The reason for App does not exist or is not an executable is because my first attempt at an imported project put the compiled target in the top folder which has the name = ProjectName instead of the subfolder dist/Debug/GNU-Linux=x86/ProjectName/ which NetBeans expects to see. It got placed there when I use gcc from command line interface.
This is due to the make file being made by the command line method giving no target folder. Everything was made and placed in the top folder. - To avoid App does not exist or is not an executable make a dummy new project of the same name. It will come up with only main.cpp in it. Build this project and Netbeans and company will create the standard directory structure. Then replace it with the main.cpp from the project you are importing.
- Status at this point: I get the following error. It is forcing me to learn more about make files.
make[1]: Entering directory `/home/freemonsandlewould/NetBeansProjects/QtApplication_3'
/usr/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_3
make[2]: Entering directory `/home/freemonsandlewould/NetBeansProjects/QtApplication_3'
make[2]: *** No rule to make target `gotocelldialog.h', needed by `dist/Debug/GNU-Linux-x86/QtApplication_3'. Stop.
make[2]: Leaving directory `/home/freemonsandlewould/NetBeansProjects/QtApplication_3'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/freemonsandlewould/NetBeansProjects/QtApplication_3'
make: *** [.build-impl] Error 2
‘No rule to make target `xxx'.’
‘No rule to make target `xxx', needed by `yyy'.’
This means that make decided it needed to build a target, but then couldn't find any instructions in the makefile on how to do that, either explicit or implicit (including in the default rules database).
If you want that file to be built, you will need to add a rule to your makefile describing how that target can be built. Other possible sources of this problem are typos in the makefile (if that filename is wrong) or a corrupted source tree (if that file is not supposed to be built, but rather only a prerequisite).
NetBeans: New Project > C++ project with existing source
- At this point I encountered this page: NetBeans with Qt3 I did the project import using the existing SpreadSheet project that I had previously successfully built using command line interface. It successfully built under NetBeans direction. It is important that I built successfully previously as Netbeans used all that was in place as was. This is because it uses the make file. I doubt qmake -project or qmake will will be called to update the .pro or make file if something requiring it occurs.
- SpreadSheet example project code here
Qt Build File Generation Study
- qmake -project generates the .pro project file
- qmake generates the makefile for the gcc compiler. Statements invoking the MOC meta object compiler are added to the make file.
- make does what a standard make step does using the Makefile. Includes the MOC invocations. Generates: moc_FileName FileName.o links and makes the executable
How would .pro and make file be updated under netbeans when needed?
Qt Build: How to specify directories to keep your project file directory organized
- Specify Debug, Release, Object, .moc build directories – qmake variable reference – See the Qt4 SpreadSheet example: QT
- Imported the Qt4 SpreadSheet project into NetBeans
0 Comments