MinGW Anfängerfrage
Verfasst: Mi Okt 30, 2013 2:36 am
Hallo!
Ich versuche mich gerade im Umgang mit MinGW und habe ein Problem beim Compilieren eines Beispielquelltextes.
Undzwar habe ich mir libssh runtergeladen und wollte ein Example durchlaufen lassen, leider wird mir vor jede Funktion die Libssh mitbringt ein __imp_ Präfix angehangen und der Compiler sagt dann das er die Funktion nicht kennt.
Auf einer Seite habe ich gelesen das gcc eine Library nur als diese erkennt, wenn auch lib... davorsteht, auch das ändert leider nichts am Problem.
Ich hoffe jemand hat einen Tip.
Ich versuche mich gerade im Umgang mit MinGW und habe ein Problem beim Compilieren eines Beispielquelltextes.
Undzwar habe ich mir libssh runtergeladen und wollte ein Example durchlaufen lassen, leider wird mir vor jede Funktion die Libssh mitbringt ein __imp_ Präfix angehangen und der Compiler sagt dann das er die Funktion nicht kennt.
Auf einer Seite habe ich gelesen das gcc eine Library nur als diese erkennt, wenn auch lib... davorsteht, auch das ändert leider nichts am Problem.
Ich hoffe jemand hat einen Tip.
C:\MinGW\SSH_test>gcc -LC:\MinGw\libssh-0.5.0\lib -LC:\MinGW\libssh-0.5.0\bin -IC:\MinGW\libssh-0.5.0\include example_ssh.c -o test.exe C:\MinGW\libssh-0.5.0\lib\SSH.lib
cygwin warning:
MS-DOS style path detected: C:\MinGW\libssh-0.5.0\lib\SSH.lib
Preferred POSIX equivalent is: /cygdrive/c/MinGW/libssh-0.5.0/lib/SSH.lib
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.h ... -pathnames
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x21): undefined reference to `__imp_ssh_is_server_known'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x21): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_is_server_known'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x38): undefined reference to `__imp_ssh_get_pubkey_hash'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x38): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_get_pubkey_hash'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0xc0): undefined reference to `__imp_ssh_print_hexa'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0xc0): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_print_hexa'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x1b1): undefined reference to `__imp_ssh_get_hexa'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x1b1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_get_hexa'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x27b): undefined reference to `__imp_ssh_write_knownhost'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x27b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_write_knownhost'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x2cd): undefined reference to `__imp_ssh_get_error'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x2cd): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_get_error'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x333): undefined reference to `__imp_ssh_new'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x333): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_new'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x364): undefined reference to `__imp_ssh_options_set'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x364): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_options_set'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x374): undefined reference to `__imp_ssh_connect'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x374): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_connect'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x38d): undefined reference to `__imp_ssh_get_error'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x38d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_ssh_get_error'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x3bb): undefined reference to `__imp_ssh_free'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x3bb): additional relocation overflows omitted from the output
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x3e5): undefined reference to `__imp_ssh_disconnect'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x3f5): undefined reference to `__imp_ssh_free'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x42e): undefined reference to `__imp_ssh_userauth_password'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x447): undefined reference to `__imp_ssh_get_error'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x475): undefined reference to `__imp_ssh_disconnect'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x485): undefined reference to `__imp_ssh_free'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x4ab): undefined reference to `__imp_ssh_disconnect'
/cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o:example_ssh.c:(.text+0x4bb): undefined reference to `__imp_ssh_free'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: /cygdrive/c/Users/brf24139/AppData/Local/Temp/cc5n15Y3.o: bad reloc address 0x210 in section `.rdata'
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/../../../../x86_64-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: error: ld returned 1 exit status