[so] Intrebare legata de linkare
Octavian Purdila
tavi at cs.pub.ro
Mon Dec 4 17:13:01 EET 2006
On Monday 04 December 2006 16:48, Andreea Fulger wrote:
> Am si eu o mare curiozitate legata de build-post la tema 3 pe Windows.
>
> Imi apar urmatoarele erori:
>
> TestRW.obj : error LNK2019: unresolved external symbol "struct Monitor *
> __cdecl CreateRWMonitor(void)" (?CreateRWMonitor@@YAPAUMonitor@@XZ)
> referenced in function "void __cdecl TestRW(void)" (?TestRW@@YAXXZ)
> TestStres.obj : error LNK2001: unresolved external symbol "struct Monitor *
> __cdecl CreateRWMonitor(void)" (?CreateRWMonitor@@YAPAUMonitor@@XZ)
> TestRW.obj : error LNK2019: unresolved external symbol "void __cdecl
> StopCit(struct Monitor *)" (?StopCit@@YAXPAUMonitor@@@Z) referenced in
> function "unsigned long __stdcall Functie1ABC(void *)" (?Functie1ABC@@
> YGKPAX at Z)
> TestStres.obj : error LNK2001: unresolved external symbol "void __cdecl
> StopCit(struct Monitor *)" (?StopCit@@YAXPAUMonitor@@@Z)
> TestRW.obj : error LNK2019: unresolved external symbol "void __cdecl
> StartCit(struct Monitor *)" (?StartCit@@YAXPAUMonitor@@@Z) referenced in
> function "unsigned long __stdcall Functie1ABC(void *)" (?Functie1ABC@@
> YGKPAX at Z)
> TestStres.obj : error LNK2001: unresolved external symbol "void __cdecl
> StartCit(struct Monitor *)" (?StartCit@@YAXPAUMonitor@@@Z)
>
> Ce e mai curios este ca eu nu am facut cu structuri ci cu clase -> .cpp.
> (nu am uitat sa pun extern __declspec( dllexport ) deci nu e de aici
> problema)
>
> Din cate am observat in directorul de teste se gaseste un header Monitor.h.
> Nu stiu de ce, dar daca il las pe acela (in care e definita o structura)
> apar problemele de mai sus. Daca il scot imi apare eroarea:
>
> ...\_test\HeaderTest.h fatal error C1083: Cannot open include file "
> Monitor.h"
>
> Daca insa pun in directorul _test Monitor.h al meu (in care este definita
> clasa mea Monitor) problemele nu mai apar... si trec toate testele.
>
> Revin cu vesnica mea intrebare.... unde e problema?
Defineste monitorul cu struct Monitor in loc de class Monitor.
(din pacate testele au aceasta limitare)
tavi
More information about the so
mailing list