Closed DoubleShotgun closed 1 year ago
Is this on raylib 4.5 or raylib 4.7? Try the next
branch perhaps? https://github.com/RobLoach/raylib-cpp/pull/241
4.5 I think?
Also I'm a noob with github, how would i install this?
You are using raylib's master
branch right now, which compiles against raylib-cpp's next
branch. Check out the next
branch of raylib-cpp
, or download it here https://github.com/RobLoach/raylib-cpp/tree/next
Now I'm getting this
In file included from /sdcard/Raylib/include/./Color.hpp:7, from /sdcard/Raylib/include/raylib-cpp.hpp:39, from /sdcard/Raylib/main.cpp:1: /sdcard/Raylib/include/././Vector4.hpp: In member function ‘std::pair<raylib::Vector3, float> raylib::Vector4::ToAxisAngle()’: /sdcard/Raylib/include/././Vector4.hpp:105:45: note: parameter passing for argument of type ‘std::pair<raylib::Vector3, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1 105 | std::pair<Vector3, float> ToAxisAngle() { | ^ /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
raylib::LoadFileText(std::cxx11::basic_string<char, std::char_traitsstd::allocator<char>::allocator()' /usr/bin/ld: main.cpp:(.text+0x44): undefined reference to
std::allocatorstd::allocator<char>::~allocator()' /usr/bin/ld: main.cpp:(.text+0x70): undefined reference to
std::cxx11::basic_string<char, std::char_traitsraylib::LoadDirectoryFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main.cpp:(.text+0xa8): undefined reference to
std::__cxx11::basic_string<char, std::char_traitsmain': main.cpp:(.text+0x248): undefined reference to
std::allocatorstd::allocator<char>::~allocator()' /usr/bin/ld: main.cpp:(.text+0x298): undefined reference to
std::allocatorstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: main.cpp:(.text+0x2d0): undefined reference to
std::allocatorstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: main.cpp:(.text+0x434): undefined reference to
std::allocatorstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: main.cpp:(.text+0x458): undefined reference to
std::allocatorraylib::RaylibException::RaylibException(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': main.cpp:(.text._ZN6raylib15RaylibExceptionC2ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6raylib15RaylibExceptionC5ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x18): undefined reference to
std::runtime_error::runtime_error(std::cxx11::basic_string<char, std::char_traits__cxa_allocate_exception' /usr/bin/ld: main.cpp:(.text._ZN6raylib16TextureUnmanaged4LoadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6raylib16TextureUnmanaged4LoadERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x94): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: main.cpp:(.text._ZN6raylib6Window4InitEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj[_ZN6raylib6Window4InitEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj]+0xb0): undefined reference to
std::allocatorstd::allocator<char>::~allocator()' /usr/bin/ld: main.cpp:(.text._ZN6raylib6Window4InitEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj[_ZN6raylib6Window4InitEiiRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj]+0xdc): undefined reference to
cxa_free_exception'
/usr/bin/ld: /tmp/cc5S3ZSq.o: in function `std::cxx11::basic_string<char, std::char_traitsstd::allocator<char>::~allocator()' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_local_data()' /usr/bin/ld: main.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC5IS3_EEPKcRKS3_]+0x30): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__throw_logic_error(char const*)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::cxx11::basic_string<char, std::char_traitsstd::allocator<char>::~allocator()' /usr/bin/ld: main.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_]+0x60): undefined reference to
std::allocatorstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const' /usr/bin/ld: main.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_]+0x80): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: main.cpp:(.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_[_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_RKS8_]+0xac): undefined reference to
std::allocatorstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::__cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_dispose()' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
void std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)' /usr/bin/ld: main.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x50): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_capacity(unsigned long)' /usr/bin/ld: main.cpp:(.text._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag[_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_St20forward_iterator_tag]+0x74): undefined reference to
std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_set_length(unsigned long)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::allocator_traits<std::allocatorstd::allocator<char>::allocator(std::allocator<char> const&)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::vector<std::cxx11::basic_string<char, std::char_traitsstd::__throw_length_error(char const*)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::new_allocator<std::cxx11::basic_string<char, std::char_traitsoperator delete(void*, unsigned long)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
std::__new_allocator<std::cxx11::basic_string<char, std::char_traitsoperator new(unsigned long)' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
void std::_Destroy<std::cxx11::basic_string<char, std::char_traitsstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* std::__do_uninit_copy<char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*>(char**, char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)': main.cpp:(.text._ZSt16__do_uninit_copyIPPcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SA_S9_[_ZSt16__do_uninit_copyIPPcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SA_S9_]+0x64): undefined reference to
cxa_begin_catch'
/usr/bin/ld: main.cpp:(.text._ZSt16do_uninit_copyIPPcPNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SAS9[_ZSt16do_uninit_copyIPPcPNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SAS9]+0x74): undefined reference to `cxa_rethrow'
/usr/bin/ld: main.cpp:(.text._ZSt16do_uninit_copyIPPcPNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SAS9[_ZSt16do_uninit_copyIPPcPNSt7cxx1112basic_stringIcSt11char_traitsIcESaIcEEEET0_T_SAS9]+0x7c): undefined reference to __cxa_end_catch' /usr/bin/ld: /tmp/cc5S3ZSq.o: in function
void std::_Construct<std::cxx11::basic_string<char, std::char_traitsstd::allocator<char>::allocator()' /usr/bin/ld: main.cpp:(.text._ZSt10_ConstructINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJRPcEEvPT_DpOT0_[_ZSt10_ConstructINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEJRPcEEvPT_DpOT0_]+0x5c): undefined reference to
std::allocatorstd::allocator<char>::~allocator()' /usr/bin/ld: /tmp/cc5S3ZSq.o:(.data.rel.ro._ZTVN6raylib15RaylibExceptionE[_ZTVN6raylib15RaylibExceptionE]+0x20): undefined reference to
std::runtime_error::what() const'
/usr/bin/ld: /tmp/cc5S3ZSq.o: in function raylib::RaylibException::~RaylibException()': main.cpp:(.text._ZN6raylib15RaylibExceptionD2Ev[_ZN6raylib15RaylibExceptionD5Ev]+0x20): undefined reference to
std::runtime_error::~runtime_error()'
/usr/bin/ld: /tmp/cc5S3ZSq.o: in function raylib::RaylibException::~RaylibException()': main.cpp:(.text._ZN6raylib15RaylibExceptionD0Ev[_ZN6raylib15RaylibExceptionD5Ev]+0x1c): undefined reference to
operator delete(void*, unsigned long)'
/usr/bin/ld: /tmp/cc5S3ZSq.o:(.data.rel.ro._ZTIN6raylib15RaylibExceptionE[_ZTIN6raylib15RaylibExceptionE]+0x0): undefined reference to vtable for __cxxabiv1::__si_class_type_info' /usr/bin/ld: /tmp/cc5S3ZSq.o:(.data.rel.ro._ZTIN6raylib15RaylibExceptionE[_ZTIN6raylib15RaylibExceptionE]+0x10): undefined reference to
typeinfo for std::runtime_error'
/usr/bin/ld: /tmp/cc5S3ZSq.o:(.data.rel.local.DW.ref.gxx_personality_v0[DW.ref.gxx_personality_v0]+0x0): undefined reference to __gxx_personality_v0'
Never mind, I realise I was compiling with cc
instead of g++
, that error was my fault
Glad you got it working!
All I did is run
g++ main.cpp -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
This error appeared
In file included from /usr/local/include/Color.hpp:7, from /usr/local/include/raylib-cpp.hpp:39, from main.cpp:1: /usr/local/include/Vector4.hpp: In member function ‘std::pair<raylib::Vector3, float> raylib::Vector4::ToAxisAngle()’: /usr/local/include/Vector4.hpp:105:45: note: parameter passing for argument of type ‘std::pair<raylib::Vector3, float>’ when C++17 is enabled changed to match C++14 in GCC 10.1 105 | std::pair<Vector3, float> ToAxisAngle() { | ^ In file included from /usr/local/include/TextureUnmanaged.hpp:11, from /usr/local/include/Font.hpp:9, from /usr/local/include/raylib-cpp.hpp:40: /usr/local/include/Image.hpp: In static member function ‘static Image raylib::Image::GradientV(int, int, Color, Color)’: /usr/local/include/Image.hpp:137:18: error: ‘::GenImageGradientV’ has not been declared; did you mean ‘GenImageGradientSquare’? 137 | return ::GenImageGradientV(width, height, top, bottom); | ^~~~~~~~~~~~~~~~~ | GenImageGradientSquare /usr/local/include/Image.hpp: In static member function ‘static Image raylib::Image::GradientH(int, int, Color, Color)’: /usr/local/include/Image.hpp:144:18: error: ‘::GenImageGradientH’ has not been declared; did you mean ‘GenImageGradientSquare’? 144 | return ::GenImageGradientH(width, height, left, right); | ^~~~~~~~~~~~~~~~~ | GenImageGradientSquare [Finished in 3.2s with exit code 1] [shell_cmd: g++ main.cpp -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 -o /home/user/out && ~/out && rm ~/out] [dir: /sdcard/Raylib] [path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/data/data/com.termux/files/usr/bin:/system/bin:/system/xbin]