Indy 10 설치 하기 결론...
Indy 10 디자인 타임 패키지 까지 등록은 됐으나 실제 사용할 때 IdWinSock2.hpp의 TWSAProtocol_INFOW
 타입의 문제로 사용할 수 없다. BCB에서는 Indy 9.x 버전을 사용하자.

다른 분들은 나처럼 시간 낭비 하지 마시라고 Indy 10 설치 내용과 오류발생 이유를 아래에 적는다.

-------------------------------------------------------------------------------

10.1.11 버전에서는 디렉토리가 system, core, supercore, protocols 로 나뉘어져 있다.
설치 순서는 Systme->Core->Protocols 순서로 하며, 디자인 타임 패키지는 Core, Protocols만 등록하면 된다. SuperCore는 Delphi7에서만 사용함으로 설치하지 않는다.

Indy 10에는 dpk파일만 포함이 되어 있다. 볼랜드 포럼의 자료실에서 dpk2bpk(http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_res&no=287)를 받아서 설치를 시작하기 전에 Core, System. Protocols에 있는 dpk파일을 bpk로 바꿔서 사용을 한다. 이 포스르를 작성할 떄는 Delph 7용 dpk를 바꿔서 사용했다.

패키지를 컴파일 하기 전에 Tools->Environment Options->Library path에 core, protocols, system 디렉토리를 추가한다.  이렇게 추가를 해도 패키지 컴파일 할 때 유닛을  못 찾아서 컴파일 에러가 나는 경우가 있었는데 각 패키지의 옵션에 있는 Libray Path에 다시 core, protocols, systme 디렉토리를 추가하면 된다.

Core 디자인 타임 패키지 등록 할 때 IdCoreDsnRegister 유닛에서 DesignIntf 유닛을 못 찾아서 컴파일 에러가 나는데 이때는 패키지의 옵션에 있는 Library Path에 {$CBB}\source\toolsapi 를 추가해주면 컴파일이 된다.

 <에러나는 부분>
    {$IFDEF VCL6ORABOVE}
      DesignIntf,
      DesignEditors;
    {$ELSE}


# 인디 의 설치 순서에 관한내용으로 인디 사이트에서 가져왔다. (전체 내용은 http://docs.projectindy.org/online/frames.html?frmname=topic&frmfile=index.html

에서 볼수 있다.)

Delphi and C++ Builder Installation
Installing Indy.Sockets in a Borland IDE involves using the run-time and design-time packages files to compile the source code in the library. After compiling the packages and source code, design-time packages are installed in the IDE to make the components available on the component palette.

For Delphi and C++ Builder, the run-time package files should be opened and compiled in the following order:

  • IndySystem (in LibSystem)
  • IndyCore (in LibCore)
  • IndyProtocols (in LibProtocols)
  • IndySuperCore (in LibSuperCore) (for Delphi 7 onl��y)

For Delphi and C++ Builder, the design-time package files should be opened, compiled, and installed in the following order:

  • dclIndyCore (in LibCore)
  • dclIndyProtocols (in LibProtocols)
  • dclSuperCore (in LibSuperCore) (for Delphi 7 onl��y)
 

 런타임, 디자인 타임 패키지를 설치 하고 나서 이젠 BCB에서 Indy 10을 사용할 수 있다는 기대감에 기본 프로젝트 만들고 프로젝트 옵션의 Include , Library Path에 설치된 Indy 관련 디렉토리(system, core, protocols)를 추가했다. 그리고 IdTCPServer 하나 놓고 컴파일을 했더니 아래와 같은 에러가 ㅠ.ㅠ

[C++ Error] IdWinSock2.hpp(373): E2257 , expected
typedef  TWSAProtocol_INFOW *LPWSAProtocol_InfoW;

[C++ Error] IdWinSock2.hpp(746): E2303 Type name expected
typedef int __stdcall (*TWSAEnumProtocolsAProc)(System::PInteger lpiProtocols, PWSAProtocol_InfoA lpProtocolBuffer, unsigned &lpdwBufferLength);

[C++ Error] IdWinSock2.hpp(748): E2303 Type name expected
typedef int __stdcall (*TWSAEnumProtocolsWProc)(System::PInteger lpiProtocols, PWSAProtocol_InfoW lpProtocolBuffer, unsigned &lpdwBufferLength);

[C++ Error] IdWinSock2.hpp(750): E2303 Type name expected
typedef int __stdcall (*TWSAEnumProtocolsProc)(System::PInteger lpiProtocols, PWSAProtocol_InfoA lpProtocolBuffer, unsigned &lpdwBufferLength);

[C++ Error] IdWinSock2.hpp(764): E2303 Type name expected
typedef int __stdcall (*TWSADuplicateSocketAProc)(const int s, const unsigned dwProcessId, PWSAProtocol_InfoA lpProtocolInfo);

[C++ Error] IdWinSock2.hpp(766): E2303 Type name expected
typedef int __stdcall (*TWSADuplicateSocketWProc)(const int s, const unsigned dwProcessId, PWSAProtocol_InfoW lpProtocolInfo);

구글을 찾아보니 Indy 10이 BCB에서 호환 되지 않는 이유중 하나가 IdWinSock2.pas 때문이고 아직 해결책은 없다고 한다.

IdWinSock2.hpp와 IdWinSock2.pas를 비교해 보면 IdWinSock2.pas에는 TWSAProtocol_INFOW이 record로 선언되어 있는데 IdWinSock2.hpp에는 struct 선언이 없어서 컴파일 에러가 나는것 같다.

IdWinSock2.hpp에 TWSAProtocol_INFOW 구조체를 추가해서 다시 테스트 해볼 생각도 했는데...그렇게 할 시간이 없어서 당분간 Indy 10 사용하는 것은 포기...

Posted by Gu Youn
,