This compiling **works** OK:

```
$ clang -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -l:libconfuse.so main.cpp

```

This one **does not** (undefined references on internal functions):

```
$ clang -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -l:libconfuse.a main.cpp
/tmp/main-115bc4.o: En la función `main':
main.cpp:(.text+0x691): referencia a `cfg_init' sin definir
main.cpp:(.text+0x6ab): referencia a `cfg_parse' sin definir
main.cpp:(.text+0x6da): referencia a `cfg_getstr' sin definir
clang: error: linker command failed with exit code 1 (use -v to see invocation)

```

**Same error** with these command lines:

```
$ clang -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -L/opt/cross-freebsd-10/usr/lib/ -l:libconfuse.a main.cpp
$ clang -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -L/opt/cross-freebsd-10/usr/lib/ -l:libconfuse.a -static main.cpp

```

The files for the [LibConfuse](https://github.com/martinh/libconfuse) C programming library seem to be at the **correct path**:

```
$ ls -la /opt/cross-freebsd-10/usr/lib/libconfuse*
-rwxrwxrwx 1 luis luis 78318 sep 29  2018 /opt/cross-freebsd-10/usr/lib/libconfuse.a
lrwxrwxrwx 1 luis luis    19 sep 29  2018 /opt/cross-freebsd-10/usr/lib/libconfuse.so -> libconfuse.so.2.0.0
lrwxrwxrwx 1 luis luis    19 sep 29  2018 /opt/cross-freebsd-10/usr/lib/libconfuse.so.2 -> libconfuse.so.2.0.0
-rwxr-xr-x 1 luis luis 56616 sep 29  2018 /opt/cross-freebsd-10/usr/lib/libconfuse.so.2.0.0

```

So, I would say the compiler **can not see** the `.a` file. Am I right? How could I **solve** it?

I need to solve this because I am trying to compile with **static linking** for the LibConfuse library, as long as I don't need to install that package on destination computers. So, as I have read, the `.a` library file must be used.

**Further Data**:

* Note that I am **cross-compiling** to FreeBSD. I don't know if that matters.
* When running (on a remote FreeBSD computer) the executable generated by the `.so` mode above, the program yields «Shared object "libconfuse.so.2" not found, required by [MyExecutableName]». This is why I am trying to perform static link.
* Tests performed on **Ubuntu** Linux v16.04.

**New data upon requestion**:

Same first line that works OK, but with `-###` parameter to show extra info:

```
1$ clang -### -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ -l:libconfuse.so main.cpp
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-unknown-freebsd10.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/lib/llvm-3.8/bin/clang" "-cc1" "-triple" "x86_64-unknown-freebsd10.0" "-emit-obj" "-mrelax-all" "-disable-free" "-disable-llvm-verifier" "-main-file-name" "main.cpp" "-mrelocation-model" "static" "-mthread-model" "posix" "-mdisable-fp-elim" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-dwarf-column-info" "-debugger-tuning=gdb" "-resource-dir" "/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0" "-isysroot" "/opt/cross-freebsd-10/" "-internal-isystem" "/opt/cross-freebsd-10//usr/include/c++/v1" "-fdeprecated-macro" "-fdebug-compilation-dir" "/media/Almacen01/Temporal/CPlusPlus/PruebaCSV01" "-ferror-limit" "19" "-fmessage-length" "83" "-fobjc-runtime=gnustep" "-fcxx-exceptions" "-fexceptions" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "/tmp/main-065e9b.o" "-x" "c++" "main.cpp"
 "/usr/bin/ld" "--sysroot=/opt/cross-freebsd-10/" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "a.out" "/opt/cross-freebsd-10//usr/lib/crt1.o" "/opt/cross-freebsd-10//usr/lib/crti.o" "/opt/cross-freebsd-10//usr/lib/crtbegin.o" "-L/opt/cross-freebsd-10//usr/lib" "-l:libconfuse.so" "/tmp/main-065e9b.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/opt/cross-freebsd-10//usr/lib/crtend.o" "/opt/cross-freebsd-10//usr/lib/crtn.o"

```

More data requested by Ahmed:

```
$ clang -### -target x86_64-unknown-freebsd10.0 --sysroot=/opt/cross-freebsd-10/ /opt/cross-freebsd-10/usr/lib/libconfuse.a main.o -o LogManager
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-unknown-freebsd10.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/ld" "--sysroot=/opt/cross-freebsd-10/" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld-elf.so.1" "--hash-style=both" "--enable-new-dtags" "-o" "LogManager" "/opt/cross-freebsd-10//usr/lib/crt1.o" "/opt/cross-freebsd-10//usr/lib/crti.o" "/opt/cross-freebsd-10//usr/lib/crtbegin.o" "-L/opt/cross-freebsd-10//usr/lib" "/opt/cross-freebsd-10/usr/lib/libconfuse.a" "main.o" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "-lc" "-lgcc" "--as-needed" "-lgcc_s" "--no-as-needed" "/opt/cross-freebsd-10//usr/lib/crtend.o" "/opt/cross-freebsd-10//usr/lib/crtn.o"

```