pure virtual function call

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

pure virtual function call

smazzucca
I see this has been discussed in the past, but I don't see any viable solution.

Given that I am using QL in C# via SWIG, I'd be happy at least being able to trap this error.

As is it just takes down the whole application and just makes the whole system completely unusable.

Is anybody aware of a way to catch this exception ?

Thank you,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: pure virtual function call

Luigi Ballabio
Klaus Spanderen has provided a patch at
<http://hpcquantlib.wordpress.com/2014/05/11/quantlib-swig-patch-for-jvm-net-languages/>.

Luigi

On Fri, May 30, 2014 at 5:43 PM, smazzucca <[hidden email]> wrote:

> I see this has been discussed in the past, but I don't see any viable
> solution.
>
> Given that I am using QL in C# via SWIG, I'd be happy at least being able to
> trap this error.
>
> As is it just takes down the whole application and just makes the whole
> system completely unusable.
>
> Is anybody aware of a way to catch this exception ?
>
> Thank you,
> Simon
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Time is money. Stop wasting it! Get your web API in 5 minutes.
> www.restlet.com/download
> http://p.sf.net/sfu/restlet
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: pure virtual function call

smazzucca
I am able to patch 1.4 and build it, but my SWIG wrapper chokes on it.

Is 1.4 considered backwards compatible to 1.3 ?

Was anybody successful in using QL 1.4 via SWIG ?

Thanks,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: pure virtual function call

Klaus Spanderen-2

can you be more specific what doesn't work?

 

On Monday, June 02, 2014 11:32:36 AM smazzucca wrote:

> I am able to patch 1.4 and build it, but my SWIG wrapper chokes on it.

>

> Is 1.4 considered backwards compatible to 1.3 ?

>

> Was anybody successful in using QL 1.4 via SWIG ?

>

> Thanks,

> Simon

>

>

>

> --

> View this message in context:

> http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p1534

> 9.html Sent from the quantlib-users mailing list archive at Nabble.com.

>

> ----------------------------------------------------------------------------

> -- Learn Graph Databases - Download FREE O'Reilly Book

> "Graph Databases" is the definitive new guide to graph databases and their

> applications. Written by three acclaimed leaders in the field,

> this first edition is now available. Download your free book today!

> http://p.sf.net/sfu/NeoTech

> _______________________________________________

> QuantLib-users mailing list

> [hidden email]

> https://lists.sourceforge.net/lists/listinfo/quantlib-users

 


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: pure virtual function call

smazzucca
The C++ SWIG wrapper solution (NQuantLibc) does not build.

I get 1012 compile errors and 34 warnings:
SWIG_Wrapper_compile_errors.txt
SWIG_Wrapper_warnings.txt

Were you able to use QL 1.4 with WSIG ?
Reply | Threaded
Open this post in threaded view
|

Re: pure virtual function call

smazzucca
Klaus, here's an update:

I rolled back the patch to do some testing and this is my situation at the moment:

• Build unpatched QL 1.4: OK
• Build SWIG Wrapper against unpatched QL 1.4: OK
• Build patched QL 1.4: OK
• Build SWIG Wrapper against patched QL 1.4: FAIL

This is what I have done, let me know if it sounds correct
1) Downloaded QL 1.4
2) Build as-is to make sure I can - OK
3) Downloaded/extracted your patch
4) Copied extracted files into QL folder
5) Followed steps in your readme:
    (No need for #3 as observable.cpp is already in ql/patterns)
5) Build QL again

After doing step 2 (BOOST_SP_ENABLE_DEBUG_HOOKS --> BOOST_SP_ENABLE_DEBUG_HOOKS_2) I now have 1402 compile errors.

Hopefully you can point me in the right direction as I am at a total loss here.

Thanks,
Simon

Reply | Threaded
Open this post in threaded view
|

Fwd: pure virtual function call

George Wang
Forgot to include the mail list.

