JGCRI/gcamwrapper

Install error with cost_curve.h

Opened this issue · 1 comments

When trying to build the gcamwrapper package, I get an error
error C2589: '(': illegal token on right side of '::' in the file util/curves/include/cost_curve.h

After some googling, I found that what's probably happening is that "max" has been made a macro which happens at some point within windows.h. I think there are a few different solutions to this. I just added #undef max (and #undef min) to the top of the file, which seemed to fix it. Not sure if this is the best solution.

@enlochner Thanks for these useful debug info. Did you encounter this issue when building gcamwrapper-python in Windows using visual studio 2023?

Creating library build\temp.win-amd64-cpython-311\Release\src\gcam_module.cp311-win_amd64.lib and object build\temp.win-amd64-cpython-311\Release\src\gcam_module.cp311-win_amd64.exp
      get_data_helper.obj : error LNK2001: unresolved external symbol "private: static class tbb::detail::d1::enumerable_thread_specific<double *,class tbb::detail::d1::cache_aligned_allocator<double *>,0> Value::sCentralValue" (?sCentralValue@Value@@0V?$enumerable_thread_specific@PEANV?$cache_aligned_allocator@PEAN@d1@detail@tbb@@$0A@@d1@detail@tbb@@A)
      build\lib.win-amd64-cpython-311\gcam_module.cp311-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals