Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After cross-compiling and running on the development board I get the error can't resolve symbol 'static_assert' #646

Closed
SongZihui-sudo opened this issue Jul 31, 2024 · 1 comment

Comments

@SongZihui-sudo
Copy link

Describe the bug

I compiled libgphoto2 and gphoto2 using the toolchain arm-rockchip830-linux-uclibcgnueabihf in order to make them work on my luckfox mini B development board (system is buildroot). The camera is recognized, but an error is encountered when getting the summary can't resolve symbol 'static_assert', And then the program gets stuck, Does anyone know why?

[root@luckfox app]# ./gphoto2 --debug --summary
0.000400 main                        (2): ALWAYS INCLUDE THE FOLLOWING LINES WHE                                                                                                             N SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.006224 main                        (2): gphoto2 2.5.28
0.010887 main                        (2): gphoto2 has been compiled with the fol                                                                                                             lowing options:
0.019282 main                        (2):  + /home/song/luckfox-pico/tools/linux                                                                                                             /toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclib                                                                                                             cgnueabihf-gcc (C compiler used)
0.036095 main                        (2):  + popt (mandatory, for handling comma                                                                                                             nd-line parameters)
0.044853 main                        (2):  + exif (for displaying EXIF informati                                                                                                             on)
0.052215 main                        (2):  + no cdk (for accessing configuration                                                                                                              options)
0.060100 main                        (2):  + no aa (for displaying live previews                                                                                                             )
0.067295 main                        (2):  + no jpeg (for displaying live previe                                                                                                             ws in JPEG format)
0.075965 main                        (2):  + no readline (for easy navigation in                                                                                                              the shell)
0.084778 main                        (2): libgphoto2 2.5.31
0.089312 main                        (2): libgphoto2 has been compiled with the                                                                                                              following options:
0.097986 main                        (2):  + standard camlib set SKIPPING SOME (                                                                                                             ax203 canon digigr8 dimagev directory jl2005a jl2005c kodak_dc240 mars pentax pt                                                                                                             p2 ricoh_g3 sierra sonix sq905 st2205 topfield tp6801 SKIPPING docupen lumix)
0.118697 main                        (2):  + /home/song/luckfox-pico/tools/linux                                                                                                             /toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclib                                                                                                             cgnueabihf-gcc (C compiler used)
0.135501 main                        (2):  + no ltdl (for portable loading of ca                                                                                                             mlibs)
0.143123 main                        (2):  + EXIF (for special handling of EXIF                                                                                                              files)
0.151136 main                        (2): libgphoto2_port 0.12.2
0.156475 main                        (2): libgphoto2_port has been compiled with                                                                                                              the following options:
0.169238 main                        (2):  + iolibs: disk ptpip serial usb1 usbd                                                                                                             iskdirect usbscsi
0.174166 main                        (2):  + /home/song/luckfox-pico/tools/linux                                                                                                             /toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclib                                                                                                             cgnueabihf-gcc (C compiler used)
0.190966 main                        (2):  + no ltdl (for portable loading of io                                                                                                             libs)
0.198514 main                        (2):  + EXIF (for vusb)
0.203884 main                        (2):  + USB (libusb1, for USB cameras)
0.210552 main                        (2):  + serial (for serial cameras)
0.216962 main                        (2):  + no resmgr (serial port access and l                                                                                                             ocking)
0.224687 main                        (2):  + no ttylock (serial port locking)
0.231528 main                        (2):  + no lockdev (serial port locking)
0.238377 main                        (2): CAMLIBS env var not set, using compile                                                                                                             -time default instead
0.247296 main                        (2): IOLIBS env var not set, using compile-                                                                                                             time default instead
0.256138 main                        (2): invoked with following arguments:
0.262816 main                        (2):   --debug
0.267404 main                        (2):   --summary
0.272728 load_settings               (2): Creating gphoto config directory ('/oe                                                                                                             m/.gphoto')
0.282578 load_settings               (2): Loading settings from file '/oem/.gpho                                                                                                             to/settings'.
0.289052 main                        (2): The user has not specified both a mode                                                                                                             l and a port. Try to figure them out.
0.299226 gp_port_init_localedir      (2): localedir has been set to /home/song/a                                                                                                             rm_libgphoto2/install_libgphoto2/share/locale (compile-time default)
0.311817 gp_port_info_list_load      (2): Using ltdl to load io-drivers from '/h                                                                                                             ome/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2'...
0.330374 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/disk'.
0.340605 gp_port_library_list        (2): found fstab fstype ext2
0.343557 gp_port_library_list        (2): found fstab fstype proc
0.349233 gp_port_library_list        (2): found fstab fstype devpts
0.355212 gp_port_library_list        (2): found fstab fstype tmpfs
0.361154 gp_port_library_list        (2): found fstab fstype tmpfs
0.367026 gp_port_library_list        (2): found fstab fstype tmpfs
0.372918 gp_port_library_list        (2): found fstab fstype sysfs
0.379428 gp_port_library_list        (2): found mtab fstype ubifs
0.384635 gp_port_library_list        (2): found mtab fstype devtmpfs
0.390656 gp_port_library_list        (2): found mtab fstype proc
0.396369 gp_port_library_list        (2): found mtab fstype devpts
0.402266 gp_port_library_list        (2): found mtab fstype tmpfs
0.408133 gp_port_library_list        (2): found mtab fstype tmpfs
0.413918 gp_port_library_list        (2): found mtab fstype tmpfs
0.420170 gp_port_library_list        (2): found mtab fstype sysfs
0.426850 gp_port_library_list        (2): found mtab fstype configfs
0.432077 gp_port_library_list        (2): found mtab fstype functionfs
0.438028 foreach_func                (2): Loaded '' ('^disk:') from '/home/song/                                                                                                             arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/disk'.
0.450724 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/ptpip'.
0.465955 foreach_func                (2): Loaded 'PTP/IP Connection' ('ptpip:')                                                                                                              from '/home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/pt                                                                                                             pip'.
0.477688 foreach_func                (2): Loaded '' ('^ptpip:') from '/home/song                                                                                                             /arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/ptpip'.
0.490760 foreach_func                (2): Loaded 'IP Connection' ('ip:') from '/                                                                                                             home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/ptpip'.
0.504628 foreach_func                (2): Loaded '' ('^ip:') from '/home/song/ar                                                                                                             m_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/ptpip'.
0.517449 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/serial'.
0.533516 foreach_func                (2): Loaded 'Serial Port Device' ('serial:'                                                                                                             ) from '/home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/                                                                                                             serial'.
0.544761 foreach_func                (2): Loaded '' ('^serial:') from '/home/son                                                                                                             g/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/serial'.
0.558023 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usb'.

