It is posible to use .dll or .lib in rust project?

Hello, Im trying use in my project binary file from CDB Interfaces Manual — CDB Interfaces 2020 (sofistik.com).
I have two files:

  • sof_cdb_w-70.dll
  • sof_cdb_w_dll.lib

My code:

#[cfg(windows)]
use libloading::*;
fn main() {
    unsafe {
        let lib =  Library::new(r"C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\sof_cdb_w_dll.lib").unwrap();
        let func:  Symbol<unsafe extern fn() -> u32> = lib.get(b"sof_cdb_init").unwrap();
    }; 
}

When i run program, i have:

thread 'main' panicked at 'called Result::unwrap() on an Err value: LoadLibraryExW { source: Os { > code: 193, kind: Other, message: "%1 is not a valid Win32 application." } }', src\main.rs:10:104
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
error: process didn't exit successfully: target\debug\sofistikAPI.exe (exit code: 101)

It is posible to use libary from other language?

I believe you want to load the .dll file using libloading, not the .lib file. .lib files are generally for static linking, but I'm not sure how much support there is for statically linking external DLLs using the .lib file in Rust.

1 Like

Isn't it expected that you will load .dll file, not .lib?

Should I load the .dll file?

$ nm sof_cdb_w-70.dll
nm: sof_cdb_w-70.dll: no symbols

nm sof_cdb_w_dll.lib | rg sof_cdb_init
...
0000000000000000 I __imp_sof_cdb_init_u
0000000000000000 T sof_cdb_init_u
...

If the DLL doesn't have symbols I am not sure that it is possible to load it at runtime. Try linking against it instead. You can use a build script for this. I think you will need to link against the .lib file and then ensure that the .dll file is in the same dir as the executable.

2 Likes

Their docs say to use the .lib: Configure project — CDB Interfaces 2020

Typically you would write a sys crate for this.

The .lib file is likely an import library, not a static library. An import library specifies the symbols in a dynamic library without actually containing the executable code. This allows for linking to an import library without having access to the dynamic library.

2 Likes

Litle succes :slight_smile:

PS C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI> cargo run
Blocking waiting for file lock on build directory
Compiling bindgen v0.58.1
Compiling sofistik_api v0.1.0 (C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI)
Finished dev [unoptimized + debuginfo] target(s) in 31.14s
Running target\debug\sofistik_api.exe

All files *.h includet in examples from sofistik are commpiling.

But i dont have idea how I can call any method in Rust from sofistik API.

Here is my code:

error: linking with x86_64-w64-mingw32-gcc failed: exit code: 1
|
= note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--disable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "-nostartfiles" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\self-contained\crt2.o" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\rsbegin.o" "-L" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib" "-L" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\self-contained" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.10m64grj8zwk89wt.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.114f4837q2n727bh.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.1fvfw56uh0qwlzqe.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.1o8kt1vcogf83p9f.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.1qe2p58le0mfx0q0.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.1ssd0vlo623nus2r.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.20lzeee7m6lrtbg7.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.2629esarsfy1ky6s.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.2cw1p3f3v81lia08.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.2phhu0b75tnugnmr.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.2qbplptdr84afct2.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.2yu7ripc345qp91n.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.35vszidy2czjmebc.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.3bdgf4c395k97wbp.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.3feuwlqi7cpganke.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.3jwtsqnxbfx4c88d.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.4djueizvovosne8b.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.4e3jo2oz7vt94l4j.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.4wtrbe7e72r3ww2r.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.4x5ltbw9wrhxw38c.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.51f3mdqyn2a2zr17.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.55kdw27crnpbdvb9.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.kzfq3t0nqpub3qj.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.np5unnra3eee7sq.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.yil3whfc7jzinfb.rcgu.o" "-o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.exe" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.3tz49sgrbas8j1rp.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps" "-L" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib" "-Wl,-Bstatic" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\liblibc-f5c104b6620f3091.rlib" "-Wl,--start-group" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libstd-b3e05fb1c668425d.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libpanic_unwind-de6b1e1839bc55c3.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libobject-d462ba5d23db4375.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libaddr2line-91f359062fcc4faa.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libgimli-1285b73e96b90384.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_demangle-2e399a6f31e1ac65.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libhashbrown-cdd2f8d624f05ca0.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_alloc-dfacd2ffb7ac7d0f.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libunwind-113950dd2d010a25.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libcfg_if-acaab9dfbd2da45f.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\liblibc-c8a337935bf5603e.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\liballoc-e81d86989503275b.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\librustc_std_workspace_core-037111c82a639dfe.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libcore-78a80358c99fdc57.rlib" "-Wl,--end-group" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\libcompiler_builtins-ae4f14151f891fbb.rlib" "-Wl,-Bdynamic" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-gnu\lib\rustlib\x86_64-pc-windows-gnu\lib\rsend.o"
= note: C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api-d685e56ee3425ad0.np5unnra3eee7sq.rcgu.o: In function sofistik_api::main::h0f66112c4db15508': C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI/src\main.rs:17: undefined reference to ?sof_cdb_init@@YAHPEBDH@Z'

