QxOrm 是一个基于QT开发的数据库方面的ORM库,功能很强大,是QT C++数据开发方面的好工具。
目前已经更新1.3.1 。但 不幸的是 它的官网http://www.qxorm.com/ 莫名其奇妙的进不去,要FQ才可以
访问,但是即使FQ,好像也不能下上面的东西。另外这软件的sourceforg 网址也不能下载 ,只留个 文本文件指向官网。
找来找去找了个 1.2.9 版本的,比目前 普遍的1.2.6版本 要新一点。这是下载地址。
http://download.csdn.net/detail/hyjjkk/8542061
编译方法:
1,这是官网提供的编译 boost serialization 库的方法:
-----------------------------
NOTE FOR MSVC++ AND QT4 ONLY :
------------------------------
By default, Qt4 is built using "/Zc:wchar_t-" compiler option (this is not true with Qt5 !).
So we add cxxflags="/Zc:wchar_t- " parameter to bjam to build boost libraries in the same way.
But, to remove the following warning : "Command line warning D9025 : overriding ‘/Zc:wchar_t‘ with ‘/Zc:wchar_t-‘".
We have to modify ‘./tools/build/v2/tools/msvc.jam‘ file and remove ‘/Zc:wchar_t‘ in compiler options.
For QxOrm library, it‘s used only if you are working with boost wide serialization library.
------------------------------
-----------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2008 :
-----------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-9.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe -d2 --build-dir=build --toolset=msvc-9.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install
-----------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2010 :
-----------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-10.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe -d2 --build-dir=build --toolset=msvc-10.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install
-------------------------------------------------------
COMMAND LINE TO BUILD USING MINGW GCC 4.5.1 AND 4.9.1 :
-------------------------------------------------------
bjam.exe --build-dir=build --toolset=gcc --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe --build-dir=build --toolset=gcc --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install
--------------------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2012 (32bits) :
--------------------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-11.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe -d2 --build-dir=build --toolset=msvc-11.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install
--------------------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2012 (64bits) :
--------------------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-11.0 address-model=64 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe -d2 --build-dir=build --toolset=msvc-11.0 address-model=64 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install
例如vs2010的编译指令为:
bjam.exe -d2 --build-dir=build --toolset=msvc-10.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
注意:
另外对于 QT4版本来说,由于 QT4库默认是 用 /Zc:wchar_t-编译的,而boost 默认是不用 /Zc:wchar_t-那么如果要用到 boost wide serialization library 宽字符版本
那么需要在 编译命令行选项加 cxxflags="/Zc:wchar_t-或者 修改 ./tools/build/v2/tools/msvc.jam‘文件 删除‘/Zc:wchar_t‘选项.
对于不用 宽字符版本的 serialization 用户来说,可以不用开启 /Zc:wchar_t-来编译serialization 库 ,QxOrm也是同样可以编译的通过的。
设置环境变量:
qt路径,boost路径,需要设置正确,否则编译可能出错
具体请参考 代码中的文档中的 \QxOrm\doc\qxorm_en\tutorial_3.html
做好以上准备,用QTCreator 打开QxOrm.pro 就可以编译了.