wangsh 2011-11-17
CGAL的demo确实不错,但是如果遇到下列问题,别慌,我这招仅供参考。
1>------ 已启动生成: 项目: Spatial_searching_2, 配置: Debug Win32 ------
1>Generating Spatial_searching_2.moc
1>moc: Cannot open options file specified with @
1>Usage: moc [options] <header-file>
1> -o<file> write output to file rather than stdout
1> -I<dir> add dir to the include path for header files
1> -E preprocess only; do not generate meta object code
1> -D<macro>[=<def>] define macro, with optional definition
1> -U<macro> undefine macro
1> -i do not generate an #include statement
1> -p<path> path prefix for included file
1> -f[<file>] force #include, optional file name
1> -nw do not display warnings
1> @<file> read additional options from file
1> -v display version of moc
1>Project : error PRJ0019: 某个工具从以下位置返回了错误代码: "Generating Spatial_searching_2.moc"
1>生成日志保存在“file://c:\CGAL-3.9\Build\demo\Spatial_searching_2\Spatial_searching_2.dir\Debug\BuildLog.htm”
1> Spatial_searching_2 - 1 个错误,个警告
解决方案:
复制Spatial_searching_2到Spatial_searching;
使用Qt4.5.0 Command Prompt命令行,进入到Spatial_searching目录下;
依次输入;
qmake –project
qmake Spatial_searching.pro
qmake –tp vc Spatial_searching.pro
编译,但是需要手动添加include和lib路径等;
下面为我添加内容,可供参考;
Include添加:C:\CGAL-3.9\demo\Spatial_searching\..\..\..\Spatial_searching\include;C:\CGAL-3.9\demo\Spatial_searching_2\..\..\include;C:\Qt\4.5.0\include;C:\boost_1_38;C:\CGAL-3.9\auxiliary\gmp\include;C:\CGAL-3.9\include;C:\CGAL-3.9\Build\include;C:\CGAL-3.9\Build\demo\Spatial_searching_2;C:\Qt\4.5.0\include\QtOpenGL;C:\Qt\4.5.0\include\QtScript;C:\Qt\4.5.0\include\QtGui;C:\Qt\4.5.0\include\QtXml;C:\Qt\4.5.0\include\QtCore;
链接添加;
Lib路径:C:\CGAL-3.9\Build\lib\$(OutDir),C:\CGAL-3.9\Build\lib,C:\CGAL-3.9\auxiliary\gmp\lib\$(OutDir),C:\CGAL-3.9\auxiliary\gmp\lib,C:\boost_1_38\lib\$(OutDir),C:\boost_1_38\lib
Lib库:
$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib C:\CGAL-3.9\auxiliary\gmp\lib\libmpfr-4.lib C:\CGAL-3.9\auxiliary\gmp\lib\libgmp-10.lib C:\Qt\4.5.0\lib\qtmaind.lib C:\Qt\4.5.0\lib\QtOpenGLd4.lib C:\Qt\4.5.0\lib\QtGuid4.lib C:\Qt\4.5.0\lib\QtCored4.lib glu32.lib opengl32.lib C:\Qt\4.5.0\lib\qtmaind.lib C:\Qt\4.5.0\lib\QtOpenGLd4.lib C:\Qt\4.5.0\lib\QtScriptd4.lib C:\Qt\4.5.0\lib\QtGuid4.lib C:\Qt\4.5.0\lib\QtXmld4.lib C:\Qt\4.5.0\lib\QtCored4.lib C:\CGAL-3.9\auxiliary\gmp\lib\libmpfr-4.lib C:\CGAL-3.9\auxiliary\gmp\lib\libgmp-10.lib C:\Qt\4.5.0\lib\qtmaind.lib C:\Qt\4.5.0\lib\QtOpenGLd4.lib C:\Qt\4.5.0\lib\QtGuid4.lib C:\Qt\4.5.0\lib\QtCored4.lib glu32.lib opengl32.lib C:\Qt\4.5.0\lib\QtScriptd4.lib C:\Qt\4.5.0\lib\QtXmld4.lib
还有一点,将Spatial_searching_2.cpp中
#include "Spatial_searching_2.moc"
修改为
#include "./debug/Spatial_searching_2.moc"
编译链接,成功!
上图:
同样方法生成Snaprounding:
再来几个demo截图:
再来一个惊艳的demo:
保留版权,如果转载请注明链接:http://blog.csdn.net/wsh6759/article/details/6981058