Hi All, I am very new to quantlib. I use vs team system 2008, quantlib 0.97, boost 1.39. Here is the problem puzzled me; 1. I built quantlib, 'QuantLib-vc90-mt-sgd-0_9_7.lib' is in the lib directory. 2. I build static library libCrr.lib with essentially two files: clsLGM.h: #ifndef _CLS_LGM_H #define _CLS_LGM_H #ifdef __cplusplus extern "C" #endif int testQL(); #endif clsLGM.cpp: #include "stdafx.h" #include <ql/quantlib.hpp> #include <boost/timer.hpp> #include <iostream> #include <iomanip> //#include "clsLGM.h" using namespace QuantLib; #ifdef __cplusplus extern "C" #endif int testQL() { boost::timer timer; std::cout << std::endl; Date todaysDate(15, February, 2002); Calendar calendar = TARGET(); Date settlementDate(19, February, 2002); Date startDate = calendar.advance(settlementDate,1,Years, ModifiedFollowing); return startDate.year(); //return 1; } 3. 'testQL' function is called from xll addin project (xllCrr) written in C, ( I have to compiled it as C, excel 2003 don't recognise it's a addin if compiled as C++). Now is the puzzle: The xllCrr's link failed: cannot open file 'QuantLib-vc90-mt-sgd-0_9_7.lib' I don't see why xllCrr need to link with QuantLib-vc90-mt-sgd-0_9_7.lib. Isn't everything quantlib is in libCrr.lib I built? How does xllCrr know there is a lib called QuantLib-vc90-mt-sgd-0_9_7.lib. I checked environment variable, but nowhere link to QuantLib-vc90-mt-sgd-0_9_7.lib. I set 'Ignore Specific Library' to QuantLib-vc90-mt-sgd-0_9_7.lib in the project setting, I then will get some other errors include quantlib related: libCrr.lib(clsLGM.obj) : error LNK2019: unresolved external symbol "public: int __thiscall QuantLib::Date::year(void)const " (?year@Date@QuantLib@@QBEHXZ) referenced in function _testQL May be the project setting for the static library libCrr.lib setting is wrong? Thanks for you attention, Yan Please consider our environment before printing this email. WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately. It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments. This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision. Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency. Westpac Banking Corporation ABN 33 007 457 141. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Fri, Aug 21, 2009 at 9:33 AM, Yan Kuang <[hidden email]> wrote:
> 1. I built quantlib, 'QuantLib-vc90-mt-sgd-0_9_7.lib' is in the lib directory. > 2. I build static library libCrr.lib with essentially two files: > [...] > The xllCrr's link failed: cannot open file 'QuantLib-vc90-mt-sgd-0_9_7.lib' > > I don't see why xllCrr need to link with QuantLib-vc90-mt-sgd-0_9_7.lib. in order to use QuantLib features required by your files > Isn't everything quantlib is in libCrr.lib I built? no, it isn't > How does xllCrr know there is a lib called QuantLib-vc90-mt-sgd-0_9_7.lib through auto-linking. Auto-linking is a mechanism for automatically determining which libraries to link to while building a C or C++ program. It is activated by means of #pragma comment(lib, <name>) statements in the header files of the library, ql/autolink.hpp in the QuantLib case hope it helps ciao -- Nando ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
My intention is to write a C library wrapping Quantlib time/date function. The library will be statically linked, means the lib will be independent of Quantlib when built. In other word, when other program can use the lib independent of Quantlib. Is it possible? Many thanks, Yan
On Fri, Aug 21, 2009 at 9:33 AM, Yan Kuang <[hidden email]> wrote: > 1. I built quantlib, 'QuantLib-vc90-mt-sgd-0_9_7.lib' is in the lib directory. > 2. I build static library libCrr.lib with essentially two files: > [...] > The xllCrr's link failed: cannot open file 'QuantLib-vc90-mt-sgd-0_9_7.lib' > > I don't see why xllCrr need to link with QuantLib-vc90-mt-sgd-0_9_7.lib. in order to use QuantLib features required by your files > Isn't everything quantlib is in libCrr.lib I built? no, it isn't > How does xllCrr know there is a lib called QuantLib-vc90-mt-sgd-0_9_7.lib through auto-linking. Auto-linking is a mechanism for automatically determining which libraries to link to while building a C or C++ program. It is activated by means of #pragma comment(lib, <name>) statements in the header files of the library, ql/autolink.hpp in the QuantLib case hope it helps ciao -- Nando Please consider our environment before printing this email. WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately. It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments. This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision. Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency. Westpac Banking Corporation ABN 33 007 457 141. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Tue, Aug 25, 2009 at 1:12 AM, Yan Kuang<[hidden email]> wrote:
> My intention is to write a C library wrapping Quantlib time/date function. > The library will be statically linked, > means the lib will be independent of Quantlib when built. In other word, > when other program can use the lib > independent of Quantlib. > > Is it possible? I don't think so ciao -- Nando ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Yan Kuang
On Tue, 2009-08-25 at 09:12 +1000, Yan Kuang wrote:
> My intention is to write a C library wrapping Quantlib time/date > function. The library will be statically linked, > means the lib will be independent of Quantlib when built. In other > word, when other program can use the lib > independent of Quantlib. > > Is it possible? Your program will need the QuantLib code in some form if it has to use it. This means that if you don't want to link QuantLib, you'll have to include the time/date QuantLib sources in your library and compile them together with your wrappers. Luigi -- Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Hi Luigi and Nando, Thanks for the help. I built my c wrapper. The other project xCrr can't find 'QuantLib-vc71-mt-sgd-0_9_7.lib', I did anything possible to set the lib dependence. I don't mind xCrr knows QuantLib-vc71-mt-sgd-0_9_7.lib, as long as it links. Why I need to do the wrapper? My excel addin code doesn't work properly if I compiled as C++. That's why I need to write a C wrapper. I think all the problems are caused of vs 2003, my installation even refused to install SP1.Now I have updated to vs 2008. I will need to update to excel 2007 to use sdk 2007 shortly. So I have moved on, but the question is still remaining. Under vs 2008, my c wrapper becomes a small C++ price library. In my current project, I start to use quantlib's swaption vol cube, I found it is good. I will only use vol cube, date function of quantlib, may try PDE if I got time, as I already got my PDE code. That means my price libary is not a standalone library. Is QuantLib-vc90-mt-sgd-0_9_7.lib the only binary it depends on? (From auto_link.hpp, it appears to be). Is my addin XLL a standalone application? If the XLL is standalone dll, doesn't that mean I can make dll standalone, but not a static library? Sorry I never heard of autolink before. I can't think it's C++ standard. What's the advantage? How do I enable it? How do I disable it? Also I can't see any direct test cases of PDE in testsuite? Is there any indirect test cases on PDE in the suite? A more general question would be: when a developer submits/checks in new lib, does she/he have to submit test cases? Wouldn't be that the test cases being added to the official suite? Cheers, Yan
On Tue, 2009-08-25 at 09:12 +1000, Yan Kuang wrote: > My intention is to write a C library wrapping Quantlib time/date > function. The library will be statically linked, > means the lib will be independent of Quantlib when built. In other > word, when other program can use the lib > independent of Quantlib. > > Is it possible? Your program will need the QuantLib code in some form if it has to use it. This means that if you don't want to link QuantLib, you'll have to include the time/date QuantLib sources in your library and compile them together with your wrappers. Luigi -- Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery Please consider our environment before printing this email. WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately. It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments. This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision. Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency. Westpac Banking Corporation ABN 33 007 457 141. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Luigi Ballabio
OK, I realised static library is just object files, Compiler/(Linker?) doesn't add the binary from the dependant library to the static library. However with autolink, Compiler/(Linker?) put the dependant library name string (QuantLib-vc90-mt-sgd-0_9_7.lib defined in autolink.hpp) into the static library. So the dll or exe using the static library 'know' which library which the static library depends on to link. Sorry for the confusion, Yan
On Tue, 2009-08-25 at 09:12 +1000, Yan Kuang wrote: > My intention is to write a C library wrapping Quantlib time/date > function. The library will be statically linked, > means the lib will be independent of Quantlib when built. In other > word, when other program can use the lib > independent of Quantlib. > > Is it possible? Your program will need the QuantLib code in some form if it has to use it. This means that if you don't want to link QuantLib, you'll have to include the time/date QuantLib sources in your library and compile them together with your wrappers. Luigi -- Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery Please consider our environment before printing this email. WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Westpac cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email by Westpac, please contact us immediately. It is also important to check for viruses and defects before opening or using attachments. Westpac's liability is limited to resupplying any affected attachments. This email and its attachments are not intended to constitute any form of financial advice or recommendation of, or an offer to buy or offer to sell, any security or other financial product. We recommend that you seek your own independent legal or financial advice before proceeding with any investment decision. Westpac Institutional Bank is a division of Westpac Banking Corporation, a company registered in New South Wales in Australia under the Corporations Act 2001 (Cth). Westpac is authorised and regulated in the United Kingdom by the Financial Services Authority and is registered at Cardiff in the United Kingdom as Branch No. BR 106. Westpac operates in the United States of America as a federally chartered branch, regulated by the Office of the Comptroller of the Currency. Westpac Banking Corporation ABN 33 007 457 141. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |