Build linux application from WSL failes with the error: file format not recognized; treating as linker script

Viewed 339

I am trying to build an application that was developed in Ubuntu. I need to make some changes in the application. I do not have an ubuntu machine and want to avoid the Virtual Box route. I thought of using WSL to build the application from Windows machine. Compilation went successful but it fails at the linker step (due to symlinks).

/usr/bin/ld:/mnt/d/Agent/poco/bin/linux/x64/libPocoDataSQLite.so: file format not recognized; treating as linker script
/usr/bin/ld:/mnt/d/Agent/poco/bin/linux/x64/libPocoDataSQLite.so:0: syntax error
collect2: error: ld returned 1 exit status

libPocoDataSQLite.so symlink and libPocoDataSQLite.so.51 actual shared library both are present in the path. Any pointer to the solution is appreciable.

I am not sure if https://github.com/microsoft/WSL/issues/5118 is the same issue.

enter image description here

1 Answers

Not sure if this is correct, but looks like your library files are on the Windows NTFS or FAT filesystem. Therefore, the symbolic link may be treated differently and read as its own content, not content of the file it is supposed to be pointing to. I suggest to try to place those libraries somewhere on the Linux FS, say under /home/youruser (but do not just copy, since content is already malformed, either build from source or extract from the original archive), and recreate all symbolic links properly and try again.

Related