text-editor
text-editor copied to clipboard
Build Failure with SFML 2.5.1 on Fedora 39
Hello, I just wanted to let you know that I encountered linker errors when compiling your project on Fedora 39 using manually installed SFML 2.5.1 (See below for the error message).
Switching to SFML 2.6.1 and updating the Makefile and run.sh for version 2.6.1 fixed the compilation issues.
Error Message:
(I removed -Werror
from the Makefile)
> /text-editor/ $ make
g++ -O2 -march=native -Wall -Wextra -pedantic -std=c++23 -L /usr/local/lib/SFML-2.5.1/lib -I /usr/local/lib/SFML-2.5.1/include -MMD -c src/TextDocument.cpp -I src/ -o build/src/TextDocument.o
In file included from /usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.hpp:731,
from /usr/local/lib/SFML-2.5.1/include/SFML/System/String.hpp:32,
from /usr/local/lib/SFML-2.5.1/include/SFML/System.hpp:42,
from /usr/local/lib/SFML-2.5.1/include/SFML/Window.hpp:32,
from /usr/local/lib/SFML-2.5.1/include/SFML/Graphics.hpp:32,
from src/TextDocument.h:4,
from src/TextDocument.cpp:1:
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl: In static member function ‘static In sf::Utf<8>::decode(In, In, sf::Uint32&, sf::Uint32) [with In = __gnu_cxx::__normal_iterator<const char*, std::__cxx11::basic_string<char> >]’:
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:65:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
65 | case 5: output += static_cast<Uint8>(*begin++); output <<= 6;
| ~~~~~~~^~~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:66:13: note: here
66 | case 4: output += static_cast<Uint8>(*begin++); output <<= 6;
| ^~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:66:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
66 | case 4: output += static_cast<Uint8>(*begin++); output <<= 6;
| ~~~~~~~^~~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:67:13: note: here
67 | case 3: output += static_cast<Uint8>(*begin++); output <<= 6;
| ^~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:67:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
67 | case 3: output += static_cast<Uint8>(*begin++); output <<= 6;
| ~~~~~~~^~~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:68:13: note: here
68 | case 2: output += static_cast<Uint8>(*begin++); output <<= 6;
| ^~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:68:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
68 | case 2: output += static_cast<Uint8>(*begin++); output <<= 6;
| ~~~~~~~^~~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:69:13: note: here
69 | case 1: output += static_cast<Uint8>(*begin++); output <<= 6;
| ^~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:69:68: warning: this statement may fall through [-Wimplicit-fallthrough=]
69 | case 1: output += static_cast<Uint8>(*begin++); output <<= 6;
| ~~~~~~~^~~~~
/usr/local/lib/SFML-2.5.1/include/SFML/System/Utf.inl:70:13: note: here
70 | case 0: output += static_cast<Uint8>(*begin++);
| ^~~~
g++ -O2 -march=native -Wall -Wextra -pedantic -std=c++23 -L /usr/local/lib/SFML-2.5.1/lib -I /usr/local/lib/SFML-2.5.1/include build/Editor.o build/src/Cursor.o build/src/EditorContent.o build/src/EditorView.o build/src/ImplementationUtils.o build/src/InputController.o build/src/SelectionData.o build/src/SpecialChars.o build/src/TextDocument.o -o build/editor -lsfml-graphics -lsfml-window -lsfml-system
/usr/bin/ld: build/src/EditorView.o: in function `EditorView::EditorView(sf::RenderWindow const&, sf::String const&, EditorContent&)':
EditorView.cpp:(.text+0x863): undefined reference to `sf::String::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
/usr/bin/ld: build/src/SpecialChars.o: in function `SpecialChars::convertSpecialChar[abi:cxx11](unsigned int, std::basic_ofstream<char, std::char_traits<char> >&)':
SpecialChars.cpp:(.text+0x3e): undefined reference to `sf::String::operator std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >() const'
collect2: error: ld returned 1 exit status
make: *** [Makefile:35: build/editor] Error 1