---------- Forwarded message ----------
From: George <[hidden email]>
Date: Tue, Jun 3, 2014 at 11:21 PM
Subject: Re: [Quantlib-users] pure virtual function call
To: smazzucca <[hidden email]>


I have tried the patch a couple of times. The QuantLib project compiles fine, but both got over two thousand errors, all coming from the examples and test suite. I wonder if I missed something obvious. BTW, the C# SWIG solution also have over 500 errors.

Some sample errors are:

Error 1 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(fdvanillaengine.obj) Replication
Error 2 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(bsmoperator.obj) Replication
Error 3 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib\Examples\Repo\QuantLib-vc120-mt.lib(zeroyieldstructure.obj) Repo
Error 4 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib\Examples\Repo\QuantLib-vc120-mt.lib(bondfunctions.obj) Repo

Error 11 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(impliedvolatility.obj) Replication
Error 12 error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "public: __thiscall boost::detail::shared_count::shared_count<class boost::signals2::detail::grouped_list<int,struct std::less<int>,class boost::shared_ptr<class boost::signals2::detail::connection_body<struct std::pair<enum boost::signals2::detail::slot_meta_group,class boost::optional<int> >,class boost::signals2::slot<void __cdecl(void),class boost::function<void __cdecl(void)> >,class boost::signals2::mutex> > > >(class boost::signals2::detail::grouped_list<int,struct std::less<int>,class boost::shared_ptr<class boost::signals2::detail::connection_body<struct std::pair<enum boost::signals2::detail::slot_meta_group,class boost::optional<int> >,class boost::signals2::slot<void __cdecl(void),class boost::function<void __cdecl(void)> >,class boost::signals2::mutex> > > *)" (??$?0V?$grouped_list@HU?$less@H@std@@V?$shared_ptr@V?$connection_body@U?$pair@W4slot_meta_group@detail@signals2@boost@@V?$optional@H@4@@std@@V?$slot@$$A6AXXZV?$function@$$A6AXXZ@boost@@@signals2@boost@@Vmutex@45@@detail@signals2@boost@@@boost@@@detail@signals2@boost@@@shared_count@detail@boost@@QAE@PAV?$grouped_list@HU?$less@H@std@@V?$shared_ptr@V?$connection_body@U?$pair@W4slot_meta_group@detail@signals2@boost@@V?$optional@H@4@@std@@V?$slot@$$A6AXXZV?$function@$$A6AXXZ@boost@@@signals2@boost@@Vmutex@45@@detail@signals2@boost@@@boost@@@1signals2@2@@Z) D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(vanillaoption.obj) Replication

C# SWIG error:
Warning 1 warning C4005: 'SWIGSTDCALL' : macro redefinition D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\quantlib_wrap.cpp 339 1 NQuantLibc
Error 2 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(callablebondvolstructure.obj) NQuantLibc
Error 3 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdmblackscholesop.obj) NQuantLibc
Error 4 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdm2dimsolver.obj) NQuantLibc
Error 5 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdm1dimsolver.obj) NQuantLibc



On Mon, Jun 2, 2014 at 5:39 PM, smazzucca <[hidden email]> wrote:
Klaus, here's an update:

I rolled back the patch to do some testing and this is my situation at the
moment:

• Build unpatched QL 1.4: OK
• Build SWIG Wrapper against unpatched QL 1.4: OK
• Build *patched* QL 1.4: OK
• Build SWIG Wrapper against *patched* QL 1.4: FAIL

This is what I have done, let me know if it sounds correct
1) Downloaded QL 1.4
2) Build as-is to make sure I can - OK
3) Downloaded/extracted your patch
4) Copied extracted files into QL folder
5) Followed steps in your readme:
    (No need for #3 as observable.cpp is already in ql/patterns)
5) Build QL again

After doing step 2 (BOOST_SP_ENABLE_DEBUG_HOOKS -->
BOOST_SP_ENABLE_DEBUG_HOOKS_2) I now have 1402 compile errors.

