usbpicprog icon indicating copy to clipboard operation
usbpicprog copied to clipboard

Issues when I upgraded to Debian Bookworm

Open pathyj opened this issue 1 year ago • 5 comments

After I migrated my system to Debian Bookworm I had a number of issues. These are my workarounds.

So I used usbpicprog-0.9.9-1.0.0-beta.tar.gz

I had to change the location of the libusb include files

In main.cpp line 32 -#include <libusb.h> +#include <libusb-1.0/libusb.h>

In hardware.cpp line 31 -#include <libusb.h> +#include <libusb-1.0/libusb.h>

Looks like fp==NULL cannot be used to determine if the file name is valid

In Hexfile.cpp line 99 -if (fp==NULL) +if (fp.fail())

In Hexfile.cpp line 339 -if (fp==NULL) +if (fp.fail())

This will allow the files to compile, however linking the files fails.

It appears that ./configure does not put the LIBUSB links in. When I run ./confiure it reports LIBUSB=NO, however I did the link manually by dropping in to the src directory and running

g++ -g -O2 -o usbpicprog uppmainwindow.o main.o uppmainwindow_base.o hardware.o pictype.o hexfile.o hexview.o packageview.o configview.o preferences_base.o preferences.o io_test_base.o io_test.o -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2 -I/usr/include/libusb-1.0 -lusb-1.0

Most of this command is generated by the make program I just appended -I/usr/include/libusb-1.0 -lusb-1.0

Go back to make directory. Change to root privileges and then make install

Once the program is installed I launch usbpicprog from the menu. On my bookworm system it looks like wx complains about some wx configurations being not quite right and I get this

./src/common/sizer.cpp(1624): assert "CheckSizerFlags ( !(flags & (wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL)) || !(flags & (wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL)) )" failed in DoInsert(): wxEXPAND flag will be overridden by alignment flags

DO NOT PANIC !!

If you're an end user running a program not developed by you, please ignore this message, it is harmless, and please try reporting the problem to the program developers.

You may also set WXSUPPRESS_SIZER_FLAGS_CHECK environment variable to suppress all such checks when running this program.

If you're the developer, simply remove either wxEXPAND or the alignment in at least one direction from your code to avoid getting this message. You can also call wxSizerFlags::DisableConsistencyChecks() to globally disable all such checks, but this is strongly not recommended.

I do do not know wx well enough to fix this so I just unclick the "Show this dialog the next time" and usbpicprog fires up.

pathyj avatar Oct 10 '23 00:10 pathyj

Dear @pathyj , thanks for the extensive description. Could you commit the changes and create a pull request?

fransschreuder avatar Oct 10 '23 05:10 fransschreuder

Hi Frans

I never done that before but I will give it a shot. Might take a bit of time though.

John

On Mon, 2023-10-09 at 22:04 -0700, Frans Schreuder wrote:

Dear @pathyj , thanks for the extensive description. Could you commit the changes and create a pull request? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

pathyj avatar Oct 10 '23 23:10 pathyj

Okay so I figured out the the reason that configure was setting LIBUSB=NO was because I did not have pkg-config installed. Once I installed pkg-config, configure set LIBUSB=YES and the appropriate libraries were added for the linking and the make was successful. Nothing to do for this issue.

pathyj avatar Oct 11 '23 00:10 pathyj

Dear John, There are a few items in this ticket, the first is about NULL vs .fail(), then there is something about a wxWidgets warning and now about libusb. then the ticket is randomly closed and reopened. Could you explain further? Regards, Frans

fransschreuder avatar Oct 11 '23 07:10 fransschreuder

Hi Frans

hexfile.cpp would not compile for me until I changed both instances of fp==NULL to fp.fail(). I noticed that alx741 in issue #15 had the same errors that I received. This change could close issue #15.

Usbpicprog is now on my Application menu and when I run it there is warning that pops up. It is generated from wxWidgets module sizer.cpp. It does not affect the operation of usbpicprog as I can click the box suppressing the warning and usbpicprog runs without issues after that. I never had this warning prior to this most recent compile, but it has been many years since I compiled usbpicprog. Debian Bookworm now has wx3.2 installed and my previous compiles had different earlier versions. The warning message is listed in my first post. 

As the issue with LIBUSB, I did not have this issue previously so I decided to check configure where the message LIBUSB=NO was generated and saw that configure was using pkg-config to add - I/usr/include/libusb-1.0 -lusb-1.0 to the linker. I tried running the same command "pkg-config --cflags --libs libusb-1.0" in a terminal and I discovered that my system did not have pkg-config installed. I installed pkg-config and the make program successfully compiled and linked all modules and I did not have to do a manual link like I did previously. While I was adding this update, by mistake I closed the the ticket and then to undo this, I reopened it.  Nothing more to do with this unless perhaps a line is put in configure to check for pkg-config installed.

John

On Wed, 2023-10-11 at 00:03 -0700, Frans Schreuder wrote:

Dear John, There are a few items in this ticket, the first is about NULL vs .fail(), then there is something about a wxWidgets warning and now about libusb. then the ticket is randomly closed and reopened. Could you explain further? Regards, Frans — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you modified the open/close state.Message ID: @.***>

pathyj avatar Oct 11 '23 10:10 pathyj