0

I'm currently adding ftp functionality to a project via this library. Its one optional dependency is OpenSSL, which adds the more specific encryption functionality I'm looking for. I've pulled down both, and built and installed and added as additional includes/dependencies the later, which all lines up with this answer here. However, whenever I go to build my project, any call to OpenSSL functions or macros are deemed 'identifier not found' (the only place these are called to is ftplib.cpp).

In attempts to resolve this:

  • I've changed the include path to an absolute one (which shouldn't make a difference as the relevant environment variable is already included in the project's 'Additional Include Directories').
  • I've rebuilt the whole solution (which only consists of the one project anyway) to regenerate any pre-compiled headers.
  • I've double-checked that all the identifiers can be found in the ssl.h header included.
  • Checked that OpenSSL doesn't use any namespaces.
  • Preprocessed the offending file, which does contain the declarations of these identifiers (as seen in the ssl.h header)!
  • I've successfully compiled/built the preprocessed source file, although wouldn't debug complaining about a missing dll.

This final test tells me that, in theory, everything should be working? If anyone else has any ideas or insights I'd be very grateful!

  • Looks like it can't find the openssl lib/dll. Can you try to link openssl statically and see if that fixes the problem? – melk Apr 02 '20 at 09:56
  • Please provide a [mre] with code and full error messages without relying on external links – Alan Birtles Apr 02 '20 at 10:00
  • @melk, yes statically linking sorted the problem. Thank you, don't know why I didn't think to try that. However, why wouldn't it have been able to find the lib/dlls, they evaluate to the correct absolute path in add lib directories? Im sure it could be any number of reasons, but feel free to jot that down as an answer for top marks! – Will Webster Apr 02 '20 at 11:33

1 Answers1

1

As stated in the comments, the problem seems to be that the program can't find the openssl-library. One solution is to statically link it to the program.

In answer to your comment, it could well be that your IDE knows where the lib is, but not your program. Try adding it to your PATH variable, or putting it in the same directory where the compiled program is.

melk
  • 530
  • 3
  • 9