Hopefully you can point me in the right direction as I am at a total loss
here.

Thanks,
Simon





--
View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15353.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Klaus Spanderen-2

Hi

 

the patch adds basic multi threading support for th singleton pattern. This suport is based on boost_thread and boost_system. You'll have to add this libraries to your linker command. (e.g. you might want to use the ql/auto_link.hpp for this task. Please see quantlibtestsuite.cpp for an example, line 30ff)

 

thanks for highlighting this issue. I'm going to add this to the readme.txt file.

 

regards

Klaus

 

On Tuesday, June 03, 2014 11:23:07 PM George wrote:

> Forgot to include the mail list.

>

> ---------- Forwarded message ----------

> From: George <[hidden email]>

> Date: Tue, Jun 3, 2014 at 11:21 PM

> Subject: Re: [Quantlib-users] pure virtual function call

> To: smazzucca <[hidden email]>

>

>

> I have tried the patch a couple of times. The QuantLib project compiles

> fine, but both got over two thousand errors, all coming from the examples

> and test suite. I wonder if I missed something obvious. BTW, the C# SWIG

> solution also have over 500 errors.

>

> Some sample errors are:

>

> Error 1 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(fdv

> anillaengine.obj) Replication

> Error 2 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(bsm

> operator.obj) Replication

> Error 3 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib\Examples\Repo\QuantLib-vc120-mt.lib(zeroyields

> tructure.obj) Repo

> Error 4 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib\Examples\Repo\QuantLib-vc120-mt.lib(bondfuncti

> ons.obj) Repo

>

> Error 11 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(imp

> liedvolatility.obj) Replication

> Error 12 error LNK2019: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ) referenced in function "public: __thiscall

> boost::detail::shared_count::shared_count<class

> boost::signals2::detail::grouped_list<int,struct std::less<int>,class

> boost::shared_ptr<class boost::signals2::detail::connection_body<struct

> std::pair<enum boost::signals2::detail::slot_meta_group,class

> boost::optional<int> >,class boost::signals2::slot<void __cdecl(void),class

> boost::function<void __cdecl(void)> >,class boost::signals2::mutex> > >

>

> >(class boost::signals2::detail::grouped_list<int,struct

>

> std::less<int>,class boost::shared_ptr<class

> boost::signals2::detail::connection_body<struct std::pair<enum

> boost::signals2::detail::slot_meta_group,class boost::optional<int> >,class

> boost::signals2::slot<void __cdecl(void),class boost::function<void

> __cdecl(void)> >,class boost::signals2::mutex> > > *)"

> (??$?0V?$grouped_list@HU?$less@H@std@@V?$shared_ptr@V?$connection_body@U

> ?$pair@W4slot_meta_group@detail@signals2@boost@@V?$optional@H@4@@std@

> @V?$slot@$$A6AXXZV?$function@$$A6AXXZ@boost@@@signals2@boost@@Vmutex@45

> @@detail@signals2@boost@@@boost@@@detail@signals2@boost@

> @@shared_count@detail@boost@@QAE@PAV?$grouped_list@HU?$less@H@std@

> @V?$shared_ptr@V?$connection_body@U?$pair@W4slot_meta_group@detail@signals2

> @boost@@V?$optional@H@4@@std@@V?$slot@$$A6AXXZV?$function@$$A6AXXZ@boost

> @@@signals2@boost@@Vmutex@45@@detail@signals2@boost@@@boost@@@1signals2@2

> @@Z)

> D:\Projects\quantlib\QuantLib\Examples\Replication\QuantLib-vc120-mt.lib(van

> illaoption.obj) Replication

>

> C# SWIG error:

> Warning 1 warning C4005: 'SWIGSTDCALL' : macro redefinition

> D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\quantlib_wrap.cpp 339 1

> NQuantLibc

> Error 2 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(callable

> bondvolstructure.obj) NQuantLibc

> Error 3 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdmblack

> scholesop.obj) NQuantLibc

> Error 4 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdm2dims

