<div dir="ltr">Salut!<br><br>Incercam sa testez monitorul separat de cealalta biblioteca Readers-Writers. Pana acum nu am reusit. Poate ma ajuta cineva...<br>Am dat urmatoarele comenzi:<br><br>#creare biblioteca partajata<br>
gcc -c monitor.c<br>gcc -shared -fPIC monitor.o -o libMonitor.so #Stiu ca in tema e numele cu "L"(LibMonitor.so). E vreo diferenta?<br><br>#creare program de test - main() este in test.c si apeleaza TestMonitor() pe care am copiat-o direct aici din sursa cu acelasi nume.<br>
gcc Test1.c Test2.c Test3.c Test4.c Test5.c Test6.c ControlMonitor.c test.c -o test -lMonitor -L.<br><br>Rezultat:<br><br>/tmp/ccO95MO7.o: In function `Test2':<br>Test2.c:(.text+0x264): undefined reference to `pthread_create'<br>
Test2.c:(.text+0x2a3): undefined reference to `pthread_create'<br>Test2.c:(.text+0x2d2): undefined reference to `pthread_join'<br>Test2.c:(.text+0x301): undefined reference to `pthread_join'<br>/tmp/ccy06oPd.o: In function `Test3':<br>
Test3.c:(.text+0x867): undefined reference to `pthread_create'<br>Test3.c:(.text+0x8a6): undefined reference to `pthread_create'<br>Test3.c:(.text+0x8e5): undefined reference to `pthread_create'<br>Test3.c:(.text+0x924): undefined reference to `pthread_create'<br>
Test3.c:(.text+0x953): undefined reference to `pthread_join'<br>Test3.c:(.text+0x982): undefined reference to `pthread_join'<br>Test3.c:(.text+0x9b1): undefined reference to `pthread_join'<br>Test3.c:(.text+0x9e0): undefined reference to `pthread_join'<br>
/tmp/ccbj6vye.o: In function `Test4':<br>Test4.c:(.text+0x88f): undefined reference to `pthread_create'<br>Test4.c:(.text+0x8ce): undefined reference to `pthread_create'<br>Test4.c:(.text+0x90d): undefined reference to `pthread_create'<br>
Test4.c:(.text+0x94c): undefined reference to `pthread_create'<br>Test4.c:(.text+0x98b): undefined reference to `pthread_create'<br>Test4.c:(.text+0x9ba): undefined reference to `pthread_join'<br>Test4.c:(.text+0x9e9): undefined reference to `pthread_join'<br>
Test4.c:(.text+0xa18): undefined reference to `pthread_join'<br>Test4.c:(.text+0xa47): undefined reference to `pthread_join'<br>Test4.c:(.text+0xa76): undefined reference to `pthread_join'<br>/tmp/cc4Lqtnj.o: In function `Test5':<br>
Test5.c:(.text+0x876): undefined reference to `pthread_create'<br>Test5.c:(.text+0x8b5): undefined reference to `pthread_create'<br>Test5.c:(.text+0x8f4): undefined reference to `pthread_create'<br>Test5.c:(.text+0x933): undefined reference to `pthread_create'<br>
Test5.c:(.text+0x962): undefined reference to `pthread_join'<br>Test5.c:(.text+0x991): undefined reference to `pthread_join'<br>Test5.c:(.text+0x9c0): undefined reference to `pthread_join'<br>Test5.c:(.text+0x9ef): undefined reference to `pthread_join'<br>
/tmp/ccviQM2s.o: In function `Test6':<br>Test6.c:(.text+0x931): undefined reference to `pthread_create'<br>Test6.c:(.text+0x970): undefined reference to `pthread_create'<br>Test6.c:(.text+0x9af): undefined reference to `pthread_create'<br>
Test6.c:(.text+0x9ee): undefined reference to `pthread_create'<br>Test6.c:(.text+0xa2d): undefined reference to `pthread_create'<br>Test6.c:(.text+0xa5c): undefined reference to `pthread_join'<br>Test6.c:(.text+0xa8b): undefined reference to `pthread_join'<br>
Test6.c:(.text+0xaba): undefined reference to `pthread_join'<br>Test6.c:(.text+0xae9): undefined reference to `pthread_join'<br>Test6.c:(.text+0xb18): undefined reference to `pthread_join'<br>./libMonitor.so: undefined reference to `decEnter'<br>
./libMonitor.so: undefined reference to `decCond'<br>./libMonitor.so: undefined reference to `pthread_key_create'<br>./libMonitor.so: undefined reference to `incWait'<br>./libMonitor.so: undefined reference to `incCond'<br>
./libMonitor.so: undefined reference to `pthread_getspecific'<br>./libMonitor.so: undefined reference to `decWait'<br>./libMonitor.so: undefined reference to `incSignal'<br>./libMonitor.so: undefined reference to `decSignal'<br>
./libMonitor.so: undefined reference to `pthread_setspecific'<br>collect2: ld returned 1 exit status<br><br><br><br><br><br><br></div>