/app/gphoto2: symbol 'usb_busses': can't resolve symbol

/app/gphoto2: symbol 'usb_busses': can't resolve symbol

/app/gphoto2: symbol 'usb_busses': can't resolve symbol
0.585767 foreach_func                (2): Could not load '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usb': 'file not found'.
0.599094 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usb1'.
0.625652 foreach_func                (2): Loaded '' ('^usb:') from '/home/song/a                                                                                                             rm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usb1'.
0.632924 foreach_func                (2): Loaded 'Universal Serial Bus' ('usb:00                                                                                                             1,002') from '/home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2_port/0                                                                                                             .12.2/usb1'.
0.647999 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usbdiskdirect'.
0.664144 foreach_func                (2): Called for filename '/home/song/arm_li                                                                                                             bgphoto2/install_libgphoto2/lib/libgphoto2_port/0.12.2/usbscsi'.
0.676734 gp_port_info_list_count     (2): Counting entries (9 available)...
0.680481 gp_port_info_list_count     (2): 4 regular entries available.
0.691924 gp_port_init_localedir      (2): ignoring late call (localedir value NU                                                                                                             LL)
0.694104 gp_init_localedir           (2): localedir has been set to /home/song/a                                                                                                             rm_libgphoto2/install_libgphoto2/share/locale (compile-time default)
0.707557 unlocked_gp_abilities_list_load_dir(2): Using ltdl to load camera libra                                                                                                             ries from '/home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2/2.5.31'..                                                                                                             .
0.732538 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/ax203'.
0.737834 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/canon'.
0.748634 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/digigr8'.
0.759649 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/dimagev'.
0.770650 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/directory'.
0.781827 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/disk'.
0.792572 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/jl2005a'.
0.803574 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/jl2005c'.
0.814589 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/kodak_dc240'.
0.825939 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/mars'.
0.836685 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/pentax'.
0.847604 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/ptp2'.
0.858355 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/ptpip'.
0.869185 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/ricoh_g3'.
0.880279 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/serial'.
0.891195 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/sierra'.
0.902121 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/sonix'.
0.912947 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/sq905'.
0.923785 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/st2205'.
0.934708 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/topfield'.
0.945835 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/tp6801'.
0.956760 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/usb'.
0.967388 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/usb1'.
0.978139 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/usbdiskdirect'.
0.989654 foreach_func                (2): Found '/home/song/arm_libgphoto2/insta                                                                                                             ll_libgphoto2/lib/libgphoto2/2.5.31/usbscsi'.
1.000712 unlocked_gp_abilities_list_load_dir(2): Found 25 camera drivers.
1.051690 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/disk' does not seem to contain a ca                                                                                                             mera_id function: Unable to resolve symbol
1.160533 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/ptpip' does not seem to contain a c                                                                                                             amera_id function: Unable to resolve symbol
1.184869 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/serial' does not seem to contain a                                                                                                              camera_id function: Unable to resolve symbol
Loading camera drivers from '/home/... |-----------------    |  80.0%
/app/gphoto2: symbol 'usb_busses': can't resolve symbol

