Page 1 of 1

Assert Error: wxClassInfo:Register()

Posted: Fri Apr 20, 2018 5:05 am
by preethis
When i try to launch my application i am getting the below error:
" ..\..\src\common\object.cpp(251): assert "classInfo->Get(m_classname) == NULL " failed in wxClassInfo::Register(): Class "wxTreeListHeaderWindow2" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?
Do you want to stop the program?
You can choose cancel to suppress further warnings."


Am using wx3.0 in windows. My application is not using GUI.
Please help me resolving.

Re: Assert Error: wxClassInfo:Register()

Posted: Fri Apr 20, 2018 6:48 am
by PB
This kind of error should show when linking to the same (dynamic) library more than once.

It is odd though, as you say you do not use GUI so you should not be linking against wxAdvanced anyway (unless you are using a monolithic DLL).

Re: Assert Error: wxClassInfo:Register()

Posted: Thu May 03, 2018 1:14 pm
by preethis
Am just linking the below lib file. that too only once linked.
wxbase30u.lib

Preprocessor:
__WXMSW__
wxUSE_UNICODE=1
WXUSINGDLL
WXWIDGETSVERSION_2_5_OR_HIGHER

Please somebody help me to resolve this.

Re: Assert Error: wxClassInfo:Register()

Posted: Thu May 03, 2018 3:42 pm
by ONEEYEMAN
Hi,
How did you build wxWidgets? I.e. did you use command line or IDE of some kind?
How do you build you software? Again with the command prompt or with IDE?

If you did use command prompt for any one of those above - please show the exact command used.
If not - do you have exactly the same options building you software as you used for building the wxWidgets?

Thank you.

Re: Assert Error: wxClassInfo:Register()

Posted: Sat May 05, 2018 3:42 am
by preethis
we are using wx 3.0 that is pre-built and given by our client, Which is working fine.
When we try to integrate the same with our project will all the settings as in their project, it is throwing this warning.
Is there any way to hide this warning??

Thanks

Re: Assert Error: wxClassInfo:Register()

Posted: Sun May 06, 2018 6:10 am
by preethis
We are not using command prompt to build. Using Visual Studio 2013 IDE.

Is there any way to hide this popup or to :roll: find which lib is linked more than once?
Please help me resolving this

Re: Assert Error: wxClassInfo:Register()

Posted: Sun May 06, 2018 8:12 am
by PB
Can you reproduce the issue with a new minimal project?

If you can, what happens when you replace your custom-built wxWidgets library with a regularly built wxWidgets library? Use debug version of the library and see from where (call stack) it gets triggered.

If you cannot, check the differences between the two projects.

BTW, you should not define wxUSE_UNICODE=1 in the project, that's for building the library. In the project you define either "UNICODE" or "_UNICODE"; actually these two are defined automatically by the IDE when the project has its character set set to "Use Unicode Character Set" in its General properties.

You say you link only one wxWidgets library wxbase30u.lib which AFAIK does not contain any GUI classes. Are you using wxWidgets GUI classes or not - wxBase is for command line stuff only? Even if you were linking against a single library built as monolithic, this library should be named wxmsw30u.lib, not wxbase30u.lib.

I do not even know where the class name comes from, TBH. Are you sure you are not linking against a library which itself links to wxWidgets?

Re: Assert Error: wxClassInfo:Register()

Posted: Wed Jun 13, 2018 4:27 am
by preethis
I've a created a sample dll project with few functionalities[No dialog or message box NO GUI nothing].
Linker:
wxbase311u.lib
wxmsw311u_core.lib

Preprocessor:
WIN32;NDEBUG;_WINDOWS;_USRDLL;SAMPLE_EXPORTS;WXWIDGETSVERSION_2_5_OR_HIGHER;NOPCH;__WXMSW__;WXUSINGDLL;

Set as Unicode character Set and removed wxUSE_UNICODE=1

Created a sample exe application.
Linker:
wxbase311u.lib
wxmsw311u_core.lib
sample.lib

Preprocessor:
WIN32;NDEBUG;_WINDOWS;_USRDLL;WXWIDGETSVERSION_2_5_OR_HIGHER;NOPCH;__WXMSW__;WXUSINGDLL;

As attached with this, am getting warning pop-up.

We are using WX3.1 and it is pre-built and given by our client.
Please help me resolving this.

Re: Assert Error: wxClassInfo:Register()

Posted: Wed Jun 13, 2018 5:52 am
by PB
As I suggested before: Try doing the same with wxWidgets official build or the build of your own.

If this would work it is obvious that the issue is with the library provided by the client and you need to handle it with them.

Re: Assert Error: wxClassInfo:Register()

Posted: Mon Jun 18, 2018 5:34 pm
by ONEEYEMAN
Hi,
Try to run the 'console' sample provided with the wxWidgets. If this run properly - check what settings are used in that project and try to reproduce it in you own.
Also - take a look at the dll sample that is available - maybe the settings there will give you some clue.

Thank you.