> olver.obj) NQuantLibc

> Error 5 error LNK2001: unresolved external symbol "class

> boost::system::error_category const & __cdecl

> boost::system::system_category(void)" (?system_category@system@boost@

> @YAABVerror_category@12@XZ)

> D:\Projects\quantlib\QuantLib-SWIG\CSharp\cpp\QuantLib-vc120-mt.lib(fdm1dims

> olver.obj) NQuantLibc

>

>

>

> On Mon, Jun 2, 2014 at 5:39 PM, smazzucca <[hidden email]>

>

> wrote:

> > Klaus, here's an update:

> >

> > I rolled back the patch to do some testing and this is my situation at the

> > moment:

> >

> > • Build unpatched QL 1.4: OK

> > • Build SWIG Wrapper against unpatched QL 1.4: OK

> > • Build *patched* QL 1.4: OK

> > • Build SWIG Wrapper against *patched* QL 1.4: FAIL

> >

> > This is what I have done, let me know if it sounds correct

> > 1) Downloaded QL 1.4

> > 2) Build as-is to make sure I can - OK

> > 3) Downloaded/extracted your patch

> > 4) Copied extracted files into QL folder

> >

> > 5) Followed steps in your readme:

> > (No need for #3 as observable.cpp is already in ql/patterns)

> >

> > 5) Build QL again

> >

> > After doing step 2 (BOOST_SP_ENABLE_DEBUG_HOOKS -->

> > BOOST_SP_ENABLE_DEBUG_HOOKS_2) I now have 1402 compile errors.

> >

> > Hopefully you can point me in the right direction as I am at a total loss

> > here.

> >

> > Thanks,

> > Simon

> >

> >

> >

> >

> >

> > --

> > View this message in context:

> > http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p153

> > 53.html Sent from the quantlib-users mailing list archive at Nabble.com.

> >

> >

> > --------------------------------------------------------------------------

> > ---- Learn Graph Databases - Download FREE O'Reilly Book

> > "Graph Databases" is the definitive new guide to graph databases and their

> > applications. Written by three acclaimed leaders in the field,

> > this first edition is now available. Download your free book today!

> > http://p.sf.net/sfu/NeoTech

> > _______________________________________________

> > QuantLib-users mailing list

> > [hidden email]

> > https://lists.sourceforge.net/lists/listinfo/quantlib-users

 


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
Klaus,

Still not working...

I had "C:\Program Files\boost" in the linker Additional Library Directories. I changed that to "C:\Program Files\boost\boost\lib" as in your screenshot. I get 400+ errors like this:

Error 35 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) C:\Projects\Thrid Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(callablebondvolstructure.obj) NQuantLibc

Error 36 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) C:\Projects\Thrid Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(cpicouponpricer.obj) NQuantLibc

Error 37 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) C:\Projects\Thrid Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(averagebmacoupon.obj) NQuantLibc

Error 38 error LNK2001: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAABVerror_category@12@XZ) C:\Projects\Thrid Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(discretizedswap.obj) NQuantLibc


I also tried to follow what you are saying about line 30 in the testsuite.

I think what you mean is that I need to copy the #ifdef BOOST_MSVC paragraph to the main cpp file... That did not work either.

Thanks,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Luigi Ballabio
You'll have to do something like (warning, untested code ahead):

#  define BOOST_LIB_NAME boost_thread
#  include <boost/config/auto_link.hpp>
#  define BOOST_LIB_NAME boost_system
#  include <boost/config/auto_link.hpp>
#  undef BOOST_LIB_NAME

For more info, see <boost/config/auto_link.hpp>.

Luigi

On Wed, Jun 4, 2014 at 2:15 PM, smazzucca <[hidden email]> wrote:

