Compiling on Linux/OSX

This forum is to discuss the book "C++ design patterns and derivatives pricing."

Compiling on Linux/OSX

Postby insyzygy » Sun Nov 25, 2007 11:44 am

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.
insyzygy
 
Posts: 3
Joined: Sun Nov 25, 2007 10:30 am

Postby mj » Mon Nov 26, 2007 12:08 am

thanks

There is certainly demand for a makefile!
mj
Site Admin
 
Posts: 1345
Joined: Fri Jul 27, 2007 7:21 am

Re: Compiling on Linux/OSX

Postby w4gg0n3r » Tue Aug 10, 2010 6:43 pm

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




using
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
w4gg0n3r
 
Posts: 7
Joined: Sat Aug 07, 2010 7:47 pm
Location: at-large

Re: Compiling on Linux/OSX

Postby mj » Tue Aug 10, 2010 9:49 pm

this means that you need to link some other files such as Random1.cpp
mj
Site Admin
 
Posts: 1345
Joined: Fri Jul 27, 2007 7:21 am

Re: Compiling on Linux/OSX

Postby w4gg0n3r » Sat Sep 11, 2010 10:59 pm

If anybody else is having the same problem, the resolution is here:

http://stackoverflow.com/questions/3526537/cant-compile-c-in-ubuntu-using-gcc-include-library-problems-collect2-ld-r
w4gg0n3r
 
Posts: 7
Joined: Sat Aug 07, 2010 7:47 pm
Location: at-large

Re: Compiling on Linux/OSX

Postby juno » Mon Mar 19, 2012 1:07 am

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


Return to C++ design patterns and derivatives pricing

Who is online

Users browsing this forum: No registered users and 0 guests