Hi all, I'm currently working on a MFC Project and want to use the MfcUi::TestRunner with Unicode support enabled (Flag:'_UNICODE' defined). I compiled the CppUnit 1.8.0 MSVC6 'TestRunner' project with the 'Win32 Release Unicode' configuration from the source, which generated testrunneru.xxx. Further I also compiled the 'cppunit' MSVC6 project with the 'Win32 Release' configuration from the source, which generated cppunit.lib. I placed these files into the corresponding location.
My application is a simple MFC dialog-based app. where I try to start the mfc TestRunner in the InitInstance()-function.
- I enabled RTTI-Support, _UNICODE
- I set Link-Output-Entry point symbol = 'wWinMainCRTStartup'
Now compilation passes fine. But at linking I get the following warning:
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
An Exe-file is generated, but if I start the application a do get an Access Violation in MFC42U.DLL when the runner.run() function is called.
Does somebody have any suggestions?
Thx in advance, Willai
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-04-20
Aha, something more:
I set the Link - Output - Entry point symbol attribute to 'wWinMainCRTStartup' because Unicode MFC Applications uses wWinMainCRTStartup as the entry point. Otherwise u get this Link-Error:
MSVC6:
msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external symbol "_WinMain@16"
Visual C++ .NET:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
fatal error LNK1120: 1 unresolved externals
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-05-13
Hi, I got the excatly the same errors... I don't know how to solve the problem...But I tried to setup a fresh new MFC project leaving all default setting set besides the Unicode option...then it worked...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-05-13
That's exactly what I did too, but it's not the solution of the problem. It seems that the <cppunit> includes don't support unicode (there are no _UNICODE Preprocessor-checks if u search the sources). Unfortunately, nobody of this project feels to be addressed by this problem :-|
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just check the HostApp example in the unicode configuration and its works fine.
CppUnit does not handle unicode in any specific way (this was discussed a few year ago on the ML), only the mfc testrunner need to do so because its linking against a different MFC library.
Concerning you crash issue, have you checked that you are using the same version of CRT dll as cppunit ?
Baptiste.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all, I'm currently working on a MFC Project and want to use the MfcUi::TestRunner with Unicode support enabled (Flag:'_UNICODE' defined). I compiled the CppUnit 1.8.0 MSVC6 'TestRunner' project with the 'Win32 Release Unicode' configuration from the source, which generated testrunneru.xxx. Further I also compiled the 'cppunit' MSVC6 project with the 'Win32 Release' configuration from the source, which generated cppunit.lib. I placed these files into the corresponding location.
My application is a simple MFC dialog-based app. where I try to start the mfc TestRunner in the InitInstance()-function.
- I enabled RTTI-Support, _UNICODE
- I set Link-Output-Entry point symbol = 'wWinMainCRTStartup'
Now compilation passes fine. But at linking I get the following warning:
LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs; use /NODEFAULTLIB:library
An Exe-file is generated, but if I start the application a do get an Access Violation in MFC42U.DLL when the runner.run() function is called.
Does somebody have any suggestions?
Thx in advance, Willai
Aha, something more:
I set the Link - Output - Entry point symbol attribute to 'wWinMainCRTStartup' because Unicode MFC Applications uses wWinMainCRTStartup as the entry point. Otherwise u get this Link-Error:
MSVC6:
msvcrt.lib(crtexew.obj) : error LNK2001: unresolved external symbol "_WinMain@16"
Visual C++ .NET:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
fatal error LNK1120: 1 unresolved externals
Hi, I got the excatly the same errors... I don't know how to solve the problem...But I tried to setup a fresh new MFC project leaving all default setting set besides the Unicode option...then it worked...
That's exactly what I did too, but it's not the solution of the problem. It seems that the <cppunit> includes don't support unicode (there are no _UNICODE Preprocessor-checks if u search the sources). Unfortunately, nobody of this project feels to be addressed by this problem :-|
I just check the HostApp example in the unicode configuration and its works fine.
CppUnit does not handle unicode in any specific way (this was discussed a few year ago on the ML), only the mfc testrunner need to do so because its linking against a different MFC library.
Concerning you crash issue, have you checked that you are using the same version of CRT dll as cppunit ?
Baptiste.