> Klaus,
>
> Still not working...
>
> I had "C:\Program Files\boost" in the linker Additional Library Directories.
> I changed that to "C:\Program Files\boost\boost\lib" as in your screenshot.
> I get 400+ errors like this:
>
> Error   35      error LNK2001: unresolved external symbol "class
> boost::system::error_category const & __cdecl
> boost::system::system_category(void)"
> (?system_category@system@boost@@YAABVerror_category@12@XZ)      C:\Projects\Thrid
> Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(callablebondvolstructure.obj)
> NQuantLibc
>
> Error   36      error LNK2001: unresolved external symbol "class
> boost::system::error_category const & __cdecl
> boost::system::system_category(void)"
> (?system_category@system@boost@@YAABVerror_category@12@XZ)      C:\Projects\Thrid
> Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(cpicouponpricer.obj)
> NQuantLibc
>
> Error   37      error LNK2001: unresolved external symbol "class
> boost::system::error_category const & __cdecl
> boost::system::system_category(void)"
> (?system_category@system@boost@@YAABVerror_category@12@XZ)      C:\Projects\Thrid
> Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(averagebmacoupon.obj)
> NQuantLibc
>
> Error   38      error LNK2001: unresolved external symbol "class
> boost::system::error_category const & __cdecl
> boost::system::system_category(void)"
> (?system_category@system@boost@@YAABVerror_category@12@XZ)      C:\Projects\Thrid
> Party\QuantLib\QuantLib-SWIG\cpp\QuantLib-vc110-mt-gd.lib(discretizedswap.obj)
> NQuantLibc
>
>
> I also tried to follow what you are saying about line 30 in the testsuite.
>
> I think what you mean is that I need to copy the #ifdef BOOST_MSVC paragraph
> to the main cpp file... That did not work either.
>
> Thanks,
> Simon
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15366.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
Luigi,

I think that's a step in the right direction: I go from 475 errors to 1:

Error 42 error LNK1104: cannot open file 'libboost_thread-vc110-mt-gd-1_54.lib' C:\Projects\Thrid Party\QuantLib\QuantLib-SWIG\cpp\LINK NQuantLibc

Thanks,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Luigi Ballabio
Ok, that's telling you that you don't have the Boost thread library
compiled for your current compiler configuration (Debug, I think).
What libraries do you have called libboost_thread-*?

Luigi


On Wed, Jun 4, 2014 at 4:24 PM, smazzucca <[hidden email]> wrote:

> Luigi,
>
> I think that's a step in the right direction: I go from 475 errors to 1:
>
> Error   42      error LNK1104: cannot open file
> 'libboost_thread-vc110-mt-gd-1_54.lib'  C:\Projects\Thrid
> Party\QuantLib\QuantLib-SWIG\cpp\LINK   NQuantLibc
>
> Thanks,
> Simon
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15369.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
Luigi,

I don’t have any *.lib file in C:\Program Files\boost. I guess it’s all source code.
How do I build it ?

Simon
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Luigi Ballabio
You can either follow the instructions at
<http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html>,
or (much simpler) get a binary installer at
<https://sourceforge.net/projects/boost/files/boost-binaries/>.

Luigi


On Wed, Jun 4, 2014 at 4:39 PM, smazzucca <[hidden email]> wrote:

> Luigi,
>
> I don’t have any *.lib file in C:\Program Files\boost. I guess it’s all
> source code.
> How do I build it ?
>
> Simon
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15371.html
> Sent from the quantlib-users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/NeoTech
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Luigi Ballabio
Are you sure you don't have any libraries, though? You should at least
have libboost_unit_test_framework if you had managed to compile the
test suite before applying Klaus' patch.

Luigi


On Wed, Jun 4, 2014 at 5:00 PM, Luigi Ballabio <[hidden email]> wrote:

