[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking on windows with mingw32

I'm trying to compile an example program (attached):
> E:\>gcc -Ilibssh/include -Llibssh/lib -lssh example.c
> C:\DOCUME~1\VOKER5~1.VOK\LOCALS~1\Temp\ccfW7n39.o:example.c:(.text+0xf): undefined reference to `_imp__ssh_new'
> C:\DOCUME~1\VOKER5~1.VOK\LOCALS~1\Temp\ccfW7n39.o:example.c:(.text+0x21): undefined reference to `_imp__ssh_free'
> collect2: ld returned 1 exit status
What am I doing wrong?
My environment: libssh that I compiled myself with same version of mingw32 gcc (4.5.2), I copied C:\Program Files\libssh to current folder for easier path writing.
#include <libssh/libssh.h>
#include <stdio.h>

int main () {
   ssh_session my_ssh_session;
    my_ssh_session = ssh_new();

   return 0;

Attachment: signature.asc
Description: Digital signature

Archive administrator: postmaster@lists.cynapses.org