Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » 'class' type redefinition error Collapse All
Subject Author Date
Swetha Kishan Jun 1, 2010 - 6:05 AM

Hi,


I have a project that uses some sybase connections (which internally use window.h too). Now when I try to include Prof-UIs in my project I get the following redefinition errors.



1> Automatically linking with Prof-UIS library: ProfUIS250smd.lib


1> (Professional User Interface Suite)


1>d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxmt.h(105) : error C2011: ’CMutex’ : ’class’ type redefinition


1> d:\sa_itf_new\src\libs\devlib\win\mutex.h(9) : see declaration of ’CMutex’


1>d:\program files\microsoft visual studio 8\vc\atlmfc\include\afxmt.h(150) : error C2011: ’CCriticalSection’ : ’class’ type redefinition


1> d:\sa_itf_new\src\libs\devlib\win\criticalsection.h(10) : see declaration of ’CCriticalSection’


1>d:\sa_itf_new\src\pokerdebugger\prof-uis\include\extcmdmanager.h(931) : error C2079: ’CExtCmdManager::m_cs’ uses undefined class ’CCriticalSection’


When I try to build the same sample application with just MFC (without using Prof-UIs ) dialog application, it works fine. I also checked with VS2008 and also checked the order of include paths in my VC++ include directory. They are in a perfect order like this :


$(VCInstallDir)include

$(VCInstallDir)atlmfc\include

$(VCInstallDir)PlatformSDK\include

$(FrameworkSDKDir)include


D:\sa_itf_new\src\pokerdebugger\Prof-UIS\Include


(I gave Prof-UIs include path at the last). Nothing works... can any one help me why do I get these errors ? These redefinitions are library ones and are not directly used by my project.


My stdafx.h has all default definitions and inclusions (as written by wizards). when I try to include my files in the following order :


//windows default definitions and inclusions


#include <sybase.h>


#include <Prof-UIs.h>


then I get the above mentioned errors. If I try to change the inclusion order to


//windows definitions


#include <sybase.h>


//windows mfc inclusions


#include <Prof-UIs.h>


then I get "Windows.h" is already defined . MFC applications must not include <windows.h>.


I tried with all possible combinations of inclusions but of no help. What do I basically miss here ? How can I get rid of these multiple redefinition errors ?


I tried with MFC static library and Shared DLL too....errors remain same...


Looking forward for the earliest reply,


Regards,


Swetha Kishan


 


Technical Support Jun 3, 2010 - 7:55 AM

OK. The MFC apps must not include Windows.h error is not an error at all. You don’t need to include it. The AFX.h file from MFC includes it.
In the case of Prof-UIS, you need to include only the Prof-UIS.h file. You don’t need to include any other .H files from Prof-UIS/Include folder into your project.

Technical Support Jun 2, 2010 - 10:33 AM

Prof-UIS 2.50 was released in year 2005. It’s not well compatible with Visual Studio 2008, Windows Vista and Windows 7. Please switch to the latest Prof-UIS version.

Swetha Kishan Jun 3, 2010 - 4:30 AM

I actually started with Visual Studio 2005. Errors are same. Btw, I cannot upgrade to latest versions (>2.5) of Prof UI ’cos I am supposed to use same libraries that an older project uses. I tried to use 2.8 Prof-UIs for that older project but it was not compiling as few .h files used in 2.5 are missing in 2.8. So that option is ruled out for me.
Can you please let me know why I get above mentioned errors when using Pyrof-UIs 2.5 developed under VS2005 ? It is highly need ed and my work is totally stopped.

Eagerly looking for the earliest response,

Regards,
Swetha Kishan