uwew Posted June 1, 2020 at 11:06 AM Posted June 1, 2020 at 11:06 AM Hallo, ich arbeite mich gerade in die Tinkerforge-Welt und die C++-Programmierung ein. Als Hardware verwende ich das Starterkit "Wetterstation (indoor)" mit einem RED-Brick. Momantan komme ich beim folgenden Problem nicht weiter: Wenn ich den Beispielcode auf den RED-Brick hochlade und compiliere erhalte ich folgende Meldungen: Executing make... Script error 2: cc -o WetterstationV02 _Wetterstation_V02.o bricklet_ambient_light.o bricklet_ambient_light_v2.o bricklet_ambient_light_v3.o bricklet_barometer.o bricklet_barometer_v2.o bricklet_humidity.o bricklet_humidity_v2.o bricklet_lcd_20x4.o ip_connection.o ip_connection.o: In function `semaphore_create': ip_connection.c:(.text+0x2094): undefined reference to `sem_init' ip_connection.o: In function `semaphore_destroy': ip_connection.c:(.text+0x20ae): undefined reference to `sem_destroy' ip_connection.o: In function `semaphore_acquire': ip_connection.c:(.text+0x20c8): undefined reference to `sem_wait' ip_connection.o: In function `semaphore_release': ip_connection.c:(.text+0x20f0): undefined reference to `sem_post' ip_connection.o: In function `thread_create': ip_connection.c:(.text+0x2140): undefined reference to `pthread_create' ip_connection.o: In function `thread_join': ip_connection.c:(.text+0x21a6): undefined reference to `pthread_join' collect2: error: ld returned 1 exit status makefile:2: recipe for target 'WetterstationV02' failed make: *** [WetterstationV02] Error 1 ...error Hat jemand eine Idee, woran das liegen könnte? Quote
rtrbt Posted June 2, 2020 at 08:04 AM Posted June 2, 2020 at 08:04 AM Es sieht so aus, als ob du nicht gegen die pthread-Bibliothek linkst. Wenn du in deinem Makefile den cc-Aufrufen das Argument -pthread mitgibst, sollte es funktionieren. Quote
uwew Posted June 2, 2020 at 07:42 PM Author Posted June 2, 2020 at 07:42 PM Du warst auf der richtigen Spur. Ganz herzlichen Dank für den Tipp!! Uwe Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.