Saturday, May 7, 2011

VS2010Express

Visual Studio 2010 Express 버전을 설치하고 WTL 연동을 한다.

 

 VS2010 Express 와 WDK(DDK)를 다운로드한다.

 

WTL을 빌드하기 위해서는 ATL이 필요하며, 다행히 ATL은 DDK에서 배포를 하고 있다.

 

http://www.microsoft.com/express/Downloads

http://www.microsoft.com/express/Downloads/#2010-All (전체 ISO 다운로드)

 

WDK(DDK)다운로드

http://www.microsoft.com/whdc/DevTools/WDK/WDKpkg.mspx

http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=36a2630f-5d56-43b5-b996-7633f2ec14ff

 

WTL 다운로드

http://sourceforge.net/projects/wtl/

http://wtl.svn.sourceforge.net/viewvc/wtl/trunk/wtl/Wizards/AppWiz/?view=tar

http://wtl.svn.sourceforge.net/viewvc/wtl/trunk/wtl/include.tar.gz?view=tar
각각 다운로드후 WTL을 사용할 폴더를 설정후, setup100x.js 를 수행하여 위저드를 설치한다.

 

 

VS2010 에서는 전체 프로젝트에 설정하는 include, library 디렉토리 설정이 없어졌다.

왜 이렇게 변경되었는지 아래 링크에 설명되어있다.

http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx

 

사용자별 프로젝트 설정을 하기 위해서 

http://insomniacgeek.com/getting-started-with-wtl-on-visual-studio-2010/

에 나온바와 같이 새로운 프로젝트를 생성해서 Property Manager를 수행해야 한다.

그러나, VS2010 express에서는 디폴트로 Property Manager가 보이지 않는다.

Tools>>Settings>>Basic Settings 를 Expert Settings로 변경하면,

View>>Property Manager 가 나온다.

이것 때문에 고생했다. 사용자별 설정부터 이해할 수 없는 UI로 만들어졌다.

 

사용자별 설정을 하기위해 Property Manager에서 

Debug와 Release 아래 "Microsoft.Cpp.Win32.user" 모두 선택후,

마우스 오른쪽 버튼으로 컨텍스트 메뉴를 수행하면 Properties가 보이며,

선택하면 Property Pages 가 나온다.

 

이 상태에서 Include, Library Directories 를 설정하라.

 

ATL, WTL 디렉토리를 설정후 빌드하면 

stdint.h(72): warning C4005: 'INT8_MIN' : macro redefinition

이러한 형태의 경고가 발생하는데 아래 링크를 참고하여 해결하였다.

http://connect.microsoft.com/VisualStudio/feedback/details/621653/including-stdint-after-intsafe-generates-warnings#

 

링킹시 아래와 같은 에러가 발생한다.

error LNK2019: unresolved external symbol "void * __stdcall ATL::__AllocStdCallThunk(void)" (?__AllocStdCallThunk@ATL@@YGPAXXZ) referenced in function "public: static void * __cdecl ATL::_stdcallthunk::operator new(unsigned int)" (??2_stdcallthunk@ATL@@SAPAXI@Z)

error LNK2019: unresolved external symbol "void __stdcall ATL::__FreeStdCallThunk(void *)" (?__FreeStdCallThunk@ATL@@YGXPAX@Z) referenced in function "public: static void __cdecl ATL::_stdcallthunk::operator delete(void *)" (??3_stdcallthunk@ATL@@SAXPAX@Z)

 

결론적으로, 이 두가지 현상을 잡기위해 stdafx.h에 아래와 같이 작성하였다.

 

  1. #ifdef _MSC_VER // This check can be removed if you only build for Windows
  2. #pragma warning (push)
  3. #pragma warning (disable : 4005)
  4. #include <intsafe.h>
  5. #include <stdint.h>
  6. #pragma warning (push)
  7. #pragma warning (default : 4005)
  8. #endif

  9. #include <atlbase.h>
  10. #include <atlstdthunk.h>
  11. #include <atlstr.h>
  12. #include <atlapp.h>

  13. #pragma comment(lib, "atlthunk.lib")

 

Windows SDK 설치.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=35aeda01-421d-4ba5-b44b-543dc8c33a20&displaylang=en

 

WindowsSdkDir 이 7.0A로 고정되는 경우

http://connect.microsoft.com/VisualStudio/feedback/details/564036/visual-studio-2010-windowssdkdir-always-forced-to-v7-0a-directory

UICC를 찾을 수 없어서 아래와 같은 에러가 발생한다.

  1. 1>  Compiling Ribbon.xml
  2. 1>  'uicc'은(는) 내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는
  3. 1>  배치 파일이 아닙니다.
  4. 1>D:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 9009.

 

Windows SDK v7.0 v7.1 에서는 UICC.exe 가 배포되고 있다.

따라서 $(WindowsSdkDir) 을 v7.1로 옮겨야 한다.

http://blogs.msdn.com/b/vcblog/archive/2009/05/20/using-the-windows-7-rc-sdk-in-visual-c-2010-beta-1.aspx

Platform Toolset 을 Windows7SDK 로 설정한다.

 

DirectX 관련 에러 발생시.

7.1\include\objidl.h(11280): error C2061: syntax error : identifier '__RPC__out_xcount_part'

 

 

AFX_IMPORT_DATA  관련 에러 발생시

 

  1. error C2146: syntax error : missing ';' before identifier 'CUserToolsManager'
  2. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  3. error C2144: syntax error : 'int' should be preceded by ';'
  4. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  5. error C2146: syntax error : missing ';' before identifier 'm_bUseMemoryDC'
  6. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  7. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  8. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  9. error C2146: syntax error : missing ';' before identifier 'IsMemDC'
  10. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  11. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  12. warning C4183: 'IsMemDC': missing return type; assumed to be a member function returning 'int'
  13. error C2146: syntax error : missing ';' before identifier 'IsVistaDC'
  14. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

 

 

 


이 글은 스프링노트에서 작성되었습니다.

No comments:

Post a Comment