Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

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

Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

ponram
Hi

I am still a newbie for Quantlib and compiling large projects on C++. My apologies if the below question sounds very trivial.

I am getting a lot of errors such as below when trying to build the new v1.10 on Visual Studio 2017. I am using a Windows 10 machine.

Error C1083 Cannot open include file: 'corecrt.h': No such file or directory (compiling source file varianceoption.cpp) testsuite c:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h

I tried re-targetting the solution to Windows-10 SDK but it didn't help. I installed Windows-8 SDK and tried again with the included additional paths below but still get the same errors.

VC++ include directories:
C:\local\boost_1_64_0
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt

Library Directories:
C:\local\boost_1_64_0\lib64-msvc-14.1
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86  -- Inherited

I am trying to build on Debug Win32 mode. Kindly help to resolve these errors.

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

Luigi Ballabio
Hello,
    I think it's the first time I see this kind of errors.  Did you make any changes to the solution or project files?  Is your IDE ok otherwise, i.e., can you build a sample project that doesn't include QuantLib?

Luigi


On Tue, May 30, 2017 at 2:45 PM ponram <[hidden email]> wrote:
Hi

I am still a newbie for Quantlib and compiling large projects on C++. My
apologies if the below question sounds very trivial.

I am getting a lot of errors such as below when trying to build the new
v1.10 on Visual Studio 2017. I am using a Windows 10 machine.