/app/gphoto2: symbol 'usb_busses': can't resolve symbol

/app/gphoto2: symbol 'usb_busses': can't resolve symbol
1.264337 unlocked_gp_abilities_list_load_dir(2): Failed to load '/home/song/arm_                                                                                                             libgphoto2/install_libgphoto2/lib/libgphoto2/2.5.31/usb': file not found.
1.279083 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/usb1' does not seem to contain a ca                                                                                                             mera_id function: Unable to resolve symbol
1.297365 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/usbdiskdirect' does not seem to con                                                                                                             tain a camera_id function: Unable to resolve symbol
1.315409 unlocked_gp_abilities_list_load_dir(2): Library '/home/song/arm_libgpho                                                                                                             to2/install_libgphoto2/lib/libgphoto2/2.5.31/usbscsi' does not seem to contain a                                                                                                              camera_id function: Unable to resolve symbol
1.962236 gp_port_info_list_count     (2): Counting entries (9 available)...
1.963372 gp_port_info_list_count     (2): 4 regular entries available.
1.969582 gp_port_new                 (2): Creating new device...
1.975342 gp_port_info_list_get_info  (2): Getting info of entry 0 (9 available)...
1.983998 gp_port_set_settings        (2): Setting settings...
1.988075 gp_port_info_list_get_info  (2): Getting info of entry 1 (9 available)...
1.996261 gp_port_set_settings        (2): Setting settings...
2.002337 gp_port_info_list_get_info  (2): Getting info of entry 2 (9 available)...
2.009035 gp_port_set_timeout         (2): Setting port timeout to 500 milliseconds.
2.015432 gp_port_set_settings        (2): Setting settings...
2.020910 gp_port_info_list_get_info  (2): Getting info of entry 3 (9 available)...
2.030869 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
2.035626 gp_port_set_settings        (2): Setting settings...
2.041918 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,002, (new int=0, conf=-1, alt=-1) port usb:001,002
2.052881 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
2.062236 gp_abilities_list_detect_usb(2): Auto-detecting USB cameras...
2.074475 gp_libusb1_find_device_by_class_lib(2): Looking for USB device (class 0x29a, subclass, 0xffffffff, protocol 0xffffffff)...
2.081005 gp_libusb1_find_device_lib  (2): Looking for USB device (vendor 0x4b0, product 0x43d)... found.
2.090056 gp_libusb1_find_device_lib  (2): Detected defaults: config 1, interface 0, altsetting 0, inep 81, outep 02, intep 83, class 06, subclass 01
2.102639 gp_abilities_list_detect_usb(2): Found 'Nikon DSC D3400' (0x4b0,0x43d)
2.109654 gp_port_free                (2): Freeing port...
2.114756 gp_port_close               (2): Closing port...
2.121914 gp_camera_set_abilities     (2): Setting abilities ('Nikon DSC D3400')...
2.127184 gp_setting_set              (2): Setting key 'model' to value 'Nikon DSC D3400' (gphoto2)
2.135825 save_settings               (2): Saving 2 setting(s) to file "/oem/.gphoto/settings"
2.145110 gp_port_info_list_lookup_path(2): Looking for path 'usb:001,002' (9 entries available)...
2.152732 gp_port_info_list_get_info  (2): Getting info of entry 3 (9 available)...
2.160075 gp_camera_set_port_info     (2): Setting port info for port 'Universal Serial Bus' at 'usb:001,002'...
2.172371 gp_port_set_timeout         (2): Setting port timeout to 5000 milliseconds.
2.177244 gp_port_set_settings        (2): Setting settings...
2.182734 gp_libusb1_update           (2): (old int=0, conf=-1, alt=-1) port usb:001,002, (new int=0, conf=-1, alt=-1) port usb:001,002
2.194499 gp_libusb1_update           (2): lowlevel libusb1 port not yet opened, no need for libusb changes
2.203862 gp_setting_set              (2): Setting key 'port' to value 'usb:001,002' (gphoto2)
2.212092 save_settings               (2): Saving 2 setting(s) to file "/oem/.gphoto/settings"
2.221661 gp_camera_init              (2): Initializing camera...
2.226138 gp_libusb1_find_device_lib  (2): Looking for USB device (vendor 0x4b0, product 0x43d)... found.
2.235567 gp_libusb1_find_device_lib  (2): Detected defaults: config 1, interface 0, altsetting 0, inep 81, outep 02, intep 83, class 06, subclass 01
2.248230 gp_camera_init              (2): Loading '/home/song/arm_libgphoto2/install_libgphoto2/lib/libgphoto2/2.5.31/ptp2'...
2.264384 gp_port_open                (2): Opening USB port...
2.264767 gp_libusb1_open             (2): ()
2.269492 gp_libusb1_open             (2): claiming interface 0
2.277195 camera_init                 (2): maxpacketsize 512
2.280006 gp_port_set_timeout         (2): Setting port timeout to 8000 milliseconds.
2.287900 ptp                         (2): PTP: Opening session
/app/gphoto2: can't resolve symbol 'static_assert'
^C
Cancelling...

