AppImageCommunity / libappimage

Implements functionality for dealing with AppImage files
https://appimage.org
Other
46 stars 29 forks source link

Arguments to add to compile #167

Closed YOURLEGEND closed 2 years ago

YOURLEGEND commented 2 years ago

What arguments should be added to gcc/g++ to compile when programs need the library to be linked? Just like -lz for zlib.

YOURLEGEND commented 2 years ago

Sorry for disturbing but i've got the answer "-lappimage". But another problem occured.

# gcc -no-pie final.s -lappimage -ldl -lm -lz -lrt -lpthread -lcrypt -lgmp -m64
/usr/bin/ld: error in /tmp/cctY2szC.o(.eh_frame); no .eh_frame_hdr table will be created.
/tmp/cctY2szC.o: In function `S_0x404C5A':
(.text+0x775): undefined reference to `have_libloaded'
/tmp/cctY2szC.o: In function `BB_73':
(.text+0x78f): undefined reference to `libhandle'
/tmp/cctY2szC.o: In function `BB_74':
(.text+0x79c): undefined reference to `load_library_errmsg'
/tmp/cctY2szC.o: In function `S_0x404CA0':
(.text+0x7bf): undefined reference to `have_libloaded'
collect2: error: ld returned 1 exit status

I'm trying to assemble this assembly file via gcc. As errors showed, other libraries needed to be linked. Four undefined references(in fact three) can be found in src/patches/squashfuse_dlopen.h. So i guess libappimage is exactly the missing library. And latest libappimage(v1.0.4) has been installed. But the lib file libappimage.so was linked to another file libappimage.so.1.0.3, which seems to be an older version. I have no idea if this is related to the problem. Thanks for your help!

TheAssassin commented 2 years ago

We use CMake as a build system and officially support only CMake's exported targets when using libappimage as a library. We cannot provide support for manual linking.