Jump to content

IP-Connection.c undefined reference to


lakai_-

Recommended Posts

Hallo,

 

ich habe noch nicht mit Tinkerforge gearbeitet und möchte nun den Wert eines Drehpotentiometers auslesen bzw. bei Änderung des aktuellen Wertes den neuen Wert angeben. Deshalb versuche ich aktuell mit dem Rotary_Poti dies zu "simulieren" und somit einen ersten kleinen Test nachzustellen.

 

Ich bin prinzipiell für die Sprachen C und Python offen, also falls eine Lösung mittels Python möglich ist kann ich auch jederzeit darauf umsteigen. Ich kann einigermaßen mit C programmieren hatte aber bis zum aktuellen Zeitpunkt noch nie Probleme beim einbinden von Headern. Ich denke, dass darin das Problem liegt.

 

Ich habe alle Dateien (example_callback.c , ip_connection.c , ip_connection.h , bricklet_rotary_poti.h , bricklet_rotary_poti.c) auf C in einem gemeinsamen Ordner namens Tinkerforge zusammen mit dem Projekt gespeichert.

Wie in der Online-Anleitung zu Orwell Dev C++ habe ich auch die Projekt-Parameter angepasst.

 

Ich will einfach das example_callback.c Beispiel ans laufen bekommen und wäre für eure Hilfe echt sehr dankbar. Weiß auch nicht warum ich mich da so selten doof anstelle.

 

Mein Problem ist, dass der Compiler den folgenden Fehler anzeigt:

ip_connection.c : undefined reference to `__imp_...usw.

Id returned 1 Exit Status

 

 

Falls eine genaue Problembeschreibung notwendig ist bitte Bescheid geben, kann jederzeit den Fehlercode bzw. die Beschreibung dazu einfügen.

 

 

Vielen Danke im Voraus für eure Hilfe!

 

Viele Grüße

 

Max

Link zu diesem Kommentar
Share on other sites

vielen Dank für die schnelle Rückmeldung!

 

Hier ist das Compile Log:

 

Compiling project changes...

--------

- Project Filename: C:\Tinkerforge\Project1.dev

- Compiler Name: TDM-GCC 4.8.1 64-bit Release

 

Building makefile...

--------

- Filename: C:\Tinkerforge\Makefile.win

 

Processing makefile...

--------

- Makefile Processor: C:\Program Files (x86)\Dev-Cpp\MinGW64\bin\mingw32-make.exe

- Command: mingw32-make.exe -f "C:\Tinkerforge\Makefile.win" all

 

gcc.exe bricklet_rotary_poti.o ip_connection.o example_callback.o -o Project1.exe -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/lib" -L"C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib" -static-libgcc "../../../../Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libws2_32.a" "../../../../Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib32/libadvapi32.a"

 

ip_connection.o:ip_connection.c:(.text+0x112): undefined reference to `__imp_htonl'

ip_connection.o:ip_connection.c:(.text+0x152): undefined reference to `__imp_htonl'

ip_connection.o:ip_connection.c:(.text+0x192): undefined reference to `__imp_htonl'

ip_connection.o:ip_connection.c:(.text+0x1d2): undefined reference to `__imp_htonl'

ip_connection.o:ip_connection.c:(.text+0x212): undefined reference to `__imp_htonl'

ip_connection.o:ip_connection.c:(.text+0x252): more undefined references to `__imp_htonl' follow

ip_connection.o:ip_connection.c:(.text+0x1db8): undefined reference to `__imp_socket'

ip_connection.o:ip_connection.c:(.text+0x1e00): undefined reference to `__imp_setsockopt'

ip_connection.o:ip_connection.c:(.text+0x1e18): undefined reference to `__imp_closesocket'

ip_connection.o:ip_connection.c:(.text+0x1e69): undefined reference to `__imp_closesocket'

ip_connection.o:ip_connection.c:(.text+0x1ea1): undefined reference to `__imp_connect'

ip_connection.o:ip_connection.c:(.text+0x1edc): undefined reference to `__imp_shutdown'

ip_connection.o:ip_connection.c:(.text+0x1f1a): undefined reference to `__imp_recv'

ip_connection.o:ip_connection.c:(.text+0x1f33): undefined reference to `__imp_WSAGetLastError'

ip_connection.o:ip_connection.c:(.text+0x1faa): undefined reference to `__imp_send'

ip_connection.o:ip_connection.c:(.text+0x3e1b): undefined reference to `__imp_getaddrinfo'

ip_connection.o:ip_connection.c:(.text+0x3ed9): undefined reference to `__imp_freeaddrinfo'

ip_connection.o:ip_connection.c:(.text+0x3f5d): undefined reference to `__imp_freeaddrinfo'

ip_connection.o:ip_connection.c:(.text+0x3f77): undefined reference to `__imp_freeaddrinfo'

ip_connection.o:ip_connection.c:(.text+0x45eb): undefined reference to `__imp_WSAStartup'

c:/program files (x86)/dev-cpp/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: ip_connection.o: bad reloc address 0x0 in section `.pdata'

collect2.exe: error: ld returned 1 exit status

 

C:\Tinkerforge\Makefile.win:25: recipe for target 'Project1.exe' failed

mingw32-make.exe: *** [Project1.exe] Error 1

 

 

Compilation results...

--------

- Errors: 1

- Warnings: 0

- Compilation Time: 1,01s

 

 

Ich hoffe die Informationen sind ausreichend.

 

Vielen Dank

 

Link zu diesem Kommentar
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

×   Du hast formatierten Text eingefügt.   Formatierung jetzt entfernen

  Only 75 emoji are allowed.

×   Dein Link wurde automatisch eingebettet.   Einbetten rückgängig machen und als Link darstellen

×   Dein vorheriger Inhalt wurde wiederhergestellt.   Clear editor

×   Du kannst Bilder nicht direkt einfügen. Lade Bilder hoch oder lade sie von einer URL.

×
×
  • Neu erstellen...