You are not logged in.
i code an application that needs to get some pictures from /usr/share/app-info/icons/, but whenver i run the application, it is not working, it says "can't load file no such file or directory". 1 week ago i can load them perfectly, i think the upadtes i did are responsible about it. the problem is that i did like 3 big updates.
any idea.
Offline
Do you have 'archlinux-appstream-data' installed?
i code an application that needs to get some pictures from /usr/share/app-info/icons/
Where is the code? What language is it in? What libs / dependencies are you using? How does it "get some pictures"? Are you relying on some library, or opening files directly? What is the "it" that gives that error message? If it's your code, you'd know exactly where that error message came from and what's wrong. Really, you need to tell us *something* about what's going on.
Last edited by Trilby (2022-11-06 18:41:59)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Do you have 'archlinux-appstream-data' installed?
Yes.
Where is the code? What language is it in? What libs / dependencies are you using? How does it "get some pictures"? Are you relying on some library, or opening files directly?
I am using C++, wxWidgets library.
I am coding a gui package manager, and I need to get pictures from /use/share/app-info/icons/ .
The picture that i need varies from time to time, because the user is who is choosing what application he want to search for. So i made a function that searchs tjat directory for a picture of application that he wants, and the function works well without problems, it returns the full path that i want. The problem now is that when i run the executable. An window appears saying "can't load /usr/share/app-info/icons/*/*/*.png no such file or directory."
I am 100% sure that it exists cause i have archlinux-appstream-data installed and i cam browse the images from Dolphin.
Offline
Okay, so you ignored almost everything in my post.
What is the "it" that returns that error message? Does the error message actually include those asterisks? What do you do with the file name that your function (that "works well") returns?
Seriously, if you want help fixing your code, show the code.
Last edited by Trilby (2022-11-06 19:49:29)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Okay, so you ignored almost everything in my post.
What is the "it" that returns that error message? Does the error message actually include those asterisks? What do you do with the file name that your function (that "works well") returns?
Seriously, if you want help fixing your code, show the code.
"it" is a window that appears, i think it is GTK error window, this is what it says:
21:01:33: can't open file '/usr/share/app-info/icons/archlinux-arch-community/128x128/virt-manager_virt-manager.png
' (error 2: No such file or directory)
21:01:33: Failed to load image from file "/usr/share/app-info/icons/archlinux-arch-community/128x128/virt-manager_virt-manager.png
".
What do you do with the file name that your function (that "works well") returns?
i put it in a variable, then i make a wxStaticBitmap, and i show this Bitmap on window.
this is the code:
//name variable is from the user
path = data.getApplicationImagePath(name);
std::cout << "path is:" << path<< std::endl; //this line always outputs a valid image path
wxBitmap image;
image.LoadFile(path,wxBITMAP_TYPE_ANY); //i tried wxBITMAP_TYPE_PNG as well
applicationImage = new wxStaticBitmap(this,-1,image);
the cout outputs this:
path is:/usr/share/app-info/icons/archlinux-arch-community/128x128/virt-manager_virt-manager.png
but this other error is logged, i don't know what is it:
Unhandled unknown exception; terminating the application
Last edited by mamograg17 (2022-11-06 20:11:18)
Offline
And this is why exact error messages matter*: your "path" variable includes a newline at the end and there are no image files provided by the above-mentioned package that include a newline at the end. Their names end in ".png" not ".png\n".
The error message is from wxwidgets, specifically the image widget as you are in fact giving it a bad file name just as it indicates.
*or the full code, not the part that you think is relevant.
Last edited by Trilby (2022-11-06 21:08:56)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Edit: missed the newline…
Last edited by seth (2022-11-06 21:29:26)
Offline
And this is why exact error messages matter*: your "path" variable includes a newline at the end and there are no image files provided by the above-mentioned package that include a newline at the end. Their names end in ".png" not ".png\n".
The error message is from wxwidgets, specifically the image widget as you are in fact giving it a bad file name just as it indicates.
*or the full code, not the part that you think is relevant.
Thank you,
that was the problem. i fixed it now.
Offline