Name the camera
Nikon D3400

libgphoto2 and gphoto2 version

gphoto2 2.5.28

Copyright (c) 2000-2021 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.28         /home/song/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc, popt(m), exif, no cdk, no aa, no jpeg, no readline
libgphoto2      2.5.31         standard camlibs (SKIPPING docupen lumix), /home/song/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc, no ltdl, EXIF
libgphoto2_port 0.12.2         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, /home/song/luckfox-pico/tools/linux/toolchain/arm-rockchip830-linux-uclibcgnueabihf/bin/arm-rockchip830-linux-uclibcgnueabihf-gcc, no ltdl, EXIF, USB, serial without locking
@SongZihui-sudo
Copy link
Author

I solved the problem by modifying the file libgphoto2_port/compiletime-assert.h, it could be that I'm not compiling with the right parameter passes, or it could be that uClibc is incompatible with glibc in some way.

#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L))
/* C11 or later */

#include <assert.h>

/** Compiletime assertion for use inside a function. */
#define COMPILETIME_ASSERT(CONDITION) \
	_Static_assert((CONDITION), #CONDITION)

/** Compiletime assertion for use outside a function. */
#define BARE_COMPILETIME_ASSERT(CONDITION) \
	_Static_assert((CONDITION), #CONDITION)

#else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant