http://quantlib.414.s1.nabble.com/pure-virtual-function-call-in-observable-update-tp13453.html
Hi,
This message is intended as a follow-up to:
I am experiencing the same issue as the one reported: random occurrences of "pure virtual function call" in the 'update' method in 'notifyObservers'. I tried the solution suggested by Henner Heck - using his new observable.hpp that uses "enable_shared_from_raw.hpp".
I got that file, and the new shared_ptr.hpp from the trunk referenced by Henner. I also made the changes in his post. Boost and QuantLib compile OK, but when I build my own project (managed C++), I get an array of warnings (though it does build.)
Many like this:
2>c:\program files (x86)\boost\boost_1_44\boost\thread\win32\thread_primitives.hpp(314): warning C4793: 'boost::detail::win32::interlocked_bit_test_and_set' : function compiled as native :
2> Found an intrinsic not supported in managed code
plus others related to features not supported by clr/managed code.
Plus one these for each source file:
I_EuropeanOption.obj : warning LNK4248: unresolved typeref token (01000024) for 'boost.detail.win32._SECURITY_ATTRIBUTES'; image may not run
As I mentioned, it does build. The real problem is that when I run my project, I immediately get:
BadImageFormatException: Could not load file or assembly 'Interface.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
Interface.dll is my managed C++ project.
My setup:
Windows XP 64-bit Professional (though all code is compiled for 32-bit / x86)
Visual Studio 2010
Boost 1.44
QuantLib 1.0.1
A 'core' project that is native C++ that uses quantlib; compiled to a static library.
A 'Interface' project that is managed C++, built into a DLL. (so the code is not linked until this project is built.)
An 'add-in' project that is C#/.NET 4.0. The above error is thrown when this project tries to create an instance of a class in Interface.dll
Everything runs fine (except for the occasional ‘pure virtual function call’) with the original setup – not even any build warnings.
Does anyone have any suggestions on how to proceed? Please let me know if you need more details about my setup.
Thanks.
- Alan
Alan Fischbein, CFA
212-205-6846
C12 Capital Management
________________________________
The information contained herein (the Information) is confidential. By accepting the Information, the recipient (which shall include its directors, partners, officers, employees and representatives)
acknowledges that it will use the Information only for information and discussion purposes and not for any other purpose. Any reproduction of this Information, in whole or in part, is prohibited. The recipient further agrees that the Information will not be
divulged to any other party without the express written consent of C12 Capital Management LP (C12); provided, however, that the recipient may make any disclosure required by law or requested by a regulator having jurisdiction over the recipient. By accepting
delivery of these materials, each recipient hereof agrees to the restrictions set forth in this disclaimer. C12 and its affiliates reserve the right to monitor and archive all email-communications.
The Information has been prepared solely for informational purposes and is not an offer to buy or sell or a solicitation of any offer to buy or sell any security or participate in a trading strategy. The Information is not intended to be, and shall not be regarded
or construed as, recommendations for transactions or investment, financial or other advice of any kind or constitute or imply any commitment whatsoever, including without limitation an offer to purchase, sell or hold any security, investment, loan or other
financial product (collectively, an investment) or to enter into or arrange any type of transaction, on the part of C12. Past performance is not necessarily indicative of future results.
demonstrated beyond question. Learn why your peers are replacing JEE
from the move.