본문 바로가기
Programming/VC++

VS2008에서 작업한 소스를 VS2005에서 컴파일하기

by ㅇㅏㄹI 수 2010. 11. 29.
실제 프로그램이 설치되는 시스템 환경과 모든 상황, 환경을 동일하게 맞추어 개발환경을 조성할 순 없다. Visual Studio의 경우도 상황에 따라서 버전이 각기 다를 수 있다.

이번에 그런 상황 발생...
내 놋북에는 2008만 설치되어 있는데, 테스트 환경은 2005란다...ㅡ.ㅡ...
2005를 다시 설치할 수도 없고...그래서 2008에서 2005로 다운해서 하는 방법을 찾았보았다..
역시 있군.....

Visual Studio 2008에서 작업한걸 Visual Studio 2005 에서 컴파일 하기( http://ganezon.tistory.com/177 )

방법은 간단하다.
작성한 소스에서 *.sln 파일과 *.vcproj파일의 내용을 수정하여 주면 된다.

먼저 *.sln 파일을 메모장 등의 에디터로 연다. 그럼 다음과 비슷한 내용이 나온다.
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Flnet", "Flnet.vcproj", "{DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Win32 = Debug|Win32
        Release|Win32 = Release|Win32
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}.Debug|Win32.ActiveCfg = Debug|Win32
        {DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}.Debug|Win32.Build.0 = Debug|Win32
        {DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}.Release|Win32.ActiveCfg = Release|Win32
        {DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}.Release|Win32.Build.0 = Release|Win32
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal
위 내용에서 중요한 부분은 붉은 색 부분이다. 각각의 숫자를 변경하여 준다.
10.00  ->  9.0
2008   ->  2005

다음으로는 *.vcproj 파일을 수정하여 줍니다.
*.vcproj 파일을 엽니다. 그럼 다음과 비슷한 내용의 나올 겁니다.
<?xml version="1.0" encoding="ks_c_5601-1987"?>
<VisualStudioProject
    ProjectType="Visual C++"
    Version="9.00"
    Name="Flnet"
    ProjectGUID="{DB3851C7-F967-4FAB-90A8-3CD5B5BB1485}"
    RootNamespace="DpcsF"
    Keyword="MFCProj"
    TargetFrameworkVersion="131072"
    >
    <Platforms>
        <Platform
            Name="Win32"
        />
    </Platforms>
    <ToolFiles>
    </ToolFiles>
    <Configurations>
        <Configuration
            Name="Debug|Win32"
            OutputDirectory="..\execute"
            IntermediateDirectory="Debug"
            ConfigurationType="1"
            InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
... 이하 생략
vcproj 파일의 내용은 작성된 코드의 양에 따라서 길이가 모두 다를 수 있다. 허나 필요한 부분은 헤더부분이라고 생각할 수 있는 앞부분이다.
이 파일에서도 붉은 색으로 처리된 부분을 바꿔주면 된다. 다음과 같이 변경한다.
9.00  ->  8.00
이렇게 하면 2005에서도 2008에서 작업한 소스를 컴파일 할 수 있다..

중요 : 아직 실제적으로 해보진 않았다. 조만간 해보고 정상작동하면 이 구문은 삭제.^^.
728x90

댓글