TreeFrog折腾记(1)

推荐文章: TreeFrog Framework(C++ web framework, based on Qt)开发环境搭建

TreeFrog Framework官方地址:http://www.treefrogframework.org/

编译平台及软件:MacBook Air macos 10.11.6 Xcode Version 8.0 (8A218a) Qt5.6.1 mysql5.6.34

首先需要在环境变量中添加qmake路径

编译步骤:

Step 1:

cd $HOME/Downloads

git clone git@github.com:treefrogframework/treefrog-framework.git

cd TreeFrog


Step 2:

./configure 

configure 有很多选项供选择: 

Configuration:

  -h, --help          display this help and exit

  --enable-debug      compile with debugging information(开启调试功能,文档推荐做法)

  --enable-gui-mod    compile and link with QtGui module

Installation directories:

  --prefix=PREFIX     install files in PREFIX [/usr/local](安装目录,默认/usr/local,本人使用$HOME/Dev/TreeFrog)

Fine tuning of the installation directories:

  --bindir=DIR        user executables [/usr/local/bin]

  --libdir=DIR        object code libraries [/usr/local/lib]

  --includedir=DIR    C++ header files [/usr/local/include/treefrog]

  --datadir=DIR       read-only architecture-independent data [/usr/local/share/treefrog]


Step 3:

cd src

make 

sudo make install

note:在make时会出现错误 TargetConditionals.h' file not found

解决办法:打开Qt/5.6/clang_64/mkspecs/qdevice.pri 文件加入如下行:!host_build:QMAKE_MAC_SDK = macosx10.xx
注意:macos10.xx 是基于Xcode版本填写,查看版本的可以打开如下路径:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.xx.sdk.(MacOSX10.xx.sdk就是路径)
将报错解决完之后再次make

Step 4:

cd ../tools

make

sudo make install

note:基本这里不会出现错误,出现错误纯属人品爆发

以上编译完成之后再--prefix所指定的目录下会出现如下:

编译完成之后的文件编译完成之后的文件

按照官方文档http://www.treefrogframework.org/documents/tutorial这篇文章所示进行工程创建,我在使用MySql时总是会报错:

DriverType: QMYSQL
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers: QSQLITE QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7
Parameter 'DriverType' is invalid or RDB client library not available.

解决办法:编译Qt MySql驱动,将/usr/local/mysql/lib/libmysqlclient.18.dylib文件放入/usr/local/lib文件夹中,变会解决问题。

按照tutorial这篇文章运行blogapp结果如下:

​Next Plan:准备将TreeFrog移植到Raspberry Pi


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值