Built application does not embed dll
Hello and thanks for your project.
I tried to add you static .lib file to another Visual Studio project and building it succeeds. However the resulting executable still needs the ssh.dll in order to work.
Can you tell me how I can built an application with one static executable which contains the needed ssh.dll?
The static libs are named libssh.lib and libsshd.lib for release/debug respectively. It should only ask for ssh.ddl if you link against ssh.lib (note the missing lib prefix)
Hello,
I have added following settings in the project settings:
- VC++ Directories -> Include Directories: The path to your header files (..\libssh_libssh-0.9.3-2_msvc16\include)
- Linker -> General -> Additional Library Directories: The path to your ssh.lib file: (..\libssh_libssh-0.9.3-2_msvc16\lib\x86)
- Linker -> Input -> Additional Dependencies: Addes ssh.lib to the list.
The project compiles fine but it generates ssh.dll next to the project.exe file. But I want to ship the exe file without shipping the dll file. Can you tell me how to tell Visual Studio to embed the lib file into the project and not to create a dll file for it?

Linker -> Input -> Additional Dependencies: Addes ssh.lib to the list.
As I said this should be "libssh.lib" not "ssh.lib", the later is the one that requires the dll, the former does not.
But if I want to build the project with the "libssh.lib file I receive unresolved external symbol errors.
For example:

When using a static version of libssh (i.e. no dll) you need to define "LIBSSH_STATIC" before including any libssh headers.
Yes I did, still getting the same result :/
Well your doing it wrong ;) I cant reproduce any errors with any of the projects i have that use libssh, they all work fine with LIBSSH_STATIC defined. To ensure you are defining it correctly in all places try adding it to the project settings instead of defining it in code. Also within Visual Studio if you have correctly defined it then when browsing libssh.h you should notice that LIBSSH_API has been defined as empty. The "__imp__xxx" errors you are getting are caused when LIBSSH_API is being defined to one of the __declspec definitions.