Page 1 of 1

Compiling on Linux/OSX

PostPosted: Sun Nov 25, 2007 11:44 am
by insyzygy
I just wanted to report that the code compiles fine on OSX and linux
using gcc.

I also made a little makefile that will compile all the example programs in one go. To use it (assuming you are on a *nix with g++ in your path),
set things up so that that the include, source, and mains directories
of the example code are subdirectories of the directory containing the makefile and type make.

On OSX if you download apples XCode (free but large) you get the C/C++ compilers.

PostPosted: Mon Nov 26, 2007 12:08 am
by mj

There is certainly demand for a makefile!

Re: Compiling on Linux/OSX

PostPosted: Tue Aug 10, 2010 6:43 pm
by w4gg0n3r
It's good to know that the code compiled for someone else, but I'm getting the following error:

~/c++.learn$ g++ -I . SimpleMonteCarloMain1.cpp
/tmp/ccCneYzI.o: In function `SimpleMonteCarlo1(double, double, double, double, double, unsigned long)':
SimpleMonteCarloMain1.cpp:(.text+0x93): undefined reference to `GetOneGaussianByBoxMuller()'
collect2: ld returned 1 exit status

g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3

Re: Compiling on Linux/OSX

PostPosted: Tue Aug 10, 2010 9:49 pm
by mj
this means that you need to link some other files such as Random1.cpp

Re: Compiling on Linux/OSX

PostPosted: Sat Sep 11, 2010 10:59 pm
by w4gg0n3r
If anybody else is having the same problem, the resolution is here:

Re: Compiling on Linux/OSX

PostPosted: Mon Mar 19, 2012 1:07 am
by juno
Has anyone try to use XCode? How can one include the "include" folder in Xcode? Thanks.