Problems running a simple example in Xcode

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problems running a simple example in Xcode

Jean
I am new to QuantLib, and only have limited expose to C++.
I installed QuantLib and Boost followed the official instruction and try to give it a test.
However, I ran into some problem as follows ('Thread 1: EXC_BAD_ACESS (code=2,address=0x1008e300)'):


Here's the code:
------------------------------------
#include <ql/quantlib.hpp>
#include <iostream>
using namespace QuantLib;

int main (){
    Date date(18, March, 2014);
    std::cout << date << std::endl;
}
-----------------------------------------

And here's how I set path for other Quantlib and Boost headers and Quantlib libraries.:
1)Go to Build Settings of the project,
under Header Search Paths: add 'path /opt/local/include/' to both 'Debug' and 'Release'
under  Search Paths: add 'path /opt/local/lib' to both 'Debug' and 'Release'
2)Go to Linking, add '-lQuantLib' to 'Other Linker Flags'.

Is there any one can give me some suggestions on what the problem is and how to fix this?

Thanks a lot!!