cococry / lyssa

Aestethic, minimal, suckless music player
157 stars 5 forks source link

can't build #3

Open Loki6946 opened 3 months ago

Loki6946 commented 3 months ago

I had this error when trying to build

sudo make rebuild install make clean make[1]: Entering directory '/home/aldi/Downloads/lysa/lyssa' rm -rf ./bin rm -rf ./vendor/leif/lib make[1]: Leaving directory '/home/aldi/Downloads/lysa/lyssa' make leif make[1]: Entering directory '/home/aldi/Downloads/lysa/lyssa' make -C ./vendor/leif/ make[2]: Entering directory '/home/aldi/Downloads/lysa/lyssa/vendor/leif' mkdir lib gcc pkg-config --cflags glfw3 cglm libclipboard -Ivendor/glad/include -Ivendor/stb_image/ -Ivendor/stb_truetype -Ivendor/stb_image_resize -DLF_GLFW -O3 -ffast-math -c leif.c -o lib/leif.o leif.c: In function ‘load_font’: leif.c:1028:3: warning: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1028 | fread(buffer, 1, fileSize, file); | ^~~~~~~~ leif.c:1040:3: warning: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1040 | fread(buf, 1, 1<<20, fopen(filepath, "rb")); | ^~~~~~~~~~~ gcc -c vendor/glad/src/glad.c -o lib/glad.o ar cr lib/libleif.a lib/.o make[2]: Leaving directory '/home/aldi/Downloads/lysa/lyssa/vendor/leif' make[1]: Leaving directory '/home/aldi/Downloads/lysa/lyssa' make build make[1]: Entering directory '/home/aldi/Downloads/lysa/lyssa' mkdir bin [INFO]: Building Lyssa. g++ -O3 -ffast-math -DGLFW_INCLUDE_NONE src/.cpp -o bin/lyssa -Ivendor/miniaudio -Ivendor/leif/include -Ivendor/leif/vendor/glad/include -Ivendor/stb_image_write -lleif -lclipboard -Lvendor/leif/lib -lglfw -ltag -lm -Lvendor/miniaudio/lib -lminiaudio src/lyssa.cpp: In function ‘int main(int, char)’: src/lyssa.cpp:2694:11: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 2694 | system("pkill yt-dlp"); | ~~^~~~ src/lyssa.cpp: In function ‘void renderDownloadPlaylist()’: src/lyssa.cpp:940:17: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 940 | system(downloadCmd.c_str()); | ~~^~~~~ src/lyssa.cpp:972:13: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 972 | system(downloadThumbnailCmd.c_str()); | ~~^~~~~~~~~~ src/lyssa.cpp:1058:15: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1058 | system("pkill yt-dlp &"); | ~~^~~~~~ src/lyssa.cpp: In function ‘void renderOnPlaylist()’: src/lyssa.cpp:1190:15: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 1190 | system(std::string(LYSSA_DIR + "/scripts/download-yt.sh \"" + currentPlaylist.url + "\" " + LYSSA_DIR + "/downloaded_playlists/ &").c_str()); | ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/popups.cpp: In member function ‘virtual void PlaylistFileDialoguePopup::render()’: src/popups.cpp:209:31: warning: ignoring return value of ‘int system(const char)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 209 | system(cmd.c_str()); | ~~^~~~~ /usr/bin/ld: /usr/local/lib/libclipboard.a(clipboard_x11.c.o): undefined reference to symbol 'xcb_get_setup' /usr/bin/ld: /lib/x86_64-linux-gnu/libxcb.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[1]: ** [Makefile:26: build] Error 1 make[1]: Leaving directory '/home/aldi/Downloads/lysa/lyssa' make: [Makefile:41: rebuild] Error 2

i kind of new to linux so yeah can somebody help me

cococry commented 3 months ago

try installing xorg xorg-server.

Loki6946 commented 3 months ago

try installing xorg xorg-server.

can you tel me how to install it

cococry commented 3 months ago

on which distro are you on?

Loki6946 commented 3 months ago

im running kde on ubuntu 22.04

cococry commented 3 months ago

sudo apt-get install xorg

Loki6946 commented 3 months ago

it's still the same error i run sudo apt-get install xorg and it say it's already installed

cococry commented 3 months ago

okay try: sudo apt-get install libxcb1-dev

