`
huozheleisi
  • 浏览: 1233796 次
文章分类
社区版块
存档分类
最新评论

CGAL环境设置--Show How to Install and Usage

 
阅读更多

The following is one way of installing CGAL on windows (Written by Itay Harel):

1) Install Microsoft Visual Studio 2008(Version 9).
2) Install BOOST.
Activate the boost installer from within the link below (supplied by Efi Fogel):
http://www.boost-consulting.com/download.html
A wizard opens. After a few stages you are required to select your version of visual studio.
In the variant checkboxes, I checked them all since I didn't know which type of built libraries I need.
The next screen displays all boost components. Again, I left them all selected since I didn't know I which of boost component CGAL uses.
3) Install CGAL.
Fill the short questionair in http://www.cgal.org/download/index.html (link by Efi Fogel).
After submittion, you’ll be directed to the downloading screen.
Download CGAL 3.2.1, Windows Installer EXE (14.2MB) and run it.
Notice that it also installs GMP and MPFR (let it install all component.
Important note:
There is a good change that the installer might report near the end that it cannot find some file that it need to set some parameters in. These are path name where visual studio should look for CGAL components.

4) Open visual studio. Choose the Tools menu. Choose options. Go to the projects tab.
Select VC++ Directories.
On the upper right corner select ‘Include Files’. If you got the 4 error messages in the CGAL installation now is the time to manually add the include paths.
Add:

a. $(CGALROOT)/include

b. $(CGALROOT)/include/CGAL/config/msvc7

c. $(CGALROOT)/auxiliary/gmp/include

d. $(CGALROOT)/auxiliary/taucs/include

e. $(CGALROOT)/auxiliary/zlib/include
Also, if you can’t see $(BOOST)/ anywhere, add it.
Now select ‘Library files’ (in the upper right corner).
Verify/Add the following:

f. $(CGALROOT)/lib/msvc7

g. $(CGALROOT)/auxiliary/gmp/lib

h. $(CGALROOT)/auxiliary/taucs/lib

i. $(CGALROOT)/auxiliary/zlib/lib

j. $(BOOST)/lib

5) Install Glut
A small change was made in glut.h to make it work (according to http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20745841.html )

a. Put glut32.dll in %WinDir%/System (e.g. C:/Windows/System).

b. Put glut.h in …/Microsoft Visual Studio .NET/Vc7/PlatformSDK/Include/gl

c. Put glut32.lib in …/Microsoft Visual Studio .NET/Vc7/PlatformSDK/Lib

至此,环境配置完成。下面测试历程:

6) Copy one of the projects in …/CGAL-3.2.1/examples to your projects folder.
For example:
CGAL-3.2.1/examples/Polygon/Example.vcproj (You can rename it later) and
CGAL-3.2.1/examples/Polygon/Example.c

7) Open that project. Try to build the solution (You’ll be asked to save the solution first).
Try to run it.

8) If all goes well, remove the existing C/CPP or H files from the project.
Copy the sample program files provided by Ophir to your project library.
Add them to the solution.

9) Open the ‘Assign2.cpp’ and remove the first include line (#include <GL/gl.h>)

10) Try to build the solution.
Add the input text file to the command line parameters in Project->Properties
->configuration Properties->Debugging.

11) Try to run the program.

另外,按照上述配置的环境只能在Release下工作。下面是在Release上可调试的做法:

问题:在release模式下如何设置断点进行调试?
答:一般情况下,release模式设置断点是不起作用的。但是,在进行了以下设置之后就可以和debug模式一样进行调试了。
第一,用鼠标右击当前的工程,然后点击c/c++,在右边会现在Debug Information Format一栏,建议里面改为"Program Database (/Zi)". 注意默认为"Disabled"。
第二,确保Linker->Debugging-->Generate Debug Info应该是"Yes(/DEBUG)".

有了以上两点就可以了。但是呢,这样编译出来的*.exe运行起来可能不是特别快。所以在完成代码之后呢,建议将以上两点恢复原来设置,使得达到release模式应用的效率。

另外一种配置方法:

http://acg.cs.tau.ac.il/cgal-at-tau/installing-cgal-and-related-programs-on-windows

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics