#1 Yesterday 09:14:50

larand54
Member
Registered: 2018-12-25
Posts: 104

Linking errors when compiling the example "httpServerFiles" on lazarus

Running Lazarus-3.6 on Ubuntu-20.04 using oracle vm.

I followed the instructions on GIT-ReadMe

"On Lazarus:

    Just open and compile the /packages/lazarus/mormot2.lpk package;
    and mormot2ui.lpk if needed.
"
And it executed without problem.

But when I tried to compile the example code I got the following messages:

Compile Project, Target: /home/larand/fpc-library/mORMot2/ex/http-server-files/exe/httpServerFiles: Exit code 1, Errors: 1, Warnings: 6
httpServerFiles.dpr(34,1) Warning: Library libdeflatepas.a not found, Linking may fail !
httpServerFiles.dpr(34,1) Warning: Object ../../static/x86_64-linux/sha512-x64sse4.o not found, Linking may fail !
httpServerFiles.dpr(34,1) Warning: Object ../../static/x86_64-linux/crc32c64.o not found, Linking may fail !
Warning: linker: /usr/bin/ld: cannot find ../../static/x86_64-linux/sha512-x64sse4.o: No such file or directory
Warning: linker: /usr/bin/ld: cannot find ../../static/x86_64-linux/crc32c64.o: No such file or directory
Warning: linker: /usr/bin/ld: cannot find libdeflatepas.a: No such file or directory
httpServerFiles.dpr(34,1) Error: Error while linking

It is probably something wrong with my setup of lazarus but I have no idea.

The reason for me to use ubuntu and lazarus is to create an application running on a PI-Zero2W having it to send messages over internet.
//LG


Delphi-11, WIN10

Offline

#2 Yesterday 09:59:40

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,582
Website

Re: Linking errors when compiling the example "httpServerFiles" on lazarus

My guess is that you did not download the static files and put them into the /static/* sub-folder.

and download and extract latest https://synopse.info/files/mormot2static.tgz or https://synopse.info/files/mormot2static.7z into c:\github\mORMot2\static.

Read again the instructions.
smile

Offline

#3 Yesterday 11:01:30

larand54
Member
Registered: 2018-12-25
Posts: 104

Re: Linking errors when compiling the example "httpServerFiles" on lazarus

Sorry I forgot to tell that I also added the static library. Here is what I got there:

larand@larand-VirtualBox:~$ ls fpc-library/mORMot2/static
crc32c64.o  libdeflatepas.a  quickjs.o  sha512-x64sse4.o
dev.sha256  liblizard.a      README.md  sqlite3.o
larand@larand-VirtualBox:~$ 

Delphi-11, WIN10

Offline

#4 Yesterday 12:27:22

larand54
Member
Registered: 2018-12-25
Posts: 104

Re: Linking errors when compiling the example "httpServerFiles" on lazarus

Ok, I found the reason... The linker searches the path: "/home/larand/fpc-library/mORMot2/static/x86_64-linux" but of some reason I got all files directly under the "static" folder.
I could have looked up a bit better. roll


Delphi-11, WIN10

Offline

#5 Yesterday 12:34:05

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,582
Website

Re: Linking errors when compiling the example "httpServerFiles" on lazarus

You need to uncompress the static archive content WITH the paths.

There are plenty of supported targets, so several sub-folders.

Offline

Board footer

Powered by FluxBB