使用qt设置odb时出错

时间:2014-09-08 19:53:55

标签: c++ qt odb

我目前正在使用Mac OS X 10.9.4,odb 2.3.0和qt 5.3。

我使用他们的unix指南http://wiki.codesynthesis.com/Using_ODB_with_Qt_Creator_on_Linux

安装了odb

我尝试使用qt从他们的网站编译示例(odb-examples-2.3.0)并收到此错误消息:

19:55:15: Running steps for project odbtest...
19:55:15: Configuration unchanged, skipping qmake step.
19:55:15: Starting: "/usr/bin/make" 
odb --database sqlite --profile qt --generate-schema --generate-query --generate-session -I/Applications/Qt/5.3/clang_64/include ../odbtest/employee.hxx
make: odb: No such file or directory
make: *** [employee-odb.cxx] Error 1
19:55:16: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project odbtest (kit: Desktop Qt 5.3.0 clang 64bit)
When executing step "Make"
19:55:16: Elapsed time: 00:00.

我的.pro文件看起来像这样(这几乎是示例的完整副本):

#-------------------------------------------------
#
# Project created by QtCreator 2014-09-07T16:51:45
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = odbtest
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp \
    driver.cxx

HEADERS  += mainwindow.h \
    database.hxx \
    employee.hxx

FORMS    += mainwindow.ui

# List of header files that should be compiled with the ODB compiler.
#
ODB_FILES += employee.hxx

# ODB compiler flags.
#
ODB_FLAGS = --database sqlite --profile qt --generate-schema --generate-query --generate-session

# Select the database we are going to use.
#
DEFINES += DATABASE_SQLITE

# Suppress unknown pragmas GCC warnings.
#
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CXXFLAGS_WARN_ON -Wno-unknown-pragmas

# Link to the ODB runtime libraries.
#
LIBS += -lodb-sqlite
LIBS += -lodb-qt
LIBS += -lodb

# ODB compilation rules. Normally you don't need to change anything here.
#

# Add the Qt headers directory to the ODB include directory list.
#
ODB_FLAGS += -I$$[QT_INSTALL_HEADERS]

# Newer versions of QtCreator do builds in a separate directory. As a
# result, we need to append the source directory to ODB files.
#
for(dir, ODB_FILES) {
  ODB_PWD_FILES += $$PWD/$${dir}
}

odb.name = odb ${QMAKE_FILE_IN}
odb.input = ODB_PWD_FILES
odb.output = ${QMAKE_FILE_BASE}-odb.cxx
odb.commands = odb $$ODB_FLAGS ${QMAKE_FILE_IN}
odb.depends = $$ODB_PWD_FILES
odb.variable_out = SOURCES
odb.clean = ${QMAKE_FILE_BASE}-odb.cxx ${QMAKE_FILE_BASE}-odb.hxx ${QMAKE_FILE_BASE}-odb.ixx ${QMAKE_FILE_BASE}.sql
QMAKE_EXTRA_COMPILERS += odb

odbh.name = odb ${QMAKE_FILE_IN}
odbh.input = ODB_PWD_FILES
odbh.output = ${QMAKE_FILE_BASE}-odb.hxx
odbh.commands = @true
odbh.CONFIG = no_link
odbh.depends = ${QMAKE_FILE_BASE}-odb.cxx
QMAKE_EXTRA_COMPILERS += odbh

我猜,qt无法找到odb。我在qt的info.plist和launchctl中包含了odb的路径,但它没有帮助。

0 个答案:

没有答案