Loki6946 commented 3 months ago

it's say libxcb1-dev is already the newest version (1.14-3ubuntu3) i try to build it again and it still the same error

cococry commented 3 months ago

i really have no idea how you would go about fixing that. you could try updating your entire system. maybe that could help

Loki6946 commented 3 months ago

okay then thanks for helping

jossephus commented 3 months ago

I was trying to build a package for lyssa for nixpkgs and I too have faced the "xcb_get_setup" issue. I am putting a discussion I had in nixos disource for future reference and so that I can get notified if theres any fix for this issue. https://discourse.nixos.org/t/how-to-make-a-derivation-depend-on-another-derivation/42621/3

cococry commented 3 months ago

okay then thanks for helping

hey there, i added xcb to the links of lyssa. try rebuilding and see if that resolves the issue.

Loki6946 commented 3 months ago

hey now i get a different error

/usr/bin/ld: /tmp/ccvV12yv.o: in function SoundTagParser::getSoundThubmnail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0xbf4): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' /usr/bin/ld: /tmp/ccvV12yv.o: in function SoundTagParser::getSoundThubmnailData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0x105c): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' collect2: error: ld returned 1 exit status make[1]: [Makefile:26: build] Error 1 make[1]: Leaving directory '/home/aldi/Downloads/lyssa' make: [Makefile:41: rebuild] Error 2

cococry commented 3 months ago

make sure you have taglib installed: sudo apt-get install libtag1-dev

Loki6946 commented 3 months ago

still get the same error

i try to install with the apt get method but it say libtag1-dev is already the newest version (1.11.1+dfsg.1-3ubuntu3).

and i try to build it with the dependencies link on your repo and it's still does not work

Thank you in advance for answering

Loki6946 commented 2 months ago

any news

cococry commented 2 months ago

compile cglm from source: https://github.com/recp/cglm?tab=readme-ov-file#-build

That should fix the error, also you probably will need to compile libclipboard from source: https://github.com/jtanx/libclipboard?tab=readme-ov-file#building

It's very straightforward to compile both of them, don't worry.

Loki6946 commented 2 months ago

thanks, will try

Loki6946 commented 2 months ago

still no luck

this is the error :

/usr/bin/ld: /tmp/ccSIkYAV.o: in function SoundTagParser::getSoundThubmnail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0x13e4): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' /usr/bin/ld: /tmp/ccSIkYAV.o: in function SoundTagParser::getSoundThubmnailData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0x182a): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' collect2: error: ld returned 1 exit status make: *** [Makefile:26: build] Error 1

cococry commented 2 months ago

can you do sudo apt-get install taglib?

Loki6946 commented 2 months ago

its say Unable to locate package taglib

cococry commented 2 months ago

Alright, clone taglib:

git clone https://github.com/taglib/taglib

And build from source: https://github.com/taglib/taglib/blob/master/INSTALL.md

Loki6946 commented 2 months ago

still not work

cococry commented 2 months ago

did building taglib work? and whats the error you get?

cococry commented 2 months ago

and does /usr/local/lib/libtag.a exist?

Loki6946 commented 2 months ago

first when i build taglib its say error about some cppunit thing and i try to build cppunit from this link https://wiki.documentfoundation.org/Cppunit and build taglib again and now there is no error

but when building lyssa it still error

and yeah libtag.a exist

cococry commented 2 months ago

yeah what error does lyssa give

Loki6946 commented 2 months ago

this is the error /usr/bin/ld: /tmp/cccOk8zN.o: in function SoundTagParser::getSoundThubmnail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0x13e4): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' /usr/bin/ld: /tmp/cccOk8zN.o: in function SoundTagParser::getSoundThubmnailData(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, vec2s)': soundTagParser.cpp:(.text+0x182a): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' collect2: error: ld returned 1 exit status make: *** [Makefile:26: build] Error 1

cococry commented 2 months ago

and /usr/local/lib/libtag.a exists?

Loki6946 commented 2 months ago

yes it exist

cococry commented 2 months ago

try this:

#include <iostream>
#include <taglib/fileref.h>
#include <taglib/tag.h>

