grame-cncm / guidoar

4 stars 2 forks source link

build problems #3

Open the-drunk-coder opened 5 months ago

the-drunk-coder commented 5 months ago

Hi, I've been trying to build guidoar (on Arch linux, for INscore), but I haven't had any success yet, it seems like there's some error in the code:

[  1%] Building CXX object CMakeFiles/guidoar.dir/home/nik/repositories/thirdparty/guidoar/src/guido/abstract/ARChord.cpp.o
In file included from /usr/include/c++/14.1.1/vector:66,
                 from /home/nik/repositories/thirdparty/guidoar/src/guido/abstract/ARChord.h:27,
                 from /home/nik/repositories/thirdparty/guidoar/src/guido/abstract/ARChord.cpp:26:
/usr/include/c++/14.1.1/bits/stl_vector.h: In instantiation of ‘class std::vector<const guido::SMARTP<guido::ARNote> >’:
/home/nik/repositories/thirdparty/guidoar/src/guido/abstract/ARChord.cpp:148:25:   required from here
  148 |                 vector<const SARNote>   fNotes;
      |                                         ^~~~~~
/usr/include/c++/14.1.1/bits/stl_vector.h:440:66: error: static assertion failed: std::vector must have a non-const, non-volatile value_type
  440 |       static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
      |                                                                  ^~~~~
/usr/include/c++/14.1.1/bits/stl_vector.h:440:66: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
In file included from /usr/include/c++/14.1.1/ext/alloc_traits.h:34,
                 from /usr/include/c++/14.1.1/bits/stl_uninitialized.h:64,
                 from /usr/include/c++/14.1.1/vector:65:
/usr/include/c++/14.1.1/bits/alloc_traits.h: In instantiation of ‘static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(allocator_type&, pointer, size_type) [with _Tp = const guido::SMARTP<guido::ARNote>; allocator_type = std::allocator<const guido::SMARTP<guido::ARNote> >; pointer = const guido::SMARTP<guido::ARNote>*; size_type = long unsigned int]’:
/usr/include/c++/14.1.1/bits/stl_vector.h:389:19:   required from ‘void std::_Vector_base<_Tp, _Alloc>::_M_deallocate(pointer, std::size_t) [with _Tp = const guido::SMARTP<guido::ARNote>; _Alloc = std::allocator<const guido::SMARTP<guido::ARNote> >; pointer = const guido::SMARTP<guido::ARNote>*; std::size_t = long unsigned int]’
  389 |           _Tr::deallocate(_M_impl, __p, __n);
      |           ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14.1.1/bits/stl_vector.h:368:2:   required from ‘std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = const guido::SMARTP<guido::ARNote>; _Alloc = std::allocator<const guido::SMARTP<guido::ARNote> >]’
  368 |         _M_deallocate(_M_impl._M_start,
      |         ^~~~~~~~~~~~~
/usr/include/c++/14.1.1/bits/stl_vector.h:531:7:   required from here
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14.1.1/bits/alloc_traits.h:513:13: error: ‘using std::allocator_traits<std::allocator<const guido::SMARTP<guido::ARNote> > >::allocator_type = class std::allocator<const guido::SMARTP<guido::ARNote> >’ {aka ‘class std::allocator<const guido::SMARTP<guido::ARNote> >’} has no member named ‘deallocate’
  513 |       { __a.deallocate(__p, __n); }
      |         ~~~~^~~~~~~~~~
make[2]: *** [CMakeFiles/guidoar.dir/build.make:76: CMakeFiles/guidoar.dir/home/nik/repositories/thirdparty/guidoar/src/guido/abstract/ARChord.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:149: CMakeFiles/guidoar.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I wonder whether this is a problem with the C++ version, or the std library?

the-drunk-coder commented 5 months ago

I've tried multiple combinations of compilers (clang++/g++), C++ versions (98,03,11) and so on, but to no avail ...

dfober commented 5 months ago

Could you try removing the const qualifier from vector<const SARNote> fNotes; in ARChord.cpp line 148 (and keep me informed). It compiles without problem on my side.

the-drunk-coder commented 5 months ago

Hmm ok, if I replace the signature from const SARNote to SARNote everywhere (all references in ARChord.h and ARChord.cpp, and the one in line 779 in visitors/gnm2tabvisitor), then it compiles ... the linker is still missing a library, but I guess that's another problem.

Which compiler/version are you compiling with ? I'm on gcc version 14.1.1 20240522 (GCC)

dfober commented 5 months ago

Je suis sur MacOSX et mon compilateur est Apple clang version 15.0.0 (clang-1500.0.40.1) Je n'ai pas eu le temps de creuser plus cette histoire de const donc je ne sais pas si c'est une évolution des standards. Je compile avec l'option -std=c++11

Le lun. 27 mai 2024 à 23:15, the-drunk-coder @.***> a écrit :

Hmm ok, if I replace the signature from const SARNote to SARNote everywhere (all references in ARChord.h and ARChord.cpp, and the one in line 779 in visitors/gnm2tabvisitor), then it compiles ... the linker is still missing a library, but I guess that's another problem.

Which compiler/version are you compiling with ?

— Reply to this email directly, view it on GitHub https://github.com/grame-cncm/guidoar/issues/3#issuecomment-2134053227, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJHQ4X3ZU7XEVK4FAZC7LZEOO7LAVCNFSM6AAAAABIJYOZN2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZUGA2TGMRSG4 . You are receiving this because you commented.Message ID: @.***>