<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">><b><span style="font-weight: bold;">From:</span></b> Catalin Moraru <catalin.me@gmail.com><br><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt">><font size="2" face="Tahoma"><b><span style="font-weight: bold;">To:</span></b> Sisteme de Operare <so@cursuri.cs.pub.ro><br><b><span style="font-weight: bold;"></span></b></font>><font size="2" face="Tahoma"><b><span style="font-weight: bold;">Sent:</span></b> Sun, May 8, 2011 1:02:22 PM<br><b><span style="font-weight: bold;"></span></b></font>><font size="2" face="Tahoma"><b><span style="font-weight: bold;">Subject:</span></b> Re: [so] [Tema 4][Windows]Problema linkare<br></font>><br>
><br>><br><div class="gmail_quote">>2011/5/8 Alex Gorunescu <span dir="ltr"><<a rel="nofollow" ymailto="mailto:algorunescu@yahoo.com" target="_blank" href="mailto:algorunescu@yahoo.com">algorunescu@yahoo.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex;">
<div><div style="font-family:times new roman, new york, times, serif;font-size:12pt;">>Nu reusesc sa compilez testele. Daca fac cum scrie pe pagina de cerinte<span style="font-family:monospace;"> "</span>link /release /dll /out:LibMonitor.dll LibMonitor.obj ControlMonitor.obj" imi da unresolved external symbol la toate functiile pentru testare. Am luat-o altfel. Am >facut intai LibMonitor.lib si apoi am dat <span style="font-family:monospace;">"</span>link /release /dll /out:LibMonitor.dll LibMonitor.lib ControlMonitor.obj" si a mers dar cand dau build-post la teste o ia razna iar cu unresolved external symbols. Nu ma prind ce fac gresit. Pe net >toate tutorialele te baga in interfata grafica de la visual studio pentru a face un dll iar eu incerc sa-l fac din consola ca sa stiu ce bag in makefile dupa.<br>
<pre>>Any ideas ? Sursele sunt facute in c nu c++. <br></pre></div></div></blockquote><div>>1. Ai inaintea antetelor functiilor '__declspec(dllexport) ' ?<br>><br>>Spre exemplu, daca ai avea un fisier LibMonitor.h, atunci ar trebui sa ai functiile monitorului declarate astfel:<br>
><br>>__declspec(dllexport) Monitor* Create(int, char);<br>>__declspec(dllexport) int Enter(Monitor*);<br>>__declspec(dllexport) int Leave(Monitor*);<br>>__declspec(dllexport) int Wait(Monitor*, int);<br>>__declspec(dllexport) int Signal(Monitor*, int);<br>
>__declspec(dllexport) int Broadcast(Monitor*, int);<br>>__declspec(dllexport) int Destroy(Monitor*);<br>><br>>2. Ai sursele create cu extensia '.cpp' ? (chiar daca sunt facute in c)<br>><br>>--<br>>Cătălin<br><br>Merci de sfaturi. Nu aveam .cpp la surse. Asta a rezolvat comanda link. Acum se fac dll-urile fara eroare dar testele tot nu compileaza "Unresolved external symbol" iar. O sa-mi bat capul in continuare sa vad de ce. Am pierdut mai mult timp incercand sa compilez nenorocitele astea de dll-uri decat mi-a luat sa implementez toata tema in linux.<br><br>Alex.<br></div>
</div>
</div></div>
</div></body></html>