> You can either follow the instructions at
> <http://www.boost.org/doc/libs/1_55_0/more/getting_started/windows.html>,
> or (much simpler) get a binary installer at
> <https://sourceforge.net/projects/boost/files/boost-binaries/>.
>
> Luigi
>
>
> On Wed, Jun 4, 2014 at 4:39 PM, smazzucca <[hidden email]> wrote:
>> Luigi,
>>
>> I don’t have any *.lib file in C:\Program Files\boost. I guess it’s all
>> source code.
>> How do I build it ?
>>
>> Simon
>>
>>
>>
>>
>> --
>> View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15371.html
>> Sent from the quantlib-users mailing list archive at Nabble.com.
>>
>> ------------------------------------------------------------------------------
>> Learn Graph Databases - Download FREE O'Reilly Book
>> "Graph Databases" is the definitive new guide to graph databases and their
>> applications. Written by three acclaimed leaders in the field,
>> this first edition is now available. Download your free book today!
>> http://p.sf.net/sfu/NeoTech
>> _______________________________________________
>> QuantLib-users mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
Luigi/Klaus,

It appears I finally have it all working!

If anybody is reading this thread and wants to cut to the chase, these are the two additional steps needed:

1) Add the following block in quantlib_wrap.cpp:

#  define BOOST_LIB_NAME boost_thread
#  include <boost/config/auto_link.hpp> 
#  define BOOST_LIB_NAME boost_system
#  include <boost/config/auto_link.hpp> 
#  undef BOOST_LIB_NAME


2) Add the full boost libs path (in my case: "C:\Program Files\boost-win\lib32-msvc-11.0") in:
Project properties > Configuration Properties > Linker > General > Additional Library Directories

Thanks again to Luigi and Klaus for helping with this!

Simon
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
I spoke too soon...

The SWIG wrapper builds which is great. However the whole reason I did this was to get rid of the "pure virtual function call" error. Unfortunately nothing at all has changed as far as that: I still get it.

Luigi: since we added observable.cpp, do you think we need to add that to the SWIG interface files ? Or does anything else need to be modified there ?

Klaus: can I still call setEvaluationDate() as before or do I need to use the code differently to take full advantage of the patch ?

Thank you,
Simon
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

Luigi Ballabio

No need to add the .cpp, it's included in the new QuantLib library you compiled.

On Jun 4, 2014 7:40 PM, "smazzucca" <[hidden email]> wrote:
I spoke too soon...

The SWIG wrapper builds which is great. However the whole reason I did this
was to get rid of the "pure virtual function call" error. Unfortunately
nothing at all has changed as far as that: I still get it.

Luigi: since we added observable.cpp, do you think we need to add that to
the SWIG interface files ? Or does anything else need to be modified there ?

Klaus: can I still call setEvaluationDate() as before or do I need to use
the code differently to take full advantage of the patch ?

Thank you,
Simon



--
View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15375.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

smazzucca
Is it possible that I am getting the "pure virtual function call" error for a different reason ?

Given that I don't have any multi-thread logic, is the patch going to do anything good for me ? Or does it only help with MT code ?

Is there at least a way to trap that exception so it doesn't crash the whole process ?

Reply | Threaded
Open this post in threaded view
|

Re: Fwd: pure virtual function call

George Wang
Thanks to Klaus and Luigi 's help, I have got the patch compiled successfully. However, I did not experience the "pure virtual function call" error before trying this patch, and I don't notice any difference after the patch by running existing examples.

Klaus's blog has some example code in Scala, but I have never used it. http://hpcquantlib.wordpress.com/2012/02/27/quantlib-swig-and-a-thread-safe-observer-pattern-in-c/

Simon, do you have any C# example code that I can try to reproduce your "pure virtual function call" error? If it's working Java/scala project that doesn't require much setup, I can give it a try as well.

Thanks,
George

On Wed, Jun 4, 2014 at 2:00 PM, smazzucca <[hidden email]> wrote:
Is it possible that I am getting the "pure virtual function call" error for a
different reason ?

Given that I don't have any multi-thread logic, is the patch going to do
anything good for me ? Or does it only help with MT code ?

Is there at least a way to trap that exception so it doesn't crash the whole
process ?





--
View this message in context: http://quantlib.10058.n7.nabble.com/pure-virtual-function-call-tp15342p15377.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
12