error: aborting due to previous error; 1506 warnings emitted

error: could not compile sofistik_api

Caused by:
process didn't exit successfully: rustc --crate-name sofistik_api --edition=2018 src\main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=d685e56ee3425ad0 -C extra-filename=-d685e56ee3425ad0 --out-dir C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps -C incremental=C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\incremental -L dependency=C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps --extern libc=C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\liblibc-f5c104b6620f3091.rlib --extern sofistik_api=C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\libsofistik_api-b2184dbc9b89150c.rlib (exit code: 1)

I believe import libraries for the MSVC toolchain (which this one likely is) don't work for the MinGW toolchain. Does it work with the MSVC toolchain? The target triple is x86_64-pc-windows-msvc. You will need to install the visual studio build tools (or visual studio in it's entirety) when using the MSVC toolchain though.

Hello, I Have VS and MVSC. It is similar situation....

error: linking with link.exe failed: exit code: 1120
|
= note: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX64\x64\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.12c4q4vfzo2rt09m.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.1drmrcudx6glphei.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.1g3i0lz7xhkn1li5.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.1gcn3k5te3hlf0h3.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.1ln8quagkfkio9ez.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.23ds1mak4fzb2q2y.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.27l7swmvk7wp549y.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.28fdr2wmvdm2q1wd.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.2gveq96xtd6ukjy8.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.2o6mg6z0cdgcj9uh.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3e6ryi4tdc7enbp6.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3gi0zlwcbgi1g17f.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3j4cshwkhgpy45fc.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3mkp8ibfdy5ixyj2.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3n738r5a2z5lhong.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.3rocl19vos5gqrso.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.4ji0qgq562uiqwr6.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.4nyxtxhkl7vig205.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.4x1yiaycc7dotusf.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.7i6lsnm8p0rndku.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.cqc97q2oxol6jud.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.ecmpvjwbsnx5ewu.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.efh4y5cromfowqy.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.p0fd1s29asdyfpo.rcgu.o" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.sj4qgda4pc4rt96.rcgu.o" "/OUT:C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.exe" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.86nwnxc8roywolr.rcgu.o" "/OPT:REF,NOICF" "/DEBUG" "/NATVIS:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\intrinsic.natvis" "/NATVIS:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\liballoc.natvis" "/NATVIS:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libcore.natvis" "/NATVIS:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\etc\libstd.natvis" "/LIBPATH:C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps" "/LIBPATH:C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib" "C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\liblibc-63c85e47a115a168.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libstd-e5130808ccb074ce.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libpanic_unwind-580326a9fdffe4b1.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_demangle-a76d77b5d9ed4759.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libhashbrown-d5a5b7aa7eeea0b8.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-4b74b4985b95e6c8.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libunwind-b2d5eb0d27518d1c.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcfg_if-8a162ec37e71ea47.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liblibc-45fb7c94b612099e.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\liballoc-3c0db88c6c3c2080.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_core-ae8fea3b9ef7193c.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcore-44bd5dbe4e29964c.rlib" "C:\Users\lukasz.dlucik\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-msvc\lib\libcompiler_builtins-2e1363d96f00dd60.rlib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "msvcrt.lib"
= note: sofistik_api.1drmrcudx6glphei.rcgu.o : error LNK2019: unresolved external symbol "int __cdecl sof_cdb_init(char const *,int)" (?sof_cdb_init@@YAHPEBDH@Z) referenced in function _ZN12sofistik_api4main17hf0b649b3b291ed11E
C:\Users\lukasz.dlucik\Documents\GIT\sofistikAPI\target\debug\deps\sofistik_api.exe : fatal error LNK1120: 1 unresolved externals

error: aborting due to previous error; 1506 warnings emitted

error: could not compile sofistik_api