x******a 发帖数: 6336 | 1 1. 下面这个命令行的第一个-I/opt/local/include/是什么意思?
还有后面的 -lQuantLib什么意思?
g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp
-o bermudanswaption -L/opt/local/lib/ -lQuantLib
2. 下面这个bash里面那个是对应“-I/opt/local/include/boost”?
If you want to make the Boost headers and libraries available to all C++
projects, edit ~/.bash_profile and add the following lines into the file:
export CPLUS_INCLUDE_PATH=/opt/local/include
export C_INCLUDE_PATH=/opt/local/include
export DYLD_LIBRARY_PATH=/op... 阅读全帖 |
|
x******a 发帖数: 6336 | 2 按照quantlib.org上在mac上安装以后,测试一个命令行:
g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp \
-o bermudanswaption -L/opt/local/lib/ -lQuantLib
得到i686-apple-darwin10-g++-4.2.1: BermudanSwaption.cpp: No such file or
directory。
然后到/opt/local/include/boost目录下,再次运行上面的命令行,显示下面的内容
g++ -I /opt/local/include/ -I /opt/local/include/boost BermudanSwaption.cpp
-o bermudanoption -
L/opt/local/lib/ -lQuantLib1.0.1
ld: library not found for -lQuantLib1.0.1
collect2: ld returned 1 exit statu... 阅读全帖 |
|
x******a 发帖数: 6336 | 3 下面这个command中的hi.cpp可以是其他的名字,我怎么处理?
是不是用通配符,如果是, -o hi那个应该怎么办?
谢谢
g++ -I/opt/local/include hi.cpp -o hi -L/opt/local/lib -lQuantLib |
|
j*a 发帖数: 14423 | 4 for i in *.cpp; do
g++ -I/opt/local/include $i -o ${i%.cpp} -L/opt/local/lib -lQuantLib
done |
|
x******a 发帖数: 6336 | 5 thank you joa,
can i do, for example
alias q++ i.cpp='for i in *.cpp; do
g++ -I/opt/local/include $i -o ${i%.cpp} -L/opt/local/lib -lQuantLib
done' |
|
x******a 发帖数: 6336 | 6 装了一个quantlib在mac os x上,然后运行那个example,结果得到下面一堆。请教应
该link或者编译?
谢谢!
instruction在这里:
http://quantlib.org/install/macosx.shtml
run example
g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp
-o bermudanswaption -L/opt/local/lib/ -lQuantLib
以后的error:
Undefined symbols for architecture x86_64:
"_main", referenced from:
start in crt1.10.6.o
"vtable for boost::unit_test::unit_test_log_t", referenced from:
boost::unit_test::unit_test_log_t::unit_test_log_t()in ccL... 阅读全帖 |
|