I am currently Solana through a tutorial. After creating the project, adding dependencies and writing my program, I am supposed to run the following command to create a build of my Rust code that is suitable to deploy to Solana
cargo build-bpf --manifest-path=Cargo.toml --bpf-out-dir=dist/program
Upon running this command I get this error:
error: linking with `\\?\C:\Users\Andrew\.local\share\solana\install\releases\1.9.6\solana-release\bin\sdk\bpf\dependencies\bpf-tools\llvm\bin\ld.lld` failed: exit code: 1
|
= note: "\\\\?\\C:\\Users\\Andrew\\.local\\share\\solana\\install\\releases\\1.9.6\\solana-release\\bin\\sdk\\bpf\\dependencies\\bpf-tools\\llvm\\bin\\ld.lld" "--version-script=C:\\Users\\Andrew\\AppData\\Local\\Temp\\rustcfP4dWA\\list" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.1.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.10.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.11.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.12.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.13.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.14.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.15.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.2.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.3.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.4.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.5.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.6.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.7.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.8.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.9.rcgu.o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.uld0kociqtl6etw.rcgu.o" "--as-needed" "-L" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps" "-L" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\release\\deps" "-L" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib" "-Bstatic" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsolana_program-b2b13310817f5248.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libserde_bytes-aef9648808d9c831.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblake3-9c296c099c94bc54.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libconstant_time_eq-5c8fe6fb88b82dcc.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libarrayvec-5f41e504062ba5bd.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libdigest-9f0b3cc7612e1076.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsubtle-a1562280b43e07dc.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_buffer-a147e55a99bb097c.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libcrypto_common-b64c25475c677681.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libarrayref-62e325660dcbcdad.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsolana_frozen_abi-39b4f96965d78918.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbs58-4ba0e4b26a8bc639.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbv-bb7083cc9f8ca62c.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbytemuck-9d74d8b3a4e69402.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\liblazy_static-40cf5ca4fb226fc4.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsha3-bbd73384f96d675f.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libkeccak-2002a05ba274f01b.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libsha2-a86070b99a0022c7.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libopaque_debug-2cfb1a43922e8fa5.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libdigest-ea1685ff6f232064.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_buffer-167db070cc2bcdb1.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libblock_padding-aae0a410e0661616.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libgeneric_array-a6d784931f2d5898.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libtypenum-5b6a5cc6c27f3e89.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\liblog-c21ec511aa92c880.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libcfg_if-ff438ac9b30946a3.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libnum_traits-de22efb352be6c17.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libbincode-3947f1bf19062b27.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libserde-04054e8a9cafe1ca.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libthiserror-10d222c05f59092d.rlib" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\libborsh-4c2a80a409a40648.rlib" "--start-group" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libstd-09f30ec6d9bcf4bb.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libpanic_abort-0129f2b71ae47d8c.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libstd_detect-291be22324585073.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libhashbrown-b89a97989cce08e1.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\librustc_std_workspace_alloc-0d0f29f2be0139d5.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libunwind-43e4d5094e6a98d9.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcfg_if-f7de57aa039b1991.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\liblibc-f568e648f8426533.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\liballoc-ca33e91228706d40.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\librustc_std_workspace_core-2e1fdcf37081a104.rlib" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcore-38e5758490a5e05e.rlib" "--end-group" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib\\libcompiler_builtins-98c1293c09977ba1.rlib" "-Bdynamic" "--script" "C:\\Users\\Andrew\\AppData\\Local\\Temp\\rustcfP4dWA\\rustc-bpfel-linkfile.ld" "-znoexecstack" "-L" "C:\\Users\\Andrew\\.cache\\solana\\v1.23\\bpf-tools\\rust\\lib\\rustlib\\bpfel-unknown-unknown\\lib" "-o" "C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.so" "--gc-sections" "-shared" "--entry=entrypoint" "-O1"
= note: ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_1 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(borsh::de::BorshDeserialize::try_from_slice::h47523afb23741a51)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_2 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_3 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_4 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_6 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_7 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_8 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_9 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_5 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(_$LT$alloc..string..String$u20$as$u20$borsh..de..BorshDeserialize$GT$::deserialize::he9fe3c9f5f33a2c2)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_10 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_11 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_12 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol abort; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_13 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: relocation R_BPF_64_32 cannot be used against symbol sol_log_; recompile with -fPIC
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: can't create dynamic relocation R_BPF_64_64 against symbol: .L__unnamed_14 in readonly segment; recompile object files with -fPIC or pass '-Wl,-z,notext' to allow text relocations in the output
>>> defined in C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o
>>> referenced by crowd_funding.162a58ac-cgu.0
>>> C:\\Users\\Andrew\\crowd_funding\\crowd-funding\\program\\target\\bpfel-unknown-unknown\\release\\deps\\crowd_funding.crowd_funding.162a58ac-cgu.0.rcgu.o:(entrypoint)
ld.lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
error: could not compile `crowd_funding` due to previous error
My current Solana version is version 1.9.6 and my current rustc version is 1.58.1.
My Cargo.toml file:
[package]
name = "crowd_funding"
version = "0.1.0"
edition = "2021"
[dependencies]
solana-program = "1.7.14"
borsh = "0.9.1"
borsh-derive = "0.9.1"
[features]
no-entrypoint = []
[dev-dependencies]
solana-program-test = "1.7.14"
solana-sdk = "1.7.14"
[lib]
crate-type = ["cdylib", "lib"]
Xargo.toml file:
[target.bpfel-unknown-unknown.dependencies.std]
features = []
Please what can I do to rectify this problem?
I solved the error. /you can't build solana program on a windows environnement.
You need to use a WSL ubuntu subsystem.
Related
I am new to fortran and cmake, so I'm sure there is a simple fix I am missing!
error message:
100%] Linking Fortran executable dynamicmpm
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_createprofiledss_':
Solver.FOR:(.text+0x1143): undefined reference to `dss_create_'
Solver.FOR:(.text+0x11a8): undefined reference to `dss_define_structure_'
Solver.FOR:(.text+0x1471): undefined reference to `dss_reorder_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_solveequations_':
Solver.FOR:(.text+0x35ec): undefined reference to `dss_factor_real_d__'
Solver.FOR:(.text+0x361d): undefined reference to `dss_solve_real_d_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_destroyequations_':
Solver.FOR:(.text+0x4495): undefined reference to `dss_delete_'
CMakeFiles/dynamicmpm.dir/Solver.FOR.o: In function `modsolver_mp_initialisereducedsolution_':
Solver.FOR:(.text+0x5a58): undefined reference to `dss_create_'
Solver.FOR:(.text+0x5abd): undefined reference to `dss_define_structure_'
Solver.FOR:(.text+0x606d): undefined reference to `dss_reorder_'
I included use mkl_dss at the top of the Solver.FOR file
inside the cmakefile:
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(MPM)
enable_language (Fortran)
set(CMAKE_Fortran_COMPILER_ID "GNU")
add_compile_options(-nologo -O2 -ldl -assume buffered_io -fpp -Dinternal_release
-reentrancy threaded -free -warn all -real_size 64 -Qauto -fp:strict
-fp:constant -libs:static -threads -Qmkl:sequential -Qm64
-fmax-identifier-length=63 -ffree-form -ffree-line-length-none -fdefault-real-8)
set(SRCS MOHRStrainSoftening.FOR getversion.for GlobalConstants.FOR mkl_dss.f90 String.for
Feedback.for FileIO.for MatrixMath.FOR timing.for ISORT.FOR GeoMath.FOR Counters.FOR
ElemCalcTETRA.FOR ReadCalculationData.FOR ElemCalcQUAD.FOR InitialiseKernel.FOR
ElemCalcTRI.FOR ReadMaterialData.FOR ElemCalc.FOR Particle.FOR MeshInfo.FOR
ElemConnections.FOR RotBoundCond.FOR ReadGeometryData.FOR InitialiseElementType.for
Solver.FOR MPMData.FOR WriteMPMData.FOR WriteVTKASCII.FOR TwoLayerFormulation.FOR
MPMDYNUnsatConsolidation.FOR WriteVTKBinary.FOR MPMStrainSmoothing.FOR WriteVTKOutput.FOR
MPMDYNConsolidation.FOR MPMStresses.FOR MPMDynContact.FOR MPMDynViscousBoundary.FOR
WriteTestData.FOR Liquid.FOR WriteVTK2Layer.FOR ReadMPMData.FOR RigidBody.f WriteNodalData.FOR
MPMMeshAdjustment.FOR MPMEmptyElements.FOR WriteResultData.FOR MPMConvPhase.FOR
ErrorHandler.for AdjustParticleDiscretisation.FOR MPMExcavation.FOR MPMInit.FOR MPMDYNBTSig.FOR
LagrangianPhase.FOR MPMDYNStresses.FOR MPMDYNConvPhase.FOR MPMQuasiStaticImplicit.FOR
MPMDynamicExplicit.FOR Kernel.for GetStrain.FOR Anura3D.for FORMDE.FOR BuildLoad.FOR
BuildDElastic.FOR MOHR.FOR BuildBJacDet.FOR PRNSTR.FOR GetPrinStress.FOR)
add_executable(dynamicmpm ${SRCS})
I'm sure I am just not linking it properly but I can't seem to find the mistake. I include mkl_dss.f90 in SRCS and have the appropriate use statement in SOLVER.FOR
I am including a link to my previous SO post in case that might be useful:
Executable file does not exist after compiling Fortran code
I am trying to build a shared object (.so) on AIX, using the IBM xlclang++ compiler (v16.1). The .so uses C++11 concurrency, and I have defined some global variables as thread_local. The linker gives Undefined symbol errors for those variables (and for another symbol: .__pt_atexit_np).
There are also some thread_local static variables inside a function. (See DoSomething below.) The linker does not complain about those, but the above-mentioned symbol .__pt_atexit_np might have something to with this.
This code compiles, links, and runs fine on Windows (as a DLL), both when using MS Visual C++ 2019 and clang++ (v9.0.0).
To enable multithreaded code on AIX (I hoped), I added the compiler/linker options -qthreaded and -qtls=global-dynamic.
// --- In GlobData.h: ---
extern thread_local bool GLOB_bTracingEnabled;
// --- In GlobData.cpp: --- (Error: Undefined symbol)
thread_local bool GLOB_bTracingEnabled;
// --- In Calculations.cpp: --- (Error?)
int DoSomething() {
thread_local static int _staticVar;
// ...
}
#--- In makefile: ---
INCL1=.
CCC=/opt/IBM/xlC/16.1.0/bin/xlclang++
CCFLAGS1=-q64 -qrtti -qthreaded -qtls=global-dynamic -qmkshrobj -bE:MyDLL.exp -DNDEBUG -I$(INCL1)
CCFLAGS=$(CCFLAGS1) -c
LD=/opt/IBM/xlC/16.1.0/bin/xlclang++
LDFLAGS=$(CCFLAGS1)
LIB_FILE=mydll.so
SOURCEDIR1=.
OBJ_FILES=StdAfx.o GlobData.o Calculations.o
VPATH=$(SOURCEDIR1)
.SUFFIXES: .cpp .o
#Make all:
all :: $(LIB_FILE)
#Compile rule:
.cpp.o:
$(CCC) $(CCFLAGS) -o$# $<
#Link rule:
$(LIB_FILE) : $(OBJ_FILES)
$(LD) $(LDFLAGS) -o $# $(OBJ_FILES)
strip -t -X64 $#
Link errors:
ld: 0711-317 ERROR: Undefined symbol: .ZTH20GLOB_bTracingEnabled
ld: 0711-317 ERROR: Undefined symbol: .__pt_atexit_np
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
Compiling/linking with option -bnoquiet (as suggested above) gave the following info (tidied up a bit). (Hoping it's useful for someone...)
/opt/IBM/xlC/16.1.0/bin/xlclang++ -O3 -q64 -qchars=signed -qrtti -qthreaded -qtls=global-dynamic -bnoquiet -qmkshrobj -qmaxmem=-1 -bE:mydll.exp -DNDEBUG -DAIX -DBPC_DLL_EXPORTS -I../Common -I../../../aks/source -I. -o ./mydll.so StdAfx.o GlobData.o Calculations.o [...]
(ld): setopt 64
(ld): halt 4
(ld): setfflag 4
(ld): cdtors 1 all 0 s
(ld): savename ./bpc-urm.so
(ld): filelist 92 2
(ld): setopt noprogram
(ld): noentry
NOENTRY: There is no entry point.
(ld): i /lib/crti_64.o
(ld): i StdAfx.o
(ld): i GlobData.o
(ld): i Calculations.o
[...]
(ld): lib /opt/IBM/xlc/16.1.0/lib/libxlopt.a
(ld): lib /opt/IBM/xlc/16.1.0/lib/libxlipa.a
(ld): lib /opt/IBM/xlc/16.1.0/lib/libxl.a
(ld): lib /usr/lib/libc++.a
(ld): lib /opt/IBM/xlC/16.1.0/lib/libCcore.a
(ld): lib /usr/lib/libpthreads.a
(ld): lib /usr/lib/libm.a
(ld): lib /usr/lib/libatomic.a
(ld): lib /usr/lib/libc.a
LIBRARY: Symbols imported from import file /usr/lib/libc++.a[shr.imp]: 0
LIBRARY: Symbols imported from import file /usr/lib/libc++.a[shr_64.imp]: 1834
LIBRARY: Symbols imported from import file /usr/lib/libc++.a[cxxabi.imp]: 0
LIBRARY: Symbols imported from import file /usr/lib/libc++.a[cxxabi_64.imp]: 354
LIBRARY: Symbols imported from import file /opt/IBM/xlC/16.1.0/lib/libCcore.a[shrcore_32.imp]: 0
LIBRARY: Symbols imported from import file /opt/IBM/xlC/16.1.0/lib/libCcore.a[ansicore_32.imp]: 0
LIBRARY: Symbols imported from import file /opt/IBM/xlC/16.1.0/lib/libCcore.a[shrcore_64.imp]: 131
LIBRARY: Symbols imported from import file /opt/IBM/xlC/16.1.0/lib/libCcore.a[ansicore_64.imp]: 81
LIBRARY: Shared object libpthreads.a[shr_xpg5_64.o]: 346 symbols imported.
LIBRARY: Shared object libatomic.a[libatomic.so.1]: 40 symbols imported.
LIBRARY: Shared object libc.a[shr_64.o]: 3110 symbols imported.
LIBRARY: Shared object libc.a[posix_aio_64.o]: 20 symbols imported.
LIBRARY: Shared object libc.a[aio_64.o]: 18 symbols imported.
LIBRARY: Shared object libc.a[pse_64.o]: 8 symbols imported.
LIBRARY: Shared object libc.a[dl_64.o]: 4 symbols imported.
LIBRARY: Shared object libc.a[pty_64.o]: 1 symbols imported.
LIBRARY: Shared object libc.a[cthread_64.o]: 25 symbols imported.
LIBRARY: Shared object libc.a[uchar_64.o]: 4 symbols imported.
FILELIST: Number of previously inserted files processed: 92
(ld): exports mydll.exp
EXPORTS: Symbols exported: 59
(ld): resolve
RESOLVE: 6667 of 30031 symbols were kept.
(ld): addgl /usr/lib/glink64.o
ADDGL: Glink code added for 116 symbols.
(ld): er full
ld: 0711-318 ERROR: Undefined symbols were found.
The following symbols are in error:
Symbol Inpndx TY CL Source-File(Object-File) OR Import-File{Shared-object}
RLD: Address Section Rld-type Referencing Symbol
----------------------------------------------------------------------------------------------
._ZTH20GLOB_bTracingEnabled [240] ER PR File0.cpp(File0.o)
00000cbc .text R_RBR [54] <.GLOB_EnableTracing#AF26_2>
._ZTH20GLOB_bTracingEnabled [386] ER PR File1.cpp(File1.o)
0000004c .text R_RBR [8] <._ZTW20GLOB_bTracingEnabled>
00001564 .text R_RBR [24] .Namespace2::Function1(...)
0000162c .text R_RBR [24] .Namespace2::Function1(...)
00001690 .text R_RBR [24] .Namespace2::Function1(...)
._ZTH20GLOB_bTracingEnabled [563] ER PR File2.cpp(File2.o)
000013dc .text R_RBR [26] .Class1::Function2(...) const
00001400 .text R_RBR [26] .Class1::Function2(...) const
._ZTH20GLOB_bTracingEnabled [782] ER PR File3.cpp(File3.o)
00001710 .text R_RBR [22] .Class2::Function3(...) const
00001788 .text R_RBR [22] .Class2::Function3(...) const
00001800 .text R_RBR [22] .Class2::Function3(...) const
00001878 .text R_RBR [22] .Class2::Function3(...) const
00001910 .text R_RBR [22] .Class2::Function3(...) const
00001928 .text R_RBR [22] .Class2::Function3(...) const
00001940 .text R_RBR [22] .Class2::Function3(...) const
0000202c .text R_RBR [27] <._ZTW20GLOB_bTracingEnabled>
0000286c .text R_RBR [38] .Class2::Function4(...) const
00003064 .text R_RBR [43] .Class2::Function5(...) const
._ZTH20GLOB_bTracingEnabled [283] ER PR File4.cpp(File4.o)
00000260 .text R_RBR [11] .Class3::Function6(...) const
00000370 .text R_RBR [11] .Class3::Function6(...) const
00000604 .text R_RBR [15] <.IPRA.$Function7(...)>
0000069c .text R_RBR [15] <.IPRA.$Function7(...)>
[...]
.__pt_atexit_np [1033] ER PR Calculations.cpp(Calculations.o)
00003720 .text R_RBR [55] .Namespace1::DoSomething(...)
00003750 .text R_RBR [55] .Namespace1::DoSomething(...)
ER: The return code is 8.
ld: 0711-317 ERROR: Undefined symbol: ._ZTH20GLOB_bTracingEnabled
[...]
ld: 0711-317 ERROR: Undefined symbol: .__pt_atexit_np
make: 1254-004 The error code from the last command is 8.
I want to have a function in a Foo.Internal module that is used by other things in there, but it should also be exposed by the Foo module. When I reexport the function from Foo to use elsewhere I get linker errors. I am using stack to build the code, so it might be an issue there, or with cabal, not sure.
Minimal working example:
module Foo.Internal where
secrets = "stuff"
module Foo(secrets) where
import Foo.Internal (secrets)
module Main where
import Foo
main = putStrLn secrets
When I compile this with stack build I get
package-0.1.0.0: build
Preprocessing library package-0.1.0.0...
[1 of 2] Compiling Foo.Internal ( src/Foo/Internal.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo/Internal.o )
[2 of 2] Compiling Foo ( src/Foo.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Foo.o )
In-place registering package-0.1.0.0...
Preprocessing executable 'package-exe' for package-0.1.0.0...
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe ...
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe-tmp/Main.o:(.text+0x26): undefined reference to `packazuEPdwTk5e5ZZOCOiVJMdOJ3P_FooziInternal_secrets_closure'
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/package-exe/package-exe-tmp/Main.o: In function `S2Re_srt':
(.data+0x40): undefined reference to `packazuEPdwTk5e5ZZOCOiVJMdOJ3P_FooziInternal_secrets_closure'
collect2: error: ld returned 1 exit status
I get the following error when compiling GDB.
../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -ldl -ltermcap -lz -lm -L/usr/lib/python2.7/config -lpthread -ldl -lutil -lm -lpython2.7 -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -lexpat ../libiberty/libiberty.a build-gnulib/import/libgnu.a
python.o: In function `gdbpy_target_charset':
python.c:(.text+0x7b5): undefined reference to `PyUnicodeUCS2_Decode'
python.o: In function `gdbpy_target_wide_charset':
python.c:(.text+0x820): undefined reference to `PyUnicodeUCS2_Decode'
py-cmd.o: In function `cmdpy_function':
py-cmd.c:(.text+0x39b): undefined reference to `PyUnicodeUCS2_Decode'
py-cmd.o: In function `cmdpy_completer':
py-cmd.c:(.text+0x74c): undefined reference to `PyUnicodeUCS2_Decode'
py-cmd.c:(.text+0x7c0): undefined reference to `PyUnicodeUCS2_Decode'
py-frame.o:py-frame.c:(.text+0x29b): more undefined references to `PyUnicodeUCS2_Decode' follow
py-utils.o: In function `python_string_to_unicode':
py-utils.c:(.text+0xe1): undefined reference to `PyUnicodeUCS2_FromEncodedObject'
py-utils.o: In function `unicode_to_encoded_string':
py-utils.c:(.text+0x13c): undefined reference to `PyUnicodeUCS2_AsEncodedString'
py-utils.o: In function `unicode_to_encoded_python_string':
py-utils.c:(.text+0x1c7): undefined reference to `PyUnicodeUCS2_AsEncodedString'
py-utils.o: In function `target_string_to_unicode':
py-utils.c:(.text+0x409): undefined reference to `PyUnicodeUCS2_Decode'
py-value.o: In function `valpy_string':
py-value.c:(.text+0xb8b): undefined reference to `PyUnicodeUCS2_Decode'
py-value.o: In function `valpy_str':
py-value.c:(.text+0x141b): undefined reference to `PyUnicodeUCS2_Decode'
collect2: ld returned 1 exit status
make[2]: *** [gdb] Error 1
make[2]: Leaving directory
What might be the reason for it?
I have build sqlcipher for Linux but it depends on openssl. I want to configure sqlcipher to work without external openssl library by linking it statically.
I configure sqlcipher with this command
./configure --prefix=/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/ --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="/usr/lib64/libcrypto.a"
make
after that I got next strings:
/libtool --mode=link gcc -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 /usr/lib64/libcrypto.a -DHAVE_READLINE=0 \
-o sqlite3 ./src/shell.c libsqlite3.la \
-lpthread -rpath "/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib"
libtool: link: gcc -DSQLITE_HAS_CODEC -DSQLITE_OS_UNIX=1 -I. -I./src -I./ext/rtree -D_HAVE_SQLITE_CONFIG_H -DNDEBUG -I/usr/include -DSQLITE_THREADSAFE=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DHAVE_READLINE=0 -o sqlite3 ./src/shell.c /usr/lib64/libcrypto.a ./.libs/libsqlite3.a -lpthread -Wl,-rpath -Wl,/home/admin/Downloads/qt-everywhere-opensource-src-4.8.0/src/plugins/sqldrivers/sqlcipher/lib
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_activate':
sqlite3.c:(.text+0xb66): undefined reference to `EVP_get_cipherbyname'
sqlite3.c:(.text+0xb70): undefined reference to `OPENSSL_add_all_algorithms_noconf'
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_random':
sqlite3.c:(.text+0xc0c): undefined reference to `RAND_bytes'
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_codec_ctx_set_cipher':
sqlite3.c:(.text+0x11a2): undefined reference to `EVP_get_cipherbyname'
sqlite3.c:(.text+0x11ba): undefined reference to `EVP_CIPHER_key_length'
sqlite3.c:(.text+0x11d4): undefined reference to `EVP_CIPHER_iv_length'
sqlite3.c:(.text+0x11ee): undefined reference to `EVP_CIPHER_block_size'
sqlite3.c:(.text+0x11fd): undefined reference to `EVP_sha1'
sqlite3.c:(.text+0x1205): undefined reference to `EVP_MD_size'
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_hmac':
sqlite3.c:(.text+0x1880): undefined reference to `HMAC_CTX_init'
sqlite3.c:(.text+0x1885): undefined reference to `EVP_sha1'
sqlite3.c:(.text+0x18b9): undefined reference to `HMAC_Init_ex'
sqlite3.c:(.text+0x18d9): undefined reference to `HMAC_Update'
sqlite3.c:(.text+0x18f8): undefined reference to `HMAC_Update'
sqlite3.c:(.text+0x1917): undefined reference to `HMAC_Final'
sqlite3.c:(.text+0x1929): undefined reference to `HMAC_CTX_cleanup'
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_page_cipher':
sqlite3.c:(.text+0x1b35): undefined reference to `EVP_CipherInit'
sqlite3.c:(.text+0x1b4a): undefined reference to `EVP_CIPHER_CTX_set_padding'
sqlite3.c:(.text+0x1b7a): undefined reference to `EVP_CipherInit'
sqlite3.c:(.text+0x1ba2): undefined reference to `EVP_CipherUpdate'
sqlite3.c:(.text+0x1bcc): undefined reference to `EVP_CipherFinal'
sqlite3.c:(.text+0x1be2): undefined reference to `EVP_CIPHER_CTX_cleanup'
./.libs/libsqlite3.a(sqlite3.o): In function `sqlcipher_cipher_ctx_key_derive':
sqlite3.c:(.text+0x1d3a): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
sqlite3.c:(.text+0x1e08): undefined reference to `PKCS5_PBKDF2_HMAC_SHA1'
collect2: ld returned 1 exit status
make: *** [sqlite3] Error 1
I have installed openssl and openssl-dev packages and /usr/lib64/libcrypto.a exists.
What I do wrong?
Adjust your CFLAGS to include the path to the OpenSSL header files. Something like this:
CFLAGS="-DSQLITE_HAS_CODEC -I/path/to/openssl/include"