N
N
Nordman992021-01-31 07:43:10
C++ / C#
Nordman99, 2021-01-31 07:43:10

How to fix the error of creating an object from an abstract class?

There is an old C++ project under VisualC++2005. Opened it in a modern 2019 studio. This is in order to recompile these sources for x64. Under x86, they apparently compiled without problems, although I did not try it myself, because. along with the source, there are also binaries compiled from the source.
The studio updated the project, changed the configuration to x64, I compile it. And almost immediately it shows two errors on the same line: object of abstract class type is not allowed and cannot instantiate abstract class .

Here are the sources.

wxscintilla.cpp
https://pastebin.com/4vtfUn2U

ScintillaWX.h
https://pastebin.com/GtX3Yb3y


ScintillaWX.h is included in the aforementioned wxscintilla.cpp, it describes the ScintillaWX class, when mentioned in wxscintilla.cpp, the error occurs on line 170:

m_swx = new ScintillaWX(this); - error object of abstract class type is not allowed and cannot instantiate abstract class

Error (active)	E0322	object of abstract class type "ScintillaWX" is not allowed:	wxscintilla	..\libs\wxScintilla\src\wxscintilla.cpp	170	

Error	C2259	'ScintillaWX': cannot instantiate abstract class	wxscintilla	..\src\wxscintilla.cpp	170


Google gives a lot of answers, but I still do not have enough knowledge in C ++ to fix it myself, please help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question