SAM Open Source Compilation Problem

4 posts / 0 new
Last post
jranalli
SAM Open Source Compilation Problem

I'm having some trouble compiling the SAM open source SSC. I'm working with Visual Studio Community Edition 2017, updated to the latest version today, in Windows 10. I followed the instructions from the Wiki all along, successfully compiled wxWidgets, GoogleTest, lk, and wex. The SSC Solution compiles up through solarpilot. On solarpilot I get the following two compile errors:

Severity Code Description Project File Line Suppression State
Error C2664 'const _Kty &std::_Umap_traits<_Kty,_Ty,std::_Uhash_compare<_Kty,_Hasher,_Keyeq>,_Alloc,false>::_Kfn(const std::pair &)': cannot convert argument 1 from 'std::pair' to 'const std::pair &' solarpilot d:\programfiles\visual studio community 2017\vc\tools\msvc\14.13.26128\include\xhash 658


Severity Code Description Project File Line Suppression State
Error C2664 'const _Kty &std::_Umap_traits<_Kty,_Ty,std::_Uhash_compare<_Kty,_Hasher,_Keyeq>,_Alloc,false>::_Kfn(const std::pair &)': cannot convert argument 1 from 'std::pair' to 'const std::pair &' solarpilot d:\programfiles\visual studio community 2017\vc\tools\msvc\14.13.26128\include\xhash 660

I've attached the output from the compiler, which may be more instructive. It appears that it comes from autopilot_api.cpp.

I have to admit that I'm not C++ savvy enough to completely understand this error, and so I'm finding that I'm a little stuck. Can anybody help me so that I can continue the compile?

jranalli

With some help from a friend, I've identified a fix for the problem. It's within the AutoPilot_API.cpp file. There's an anonymous class with an internal struct (_inst). Moving that struct out to the top level allows the file to compile. Said friend suggests that it may be a bug within the standard library from MS rather than a problem with this code. Either way, is there someone I can contact on the Dev team to explain the issue I encountered in detail, so that if others have the problem it's documented?

Paul Gilman

Hello,

It looks like this problem is documented here, and resolved:

https://github.com/NREL/ssc/pull/142

Best regards,
Paul.

jranalli

Fantastic thanks!

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer