[Libssh] Compiling libssh svn on win32

Grr blackonblackjj at gmail.com
Sun Mar 8 03:32:09 CET 2009


I've been trying for a few hours today to get libssh to compile on Win32
through MingW/Dev-cpp and seem to be running into a few roadblocks. I've got
the latest source from svn and had to add the following lines in sftp.h to
get it to compile:

#define uid_t int

#define gid_t int

 

I don't know if this'll cause problems with sftp, but I'm not after sftp
functionality anyway. I've also changed the LINK line in the Makefile to:

LINK= -L. c:/openssl/lib/MinGW/libeay32.a  "c:\program
files\gnuwin32\lib\libz.a" -lws2_32 #C:\dev-cpp\lib\libws2_32.a #-lws2_32
##-lgdi32 -lshell32

 

As having the C:\dev-cpp\lib\libws2_32.a file path hard coded was giving me
errors like this:

C:\Dev-Cpp\Bin\dlltool: Unable to open object file: C:dev-cppliblibws2_32.a

Even though the file is present.

 

The source now seems to compile to object files now, however I'm running
into linking issues now.

I get the following output from dev-cpp:

 

.

gcc -c libssh/socket.c -o libssh/socket.o -I. -Iinclude -Ic:/openssl/include
-I"c:\Program files\gnuwin32\include"

gcc -c libssh/log.c -o libssh/log.o -I. -Iinclude -Ic:/openssl/include
-I"c:\Program files\gnuwin32\include"

dllwrap.exe --export-all-symbols --output-def libssh.def --implib libssh.a
libssh/auth1.o libssh/auth.o libssh/base64.o libssh/buffer.o
libssh/channels1.o libssh/channels.o libssh/client.o libssh/connect.o
libssh/crc32.o libssh/crypt.o libssh/dh.o libssh/error.o
libssh/gcrypt_missing.o libssh/gzip.o libssh/init.o libssh/kex.o
libssh/keyfiles.o libssh/keys.o libssh/messages.o libssh/misc.o
libssh/options.o libssh/packet.o libssh/server.o libssh/session.o
libssh/sftp.o libssh/sftpserver.o libssh/string.o libssh/wrapper.o
libssh/socket.o libssh/log.o -L. c:/openssl/lib/MinGW/libeay32.a
"c:\program files\gnuwin32\lib\libz.a" -lws2_32   -o libssh.dll 

libssh/session.o(.text+0xba):session.c: undefined reference to `agent_new'

libssh/session.o(.text+0x250):session.c: undefined reference to `agent_free'

collect2: ld returned 1 exit status

c:\Dev-Cpp\Bin\dllwrap.exe: no export definition file provided.

Creating one, but that may not be what you want

c:\Dev-Cpp\Bin\dllwrap.exe: c:\Dev-Cpp\Bin\gcc exited with status 1

make.exe: *** [libssh.dll] Error 1

.

 

I do most of my C work under MSVC and am kind of new to MingW/Dev-cpp, so I
was hopping someone could point me in the right direction. Ultimately I'm
trying to build the static library.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cerkinfo.be/pipermail/libssh/attachments/20090307/91c8825a/attachment.htm 


More information about the Libssh mailing list