Error   C1083   Cannot open include file: 'corecrt.h': No such file or directory
(compiling source file varianceoption.cpp)      testsuite       c:\program files
(x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.10.25017\include\crtdefs.h

I tried re-targetting the solution to Windows-10 SDK but it didn't help. I
installed Windows-8 SDK and tried again with the included additional paths
below but still get the same errors.

*VC++ include directories:*
C:\local\boost_1_64_0
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt

*Library Directories:*
C:\local\boost_1_64_0\lib64-msvc-14.1
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\um\x86
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x86
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86  -- Inherited

I am trying to build on Debug Win32 mode. Kindly help to resolve these
errors.

Thanks





--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-compiling-Quantlib-v1-10-C1083-Cannot-Open-include-file-corecrt-h-tp18318.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

ponram
Thanks for replying Luigi. My IDE is ok. I could build the QuantLib project (not the entire solution) to produce the library output 'QuantLib-vc141-mt-gd.lib'. I am also able to run the test console program mentioned on the website that tests Dates and Calendar classes. I get those errors only when i build the entire solution.

I tried a separate build of the "testsuite" project and got the below linker error:

libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Done building project "testsuite.vcxproj" -- FAILED.

I am using Boost v1.64.0
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

Jean-Mathieu Vermosen
Hi,

According to the error message, your boost .lib bitness is conflicting with
the compiler setup. To make sure you have the correct boost files, try to
run

dumpbin /headers *.lib | findstr machine

in the boost folder from a vs command prompt.

I struggled with a similar problem with 1_63 a few weeks ago and it look b2
doesn't clean up correctly all the temp files between the builds. If you
have the same issue, try to run b2 --clean-all before rebuilding boost.

Best,

Jean-Mathieu

-----Original Message-----
From: ponram [mailto:[hidden email]]
Sent: Tuesday, June 6, 2017 4:50 PM
To: [hidden email]
Subject: Re: [Quantlib-users] Error compiling Quantlib v1.10 (C1083: Cannot
Open include file corecrt.h)

Thanks for replying Luigi. My IDE is ok. I could build the QuantLib project
(not the entire solution) to produce the library output
'QuantLib-vc141-mt-gd.lib'. I am also able to run the test console program
mentioned on the website that tests Dates and Calendar classes. I get those
errors only when i build the entire solution.

I tried a separate build of the "testsuite" project and got the below linker
error:

libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal
error LNK1112: module machine type 'x64' conflicts with target machine type
'X86'
Done building project "testsuite.vcxproj" -- FAILED.

I am using Boost v1.64.0



--
View this message in context:
http://quantlib.10058.n7.nabble.com/Error-compiling-Quantlib-v1-10-C1083-Can
not-Open-include-file-corecrt-h-tp18318p18336.html
Sent from the quantlib-users mailing list archive at Nabble.com.

----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most engaging
tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

jdoldham
In reply to this post by ponram
Hi Ponram,

I am also a QuantLib newbie...
I encountered a similar problem a few weeks ago when using QuantLib with Visual Studio 17. It was something to do with the solution configuration setting in VS 17 (release/debug - x86/x64) not matching the Library you have built.

libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
Done building project "testsuite.vcxproj" -- FAILED.


So I believe the problem will be you have built QuantLib in one setting (possibly creating a .lib file such as libboost_unit_test_framework--mt-s-1_64.lib) or similar which doesnt exactly match. I solved it by building QuantLib in several different configurations in VS17 so you have multiple variants of the file listed above and hence it works for all configurations in VS17.

Hope this helps,

JD
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

igitur
Hi

If your end up with QuantLib-vc141-mt-gd.lib, then you built QuantLib with the Win32 configuration.

If you choose the x64 build, then it should produce QuantLib-vc141-x64-mt-gd.lib . 

I just built the latest QuantLib code (freshly pulled from the repo) using VS 2017 Community. I chose the x64 build. I didn't build Boost myself, but downloaded installed boost_1_64_0-msvc-14.1-64.exe from https://sourceforge.net/projects/boost/files/boost-binaries/1.64.0/

I also attach my boost.props file, which is easy to add to the QuantLib project using the Property Manager instead of having to add the include directories manually. If your boost location differs from mine, you would have to edit this boost.props file.

regards

Francois Botha

On 8 June 2017 at 11:47, jdoldham <[hidden email]> wrote:
Hi Ponram,

I am also a QuantLib newbie...
I encountered a similar problem a few weeks ago when using QuantLib with
Visual Studio 17. It was something to do with the solution configuration
setting in VS 17 (release/debug - x86/x64) not matching the Library you have
built.

/libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal
error LNK1112: module machine type 'x64' conflicts with target machine type
'X86'
Done building project "testsuite.vcxproj" -- FAILED. /

So I believe the problem will be you have built QuantLib in one setting
(possibly creating a .lib file such as
libboost_unit_test_framework--mt-s-1_64.lib) or similar which doesnt exactly
match. I solved it by building QuantLib in several different configurations
in VS17 so you have multiple variants of the file listed above and hence it
works for all configurations in VS17.

Hope this helps,

JD



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-compiling-Quantlib-v1-10-C1083-Cannot-Open-include-file-corecrt-h-tp18318p18338.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

boost.props (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

igitur
Apologies, the previous attachment had a minor typo (14.0 vs 14.1). I attach the correct one now.

Francois Botha

On 8 June 2017 at 16:09, Francois Botha <[hidden email]> wrote:
Hi

If your end up with QuantLib-vc141-mt-gd.lib, then you built QuantLib with the Win32 configuration.

If you choose the x64 build, then it should produce QuantLib-vc141-x64-mt-gd.lib . 

I just built the latest QuantLib code (freshly pulled from the repo) using VS 2017 Community. I chose the x64 build. I didn't build Boost myself, but downloaded installed boost_1_64_0-msvc-14.1-64.exe from https://sourceforge.net/projects/boost/files/boost-binaries/1.64.0/

I also attach my boost.props file, which is easy to add to the QuantLib project using the Property Manager instead of having to add the include directories manually. If your boost location differs from mine, you would have to edit this boost.props file.

regards

Francois Botha

On 8 June 2017 at 11:47, jdoldham <[hidden email]> wrote:
Hi Ponram,

I am also a QuantLib newbie...
I encountered a similar problem a few weeks ago when using QuantLib with
Visual Studio 17. It was something to do with the solution configuration
setting in VS 17 (release/debug - x86/x64) not matching the Library you have
built.

/libboost_unit_test_framework-vc141-mt-gd-1_64.lib(test_tree.obj) : fatal
error LNK1112: module machine type 'x64' conflicts with target machine type
'X86'
Done building project "testsuite.vcxproj" -- FAILED. /

So I believe the problem will be you have built QuantLib in one setting
(possibly creating a .lib file such as
libboost_unit_test_framework--mt-s-1_64.lib) or similar which doesnt exactly
match. I solved it by building QuantLib in several different configurations
in VS17 so you have multiple variants of the file listed above and hence it
works for all configurations in VS17.

Hope this helps,

JD



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-compiling-Quantlib-v1-10-C1083-Cannot-Open-include-file-corecrt-h-tp18318p18338.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

boost.props (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

ponram
Thanks Francois Botha. I added your boost.prop file and attempted a build on Debug x64 mode. But i now get the error C1083 mentioned in the subject of this thread.

Could you confirm the WindowsSDK_IncludePath variable you have? I don't remember exactly, but i downloaded Windows 8.1 SDK in one of my several attempts hoping to successfully Compile :)

Here is what i have in my VC++ Directories under Microsoft.Cpp.x64.user property page:

Include Directories:
-------------------
$(BOOST_DIR)
$(VC_IncludePath)
$(WindowsSDK_IncludePath)              --C:\Program Files (x86)\Windows Kits\8.1\Include\*

Library Directories:
--------------------
$(BOOST_DIR)\lib64-msvc-14.1\
$(VC_LibraryPath_x64)
$(WindowsSDK_LibraryPath_x64)          --C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64
$(NETFXKitsDir)Lib\um\x64
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

igitur
Hi,

My WindowsSDK_IncludePath is:
$(WindowsSDK_IncludePath) C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt


You say you already downloaded Windows 8.1 SDK, but just double check that it is marked in VS Installer:
Inline images 1


Francois Botha

On 8 June 2017 at 19:28, ponram <[hidden email]> wrote:
Thanks Francois Botha. I added your boost.prop file and attempted a build on
Debug x64 mode. But i now get the error C1083 mentioned in the subject of
this thread.

Could you confirm the WindowsSDK_IncludePath variable you have? I don't
remember exactly, but i downloaded Windows 8.1 SDK in one of my several
attempts hoping to successfully Compile :)

Here is what i have in my VC++ Directories under Microsoft.Cpp.x64.user
property page:

Include Directories:
-------------------
$(BOOST_DIR)
$(VC_IncludePath)
$(WindowsSDK_IncludePath)              --C:\Program Files (x86)\Windows
Kits\8.1\Include\*

Library Directories:
--------------------
$(BOOST_DIR)\lib64-msvc-14.1\
$(VC_LibraryPath_x64)
$(WindowsSDK_LibraryPath_x64)          --C:\Program Files (x86)\Windows
Kits\8.1\Lib\winv6.3\um\x64
$(NETFXKitsDir)Lib\um\x64



--
View this message in context: http://quantlib.10058.n7.nabble.com/Error-compiling-Quantlib-v1-10-C1083-Cannot-Open-include-file-corecrt-h-tp18318p18341.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Error compiling Quantlib v1.10 (C1083: Cannot Open include file corecrt.h)

ponram
Thanks again for your suggestion. I finally got a successful build after adding the following under VC++ additional Dir :

Include Directories:
---------------------
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\shared
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\winrt

Additional Libraries:
---------------------
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.15063.0\ucrt\x64

I had Windows_8.1 SDK installed and marked in the VS installer just like your screenshot. It still failed. Adding the above Windows 10 SDK locations solved the problem for me.