Class ref in pre-verified class resolved to unexpected implementation

报错场景:插件开发中,先在插件中引用某jar包后,将插件放入宿主运行,结果报此错;

 

原因分析:宿主与插件引用了相同的jar包,造成重复引用。去掉后问题解决!

展开阅读全文

unexpected 'class'

01-31

#include rnusing namespace std;rnrnenum BREED GOLDEN, CAIRN, DANDIE, SHETLAND, DOBERMAN, LAB rnrnclass Mammalrnrnpublic:rn Mammal() cout << "Mammal constructor...\n"; rn ~Mammal() cout << "Mammal destructor...\n"; rnrn void Speak() const cout << "Mammal sound!\n"; rn void Sleep() const cout << "shhh. I'm sleeping.\n"; rnrnprotected:rn int itsAge;rn int itsWeight;rn;rnrnclass Dog: public Mammalrnrnpublic:rnrn Dog() cout << "Dog constructor...\n"; rn ~Dog() cout << "Dog destructor...\n"; rnrn void WagTal() const cout << "Tail wagging...\n"; rn void BegForFood() const cout << "Begging for food...\n"; rn void Speak() const cout << "Woof!\n"; rnrnprivate:rn BREED itsBreed;rn;rnrnint main()rnrn Mammal bigAnimal;rn Dog Fido;rn bigAnimal.Speak();rn Fido.Speak();rnrn char response;rn cin >> response;rnrn return 0;rnrn--------------------Configuration: excise - Win32 Debug--------------------rnCompiling...rnexcise.cpprnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(7) : error C2236: unexpected 'class' 'Mammal'rnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(7) : error C2143: syntax error : missing ';' before ''rnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(7) : error C2447: missing function header (old-style formal list?)rnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(21) : error C2504: 'Mammal' : base class undefinedrnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(37) : error C2065: 'Mammal' : undeclared identifierrnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(37) : error C2146: syntax error : missing ';' before identifier 'bigAnimal'rnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(37) : error C2065: 'bigAnimal' : undeclared identifierrnD:\Program Files\Microsoft Visual Studio\MyProjects\excise\excise.cpp(39) : error C2228: left of '.Speak' must have class/struct/union typern执行 cl.exe 时出错.rnrnexcise.exe - 1 error(s), 0 warning(s)rn何故?rn 论坛

没有更多推荐了,返回首页