hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.54k stars 313 forks source link

C2491 dllimport function not allowed (vcpkg) #185

Closed lin0287 closed 2 years ago

lin0287 commented 2 years ago

Hi, thanks for making this. I'm really excited to use it, however I'm having trouble getting the package to work in Windows 10, CLion. I installed this using vcpkg.

I'm using C++ 23.

My issue is almost identical to #71. I've attempted to fix the issue with the same approach but due to my inexperience as a C++ developer, I'm unable to do so.

When trying to run my code, I get the following errors:

C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Vectors/VectorPtrView.h(41): note: see previous definition of 'LIBRARY_API'
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Utils/ThreadGranularity.h(42): warning C4005: 'LIBRARY_API': macro redefinition
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Utils/FixedSizePriorityQueue.h(45): note: see previous definition of 'LIBRARY_API'
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(46): error C2491: 'hmdf::DataFrame<I,H>::DataFrame': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(49): error C2491: 'hmdf::DataFrame<I,H>::DataFrame': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(55): error C2491: 'hmdf::DataFrame<I,H>::operator =': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(73): error C2491: 'hmdf::DataFrame<I,H>::operator =': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(90): error C2491: 'hmdf::DataFrame<I,H>::~DataFrame': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(100): error C2491: 'hmdf::DataFrame<I,H>::empty': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(106): error C2491: 'hmdf::DataFrame<I,H>::shapeless': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(111): error C2491: 'hmdf::DataFrame<I,H>::set_lock': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame.tcc(116): error C2491: 'hmdf::DataFrame<I,H>::remove_lock': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_get.tcc(46): error C2491: 'hmdf::DataFrame<I,H>::shape': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_get.tcc(107): error C2491: 'hmdf::DataFrame<I,H>::has_column': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_get.tcc(118): error C2491: 'hmdf::DataFrame<I,H>::has_column': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_get.tcc(144): error C2491: 'hmdf::DataFrame<I,H>::get_index': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_get.tcc(150): error C2491: 'hmdf::DataFrame<I,H>::get_index': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_read.tcc(49): error C2491: 'hmdf::DataFrame<I,H>::read_json_': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_read.tcc(283): error C2491: 'hmdf::DataFrame<I,H>::read_csv_': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_read.tcc(435): error C2491: 'hmdf::DataFrame<I,H>::read_csv2_': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_read.tcc(732): error C2491: 'hmdf::DataFrame<I,H>::read': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_read.tcc(774): error C2491: 'hmdf::DataFrame<I,H>::read_async': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(71): error C2491: 'hmdf::DataFrame<I,H>::remove_column': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(108): error C2491: 'hmdf::DataFrame<I,H>::remove_column': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(116): error C2491: 'hmdf::DataFrame<I,H>::rename_column': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(222): error C2491: 'hmdf::DataFrame<I,H>::load_index': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(235): error C2491: 'hmdf::DataFrame<I,H>::gen_datetime_index': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(293): error C2491: 'hmdf::DataFrame<I,H>::gen_sequence_index': definition of dllimport function not allowed
C:\dev\cpp\vcpkg\installed\x86-windows\include\DataFrame/Internals/DataFrame_set.tcc(327): error C2491: 'hmdf::DataFrame<I,H>::append_index': definition of dllimport function not allowed
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~4\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx86\x86\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
hosseinmoein commented 2 years ago

The version in master has some improvemtns in terms of compiling in MS environment. So try the version in master instead of released version in vcpkg

lin0287 commented 2 years ago

Will the vcpkg version be updated in future?

hosseinmoein commented 2 years ago

yes. But I don't know when