termux / termux-tools

Scripts and small programs that are packaged into termux's termux-tools package
GNU General Public License v3.0
280 stars 60 forks source link

Issues with g++ tool #105

Closed MoFox7 closed 2 months ago

MoFox7 commented 2 months ago

I'm trying to compile the file 'Main.cxx' to an exe code 'Main' with the tool g++ and link it with shared lib 'mylib.so'. The problem is that the process returns an error says 'unable to find lib'. I have make sure that the lib is at the same folder with the Main.cxx file, and still returns the same error. IMG_20240710_234139

sylirre commented 2 months ago

mylib.so should be renamed to libmylib.so. Flag -L . should be supplied to enable custom library search path, otherwise linker will look only system library paths.

Issue doesn't belong to termux-tools and is not a bug anyway. Clang is pretty much mature enough to build much more complex projects in Termux than yours.