如何在文件夹中组织源代码文件(.cpp& hpp)

时间:2012-10-06 22:23:08

标签: c++ cascade

我是一名java开发人员和C ++初学者,我想在文件夹中组织源代码文件(.cpp& hpp)文件,作为JAVA中的包

这是我的main.cpp

// Navigation pane project template
#include "FriendFinderOnBBM.hpp"
#include <bb/cascades/Application>

#include <QLocale>
#include <QTranslator>

using namespace bb::cascades;

int main(int argc, char **argv)
{
    // this is where the server is started etc
    Application app(argc, argv);

    // localization support
    QTranslator translator;
    QString locale_string = QLocale().name();
    QString filename = QString( "FriendFinderOnBBM_%1" ).arg( locale_string );
    if (translator.load(filename, "app/native/qm")) {
        app.installTranslator( &translator );
    }

    // create the application pane object to init UI etc.
    new FriendFinderOnBBM(&app);
    // we complete the transaction started in the app constructor and start the client event   loop here
    return Application::exec();
    // when loop is exited the Application deletes the scene which deletes all its children (per   qt rules for children)
}

我将cpp和hpp放入名为presentation的文件夹中 这是FriendFinderOnBBM.cpp

// Navigation pane project template
#include "FriendFinderOnBBM.hpp"

#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>

using namespace bb::cascades;

FriendFinderOnBBM::FriendFinderOnBBM(bb::cascades::Application *app)
    : QObject(app)
{
    // create scene document from main.qml asset
    // set parent to created document to ensure it exists for the whole application lifetime
    QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);

    // create root object for the UI
    AbstractPane *root = qml->createRootObject<AbstractPane>();
    // set created root object as a scene
    app->setScene(root);
}

这是存在于演示文稿夹

中的FriendFinderOnBBM.hpp
// Navigation pane project template
#ifndef FriendFinderOnBBM_HPP_
#define FriendFinderOnBBM_HPP_

#include <QObject>

namespace bb { namespace cascades { class Application; }}

/*!
 * @brief Application pane object
 *
 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
 */
class FriendFinderOnBBM : public QObject
{
    Q_OBJECT
public:
    FriendFinderOnBBM(bb::cascades::Application *app);
    virtual ~FriendFinderOnBBM() {}
};

#endif /* FriendFinderOnBBM_HPP_ */

这是Makefile

QMAKE_TARGET  = FriendFinderOnBBM
QMAKE         = $(QNX_HOST)/usr/bin/qmake
TARGET        = $(QMAKE_TARGET)


all: Makefile $(QMAKE_TARGET)

clean:
$(MAKE) -C ./arm -f Makefile distclean
$(MAKE) -C ./x86 -f Makefile distclean


Makefile: FORCE
$(QMAKE) -spec unsupported/blackberry-armv7le-qcc -o arm/Makefile $(QMAKE_TARGET).pro         CONFIG+=device
$(QMAKE) -spec unsupported/blackberry-x86-qcc -o x86/Makefile $(QMAKE_TARGET).pro     CONFIG+=simulator
$(MAKE) -C ./translations -f Makefile update release

FORCE:

$(QMAKE_TARGET): device simulator

device:
$(MAKE) -C ./arm -f Makefile all

Device-Debug: Makefile
$(MAKE) -C ./arm -f Makefile debug

Device-Release: Makefile
$(MAKE) -C ./arm -f Makefile release

simulator:
$(MAKE) -C ./x86 -f Makefile all

Simulator-Debug: Makefile
$(MAKE) -C ./x86 -f Makefile debug

现在我的问题:编译器找不到我放入文件夹“presentation”的两个源代码

由于

0 个答案:

没有答案