accellera-official / systemc

SystemC Reference Implementation
https://systemc.org/overview/systemc/
Apache License 2.0
451 stars 145 forks source link

'specialization': cannot convert from 'int' to 'sc_core::sc_port_policy' #4

Closed garodimb closed 4 years ago

garodimb commented 4 years ago

Got the below error while compiling at_mixed_targets example code using CMake for Visual Studio 2017

`============================================================

1>------ Build started: Project: at_mixed_targets, Configuration: Debug Win32 ------ 1>Building Custom Rule C:/NoBackup/systemc-2.3.4/examples/tlm/at_mixed_targets/CMakeLists.txt 1>CMake does not need to re-run because C:/NoBackup/systemc-2.3.4/build_32/examples/tlm/at_mixed_targets/CMakeFiles/generate.stamp is up-to-date. 1>at_mixed_targets.cpp 1>at_mixed_targets_top.cpp 1>initiator_top.cpp 1>traffic_generator.cpp 1>c:\nobackup\systemc-2.3.4\src\tlm_core/tlm_2/tlm_sockets/tlm_initiator_socket.h(174): error C2440: 'specialization': cannot convert from 'int' to 'sc_core::sc_port_policy' (compiling source file C:\NoBackup\systemc-2.3.4\examples\tlm\at_mixed_targets\src\initiator_top.cpp) 1>c:\nobackup\systemc-2.3.4\src\tlm_core/tlm_2/tlm_sockets/tlm_initiator_socket.h(174): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast) (compiling source file C:\NoBackup\systemc-2.3.4\examples\tlm\at_mixed_targets\src\initiator_top.cpp) 1>c:\nobackup\systemc-2.3.4\src\tlm_core/tlm_2/tlm_sockets/tlm_initiator_socket.h(172): error C2440: 'specialization': cannot convert from 'int' to 'sc_core::sc_port_policy' (compiling source file C:\NoBackup\systemc-2.3.4\examples\tlm\at_mixed_targets\src\initiator_top.cpp) 1>c:\nobackup\systemc-2.3.4\src\tlm_core/tlm_2/tlm_sockets/tlm_initiator_socket.h(172): note: Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast) (compiling source file C:\NoBackup\systemc-2.3.4\examples\tlm\at_mixed_targets\src\initiator_top.cpp) =============================================================`

AmeyaVS commented 4 years ago

Can you post your command line configuration for the project?

I tried the build on MSVC 2019 Community Edition, but did not observe any behavior mentioned above.

AmeyaVS commented 4 years ago

I can confirm that the tagged release: 2.3.4_pub_rev_20190614 is broken for MSVC Builds.

But seems to be fixed in the master branch.

Would it be possible to generate a second tagged release for public review based on the master branch?

garodimb commented 4 years ago

Thanks @AmeyaVS , Build with the master branch is successful. closing this issue as fixed already in master