0

I have built openSSL and put the static libraries under version control (shared objects are not an option).

When I try to build the project while it resides on a shared folder of a vmware Ubuntu VM, it throws me all kinds of unresolved externals, which seemingly stem from 'being unable to find libcrypto.a'.

Strangely enough however, everything works fine, if I copy that exact same folder to the native HDD.

I am using QMake as makefile generator. The (truncated) command being passed to the command line is as follows:

arm-none-linux-gnueabi-g++ -o ../../../build/appl .obj/src/appl.o -L/mnt/hgfs/Programming/Project/Modules/build/ARM -L/mnt/hgfs/Programming/Project/ThirdParty/lib/ARM -L/mnt/hgfs/Programming/Project/build/ /mnt/hgfs/Programming/Project/build/libCore.a -lSQLite -lJSON -lcurl -lssl -lcrypto -lpthread -lrt -lz

All libraries being listed are static libraries, appl is the resulting binary.

Error messages include:

/mnt/hgfs/Programming/Project/build/libCore.a(Task.o): Task.cpp:(.text+0x298): undefined reference to `EVP_aes_256_cbc'
Task.cpp:(.text+0x145c): undefined reference to `EVP_sha1'

And many more like it. And yes, I am sure that the library is available and readable, because, as stated above, linking works just fine, as long as it is done 'natively'.

My host operating system is Windows, Ubuntu is the guest.

Any ideas what could be the cause of this? Thank you.

Refugnic Eternium
  • 4,089
  • 1
  • 15
  • 24

1 Answers1

0

I have not found the reason behind the original issue, but I have found a way around it. Using the GNU Buildtools, you can combine the two openSSL libraries into one static library and link that instead.

For this purpose, I used this link for the basic instructions. My openSSL build script (in Python) therefor now has the following extra step:

subprocess.run(["ar", "-M" ], input="\n".join([
    "create "+ os.path.join(libDir, 'libOpenSSL.a'),
    "addlib "+ os.path.join(installDir, 'lib', 'libcrypto.a'),
    "addlib "+ os.path.join(installDir, 'lib', 'libssl.a'),
    "save",
    "end"
]), text=True, check=True)

libDir is where you want the resulting file to be, installDir is the prefix path, you passed to openSSL configure.

Refugnic Eternium
  • 4,089
  • 1
  • 15
  • 24