Open mtrstudio opened 9 years ago
@mtrstudio multiple things:
??0Date@QuantLib@@QEAA@XZ
??0SimpleCashFlow@QuantLib@@QEAA@NAEBVDate@1@@Z
(are you sure you point to the latest version of the generate .lib file from MSVC?)Hey I actually just ran into the same exact error. I compiled QL in Visual Studio 2013 express are you saying I'll need to compile in an older Microsoft compiler? i.e. VS2008
@charles-peter yes, you should be either using VS2008 or the free C++ compiler for Python 2.7: http://www.microsoft.com/en-us/download/details.aspx?id=44266
Hey, indeed I can't find
It seems the .def is not properly generated, I have 288340 lines in .def, subtracting the first two lines which are LIBRARY "QuantLib" EXPORTS then there are 288338 functions are generated in .def, is that right?
By the way I am using quantlib-1.5, I saw some other guys in previous posts were also using this version.
Yes, that looks like a .def file generation issue.
I don't have much time right now to dig into the details. You cand find the symbols, .dll and .lib + built library here to compare: https://www.dropbox.com/sh/rul49lx01hxjlua/AACi1kLqD10ff0ALo6vX_zaha?dl=0 That was for QL 1.4. I can try to update it to 1.5 but can't promise anything in the coming days. It should not be an issue though.
Hey thanks a lot~ But exactly the same errors occurred even after using the libs you sent to me. Maybe it really has something to do with the compiler itself.
On the other hand, I noticed, my .def file (I changed to quantlib1.4) is different from yours, so I think there are two possibilities here:
Just some guess, hopefully it will be useful for your development
Symbols are definitely compiler specific.
! As stated before, you won't get PyQL to run with Python 2.7. if you use msvc2012. It has to be msvc2008 or the MSFT C++ compiler for Python 2.7
Hi, I followed all the steps in the documents, and I also checked previous issues some other guys may have had, but still I can't build the library correctly, here's the messages I got from building.
setting.hpp is patched, quantlib is built, def generated, then quantlib built again. Then I add folders containing .lib, .dll and folders containing .obj to the PATH I also modified setup.py so that all directories can be correctly found, then I built with MSVC. Still got the errors below...
Could you tell me are there any steps I went wrong? Thanks~
C:\Users...\Documents\GitHub\pyql>cmd.exe Microsoft Windows Version 6.3.9600 2013 Microsoft Corporation. All rights reserved.
C:\Users...\Documents\GitHub\pyql>python setup.py build --compiler=msvc C:\Users...\Documents\GitHub\pyql setup.py C:\Python27\lib\distutils\extension.py:133: UserWarning: Unknown Extension optio ns: 'cython_directives' warnings.warn(msg) missing cimport in module 'quantlib.time': quantlib\instruments\credit_default_s wap.pyx missing cimport in module 'quantlib.pricingengines': quantlib\instruments\credit _default_swap.pyx missing cimport in module 'quantlib.pricingengines': quantlib\instruments\option .pyx running build running build_py running build_ext building 'quantlib.cashflow' extension C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.exe /c /nolo go /Ox /MD /W3 /GS- /DNDEBUG -DWIN32 -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -DWINNT -D_WINDLL -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE -D_SCL_S ECURE_NO_WARNINGS -IE:\Projects\QuantLib-1.5 -ID:\Modules\boost -I. -I./cpp_l ayer -IC:\Python27\lib\site-packages\numpy\core\include -IC:\Python27\include -I C:\Python27\PC /Tpquantlib\cashflow.cpp /Fobuild\temp.win-amd64-2.7\Release\quan tlib\cashflow.obj /GR /FD /Zm250 /EHsc cashflow.cpp c:\python27\include\pymath.h(22) : warning C4273: 'round' : inconsistent dll lin kage C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(51 6) : see previous definition of 'round' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xtgmath.h(206) : warning C4273: 'round' : inconsistent dll linkage C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(51 6) : see previous definition of 'round' C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\link.exe /DLL / nologo /INCREMENTAL:NO /LIBPATH:E:\Projects\QuantLib-1.5\build\vc120\Win32\Re lease /LIBPATH:E:\Projects\QuantLib-1.5\lib /LIBPATH:. /LIBPATH:C:\Python27\l ibs /LIBPATH:C:\Python27\PCbuild\amd64 QuantLib.lib /EXPORT:initcashflow build\t emp.win-amd64-2.7\Release\quantlib\cashflow.obj /OUT:build\lib.win-amd64-2.7\qua ntlib\cashflow.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\quantlib\cashflow.li b /MANIFESTFILE:build\temp.win-amd64-2.7\Release\quantlib\cashflow.pyd.manifest /subsystem:windows cashflow.obj : warning LNK4197: export 'initcashflow' specified multiple times; using first specification Creating library build\temp.win-amd64-2.7\Release\quantlib\cashflow.lib and o bject build\temp.win-amd64-2.7\Release\quantlib\cashflow.exp cashflow.obj : error LNK2019: unresolved external symbol "public: cdecl QuantL ib::Date::Date(void)" (??0Date@QuantLib@@QEAA@XZ) referenced in function "struct _object * cdecl pyx_pf_8quantlib_8cashflow_8CashFlow_4date___get(struct _ _pyx_obj_8quantlib_8cashflow_CashFlow *)" (?pyx_pf_8quantlib_8cashflow_8CashFl ow4dateget__@@YAPEAU_object@@PEAU__pyx_obj_8quantlib_8cashflow_CashFlow@@@Z)
cashflow.obj : error LNK2019: unresolved external symbol "public: cdecl QuantL ib::SimpleCashFlow::SimpleCashFlow(double,class QuantLib::Date const &)" (??0Sim pleCashFlow@QuantLib@@QEAA@NAEBVDate@1@@Z) referenced in function "int _cdecl _pyx_pf_8quantlib_8cashflow_14SimpleCashFlow___init(struct pyx_obj_8quantlib _8cashflow_SimpleCashFlow ,double,struct __pyx_obj_8quantlib_4time_4date_Date )" (?__pyx_pf_8quantlib_8cashflow_14SimpleCashFlow___init@@YAHPEAUpyx_obj_8q uantlib_8cashflow_SimpleCashFlow@@NPEAUpyx_obj_8quantlib_4time_4date_Date@@@Z)
build\lib.win-amd64-2.7\quantlib\cashflow.pyd : fatal error LNK1120: 2 unresolve d externals error: command 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\ amd64\link.exe' failed with exit status 1120