Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

e-r-a-n

macrumors member
Original poster
Jan 5, 2012
46
0
as part of my current project, I need to use the cgal library.
therefore, i installed macports and used a command line to install the cgal files.
i have under /opt/local/include/cgal/ a bunch of headers and some lib files under /opt/local/lib/

i took a demo main.cpp, with just includes of some headers and a short main with "hello" print line.
i added the include/cgal and local/lib/ as build path headers in my project settings under xcode:
http://i47.tinypic.com/16iuzhg.jpg

afterwards i compiled the code from an example, but removed the main to a simple print, just to see if i can compile it successfuly, so i used this code:
http://i48.tinypic.com/2ca5xw.jpg

it seems the build settings did help, but i still got this:
http://i49.tinypic.com/ipp1ro.jpg

Im not sure what i did wrong and how to treat this issue.
 

misee

macrumors member
Jul 4, 2010
65
0
I tried to recreate your problem and found that making the header search path non-recursive resolves those errors. To do that, just double click the search path in Xcode and choose non-recursive.
 

e-r-a-n

macrumors member
Original poster
Jan 5, 2012
46
0
Thank you for the effort
however, i tried again and changed, it surely helped but i still havent got too much further.
this is the new deal:

i highly appreciate your help

one more question, assuming my problems are over and it all compiles fine,
is it possible to use the executable under windows somehow?
so that i'll develop under osx but be able to use it also on windows?
Im asking because its a part of a project which is intended to run under windows.
but because installing cgal under windows was a major problem for me, i tried it on my home mac computer
 

Attachments

  • Screen Shot 2012-11-05 at 8.32.35 PM.png
    Screen Shot 2012-11-05 at 8.32.35 PM.png
    252.8 KB · Views: 512

misee

macrumors member
Jul 4, 2010
65
0
Min_sphere_of_spheres_d_traits_3.h appears to rely on some types declared in other headers, that's why you are getting the errors. If you include Min_sphere_of_spheres_d.h before Min_sphere_of_spheres_d_traits_3.h it should work.
one more question, assuming my problems are over and it all compiles fine,
is it possible to use the executable under windows somehow?
so that i'll develop under osx but be able to use it also on windows?
As long as you use only libraries and functions that are available for windows as well, there should be no problems. You will however have to recompile it for windows.
 

e-r-a-n

macrumors member
Original poster
Jan 5, 2012
46
0
first of all, thank you. it does work now... i didnt know there're dependencies for min sphere of spheres 3d.

second, When you say "recompile it again for windows", do you mean i need to compile it in a windows environment, or can i do it under xcode but with different settings?
can you explain a bit more?
i only wish to use the cgal library together with some basic iostream functionality
programming under osx is very new to me, as i have my apple machine for about two-three weeks
 
Last edited:

misee

macrumors member
Jul 4, 2010
65
0
The easiest way is probably recompiling it in a windows environment using Visual Studio (at least that's what the CGAL manual says). You can try searching google for cross compilation to create a windows executable on your mac, but since I've never done that, I have no idea how difficult that will be.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.