Author Topic: Failure Refactoring with wxWidgets and VS 2005  (Read 4447 times)

Taapie

  • Community Member
  • Posts: 35
  • Hero Points: 2
Failure Refactoring with wxWidgets and VS 2005
« on: October 23, 2007, 02:15:33 pm »
Hi,

I am currently evaluating the trial version of SlickEdit and have created new projects from my original VC projects. I have not used the workspace and project files, as i wanted to be able to add and remove files from within slickedit. I have setup the compile and link tools such that they use the same command line as VS does when compiling and linking. This works correctly.

I now wanted to try out the refactoring tools. But i get warnings and errors which prevent the refactoring tool from doing its work. Here is the list of warnings/errors i get (doing 'Encapsulate field' on a member variable):

Code: [Select]
Refactoring...
Parsing:  "C:\Development\Sources\EnterWorldCafe\EWServer\H\EWAdminServer.h"
*** Errors
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(702,1): warning -8041: symbol 'std::iterator_traits<unsigned short>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(681,1): warning -8019: see definition of 'std::iterator_traits<unsigned short>'
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1109,1): warning -8041: symbol 'std::_Ptr_cat_helper<bool*, bool*>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1103,1): warning -8019: see definition of 'std::_Ptr_cat_helper<bool*, bool*>'
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1159,1): warning -8041: symbol 'std::_Ptr_cat_helper<unsigned short*, unsigned short*>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1153,1): warning -8019: see definition of 'std::_Ptr_cat_helper<unsigned short*, unsigned short*>'
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1178,1): warning -8041: symbol 'std::_Ptr_cat_helper<unsigned short*, unsigned short*>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(1153,1): warning -8019: see definition of 'std::_Ptr_cat_helper<unsigned short*, unsigned short*>'
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, bool>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, bool>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, void>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, void>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, bool>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xutility(2335,16): error -8070: template 'std::_Enable_if<ENUM=0, bool>' instantiated with a forward declared type
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(1051,1): warning -8041: symbol 'std::codecvt<unsigned short, char, signed int>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(813,1): warning -8019: see definition of 'std::codecvt<unsigned short, char, signed int>'
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(2150,1): warning -8041: symbol 'std::ctype<unsigned short>' is already defined
C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocale(1878,1): warning -8019: see definition of 'std::ctype<unsigned short>'
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\objidl.h(300,19): warning -8041: symbol 'IRpcStubBuffer' is already defined
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\objbase.h(399,41): warning -8018: see previous definition of 'IRpcStubBuffer'
C:\Development\Libraries\wxWidgets-2.8.6\include\wx\hashmap.h(410,75): error -8028: cannot assign from 'signed int' to 't2' -- types are incompatible and there is no suitable conversion
##wxShadowObjectMethods_wxImplementation_Pair(key,mapped_type())##(1,1): error -8020: undefined symbol 'wxShadowObjectMethods_wxImplementation_Pair'
C:\Development\Libraries\wxWidgets-2.8.6\include\wx\clntdata.h(20,1): warning -8079: preprocessing expanded from here

Under Tools->C++ Refactoring->Test Parsing Configuration i get the following information:

Code: [Select]
Current file:
C:\Development\Sources\EnterWorldCafe\EWServer\H\EWAdminServer.h
Current workspace: (Open...)
C:\Development\Sources\EnterWorldCafe\EnterWorldCafe.vpw 
Effective project: (Change...)
C:\Development\Sources\EnterWorldCafe\EWServer\EWServer.vpj

Macro Definitions:(Edit...)
"/DWIN32"
"/DSTRICT"
"/D__WXMSW__"
"/D__WX__"
"/D_WINDOWS"
"/DwxUSE_UNICODE"
"/D_UNICODE"
"/DUNICODE"
"/D_CRT_SECURE_NO_DEPRECATE"
"/D_DEBUG"
"/D__WXDEBUG__"
 User Include Search Directories:(Edit...)
C:\Development\Libraries\wxWidgets-2.8.6\lib\vc_lib\mswud\
C:\Development\Libraries\wxWidgets-2.8.6\include\
C:\Development\Libraries\wxWidgets-2.8.6\contrib\include\
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\include\
C:\Development\Sources\EnterWorldCafe\EWLib\H\
C:\Development\Libraries\DataBaseLayer-1.7.1\include\
C:\Development\Sources\EnterWorldCafe\EWServer\H\
C:\Development\Libraries\DataBaseLayer-1.7.1\lib\sqlite-3_5_0\
 Active C/C++ Compiler Configuration: (Change...)
Visual Studio 2005 Express
Default C/C++ Compiler Configuration: (Change...)
Visual Studio 2005 Express
Compiler Emulation Header File: (Edit...)
C:\Program Files\SlickEdit 2007 Trial\sysconfig\vsparser\vscpp.h
Compiler Include Search Directories: (Edit...)
C:\Program Files\Microsoft Visual Studio 8\VC\include
C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\

Everything looks to be fine, except that the refactoring fails. I am using Visual Studio 2005 Express with the Platform SDK. Somewhere on this forum i found a message from 2006 mentioning that SlickEdit 12 should work correctly with VS 2005.

Is there something i am missing ? Are there extra settings i need to set ?

Can i ask as a sub question why SlickEdit parses through all these files, before trying to refactor ? This takes a long time before any actual work can be done.

Greetings,

Dennis Taapken
www.lioncode.com

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2966
  • Hero Points: 440
Re: Failure Refactoring with wxWidgets and VS 2005
« Reply #1 on: October 23, 2007, 10:41:35 pm »
Unfortunately, our C++ refactoring does not work with Visual Studio 2005 source code.  The specific problem, as noted in our release notes, stems from the arcane usage of the _Enable_if<> template class in <xutility>, which is pulled in by nearly all of the STL code.

As an interim workaround, I suggest using Quick Refactoring.

Taapie

  • Community Member
  • Posts: 35
  • Hero Points: 2
Re: Failure Refactoring with wxWidgets and VS 2005
« Reply #2 on: October 24, 2007, 09:35:53 am »
I did not read the release notes, my bad - sorry for that. Thanks for answering my post anyway.

My idea was to make a setup (using my own templates for projects, etcetera) that makes it possible to use either Cygwin or Visual Studio to compile. Main advantage is that i can debug and compile using cygwin, until it all works. Then for a release i can use Visual Studio to compile and execute the tests - no need to debug with Visual Studio :-)

I guess using Cygwin will make refactoring work (as long as i use the correct headers files from GCC 3.3.2 - yes i read the release notes now ;-))

I like (almost love) SlickEdit - and hope i can get this setup to work.

Thanks again.

Greetings,

Dennis Taapken
www.lioncode.com