F
fl
Hi,
I am compiling the following program below the dot line, which is copied from a website. There are some link errors:
1> overload_Arrow0.cpp
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct A * __thiscall B:perator->(void)" (??CB@@QAEPAUA@@XZ) referenced in function _main
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct B __thiscall C:perator->(void)" (??CC@@QAE?AUB@@XZ) referenced in function _main
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct C __thiscall D:perator->(void)" (??CD@@QAE?AUC@@XZ) referenced in function _main
I do not solve this after several trials. What is wrong with the code?
Thanks a lot.
.......
#include <iostream>
struct A {
void foo();
};
void A::foo()
{
;
}
struct B { A* operator->(); };
struct C { B operator->(); };
struct D { C operator->(); };
int main()
{
D d;
d->foo();
}
I am compiling the following program below the dot line, which is copied from a website. There are some link errors:
1> overload_Arrow0.cpp
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct A * __thiscall B:perator->(void)" (??CB@@QAEPAUA@@XZ) referenced in function _main
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct B __thiscall C:perator->(void)" (??CC@@QAE?AUB@@XZ) referenced in function _main
1>overload_Arrow0.obj : error LNK2019: unresolved external symbol "public: struct C __thiscall D:perator->(void)" (??CD@@QAE?AUC@@XZ) referenced in function _main
I do not solve this after several trials. What is wrong with the code?
Thanks a lot.
.......
#include <iostream>
struct A {
void foo();
};
void A::foo()
{
;
}
struct B { A* operator->(); };
struct C { B operator->(); };
struct D { C operator->(); };
int main()
{
D d;
d->foo();
}