int main() {
    TagLib::FileRef f("example.mp3");

    if(!f.isNull() && f.tag()) {
        TagLib::Tag *tag = f.tag();

        std::cout << "-- TAG --" << std::endl;
        std::cout << "Title  : " << tag->title() << std::endl;
        std::cout << "Artist : " << tag->artist() << std::endl;
        std::cout << "Album  : " << tag->album() << std::endl;
        std::cout << "Year   : " << tag->year() << std::endl;
        std::cout << "Comment: " << tag->comment() << std::endl;
        std::cout << "Track  : " << tag->track() << std::endl;
        std::cout << "Genre  : " << tag->genre() << std::endl;
    } else {
        std::cerr << "File could not be opened or it doesn't contain any tags." << std::endl;
    }

    return 0;
}
g++ -o taglibtest taglibtest.cpp -ltag
Loki6946 commented 2 months ago

where do i put this

cococry commented 2 months ago

put it into a file named taglibtest.cpp in some directory. it does not matter where, its just a test to see if taglib works

Loki6946 commented 2 months ago

okay this is the step i take first i create a folder called libtag test and i cd to it and then i touch libtagtest.cpp and copy the code from your comment to it

and i run g++ -o taglibtest taglibtest.cpp -ltag

but nothing happen

cococry commented 2 months ago

you did everything right. now just do ./taglibtest in the dir where you have the file

Loki6946 commented 2 months ago

it say File could not be opened or it doesn't contain any tags.

cococry commented 2 months ago

yeah okay thats a good sign. that means that it compiled correctly with taglib and there's no problem.

now please replace the code with this code:

#include <iostream>
#include <taglib/mpegfile.h>
#include <taglib/id3v2tag.h>
#include <taglib/fileref.h>
#include <taglib/tag.h>

int main() {
    TagLib::MPEG::File file("example.mp3");

    if(file.isOpen() && file.isValid()) {
        TagLib::Tag *tag = file.tag();

        if(tag) {
            std::cout << "-- TAG --" << std::endl;
            std::cout << "Title  : " << tag->title() << std::endl;
            std::cout << "Artist : " << tag->artist() << std::endl;
            std::cout << "Album  : " << tag->album() << std::endl;
            std::cout << "Year   : " << tag->year() << std::endl;
            std::cout << "Comment: " << tag->comment() << std::endl;
            std::cout << "Track  : " << tag->track() << std::endl;
            std::cout << "Genre  : " << tag->genre() << std::endl;
        } else {
            std::cerr << "No tags found in the file." << std::endl;
        }
    } else {
        std::cerr << "File could not be opened or is not a valid MPEG file." << std::endl;
    }

    return 0;
}

And see if compiling and running still works.

Loki6946 commented 2 months ago

i replace the code inside taglibtest.cpp and i run g++ -o taglibtest taglibtest.cpp -ltag again

and this is the output : /usr/bin/ld: /tmp/cc1AZmEp.o: in function main': taglibtest.cpp:(.text+0x3b): undefined reference toTagLib::MPEG::File::File(char const, bool, TagLib::AudioProperties::ReadStyle, TagLib::ID3v2::FrameFactory)' collect2: error: ld returned 1 exit status

cococry commented 2 months ago

okay try to build like this instead:

g++ -o taglibtest taglibtest.cpp `pkg-config --cflags --libs taglib`
Loki6946 commented 2 months ago

run it and nothing happen no error and then i run this ./taglibtest and this is what it say File could not be opened or is not a valid MPEG file.

cococry commented 2 months ago

okay try doing git pull or just recloning lyssa and rebuild lyssa with 'make'

because i now changed taglib to be pkg-config linked

Loki6946 commented 2 months ago

okay i will try

Loki6946 commented 2 months ago

and now there is no error what should i do next

cococry commented 2 months ago

do sudo make install and then you can just search for lyssa in you system or run in from the terminal by just calling: 'lyssa'

Loki6946 commented 2 months ago

i install it and run lyssa on my terminal but there is an error [LEIF ERROR]: Failed to open font file '/home/aldi/.leif/assets/fonts/inter.ttf'

cococry commented 2 months ago

does /home/user/.leif exist?

Loki6946 commented 2 months ago

there is no .leif folder on home/user

cococry commented 2 months ago

and did you do sudo make install in the lyssa root dir?

Loki6946 commented 2 months ago

yes

cococry commented 2 months ago

okay, is there a .lyssa folder in your home dir?