2016-06-23 2 views
1

Direct2d를 사용하기 위해 C++ 빌더 (Rad Studio Berlin) 프로젝트 설정이 있습니다. 캔버스 그리기는 TDirect2DCanvas에서 제대로 작동합니다. 이는 Direct2D가 제대로 연결되고 있음을 나타냅니다. 모든 것이 부드럽게 렌더링됩니다. 그러나 매트릭스를 사용해야합니다. 시도 할 때 연결 오류가 발생합니다. Direct2D C++ 빌더에서만 부분적으로 링크하기

canvas->RenderTarget->SetTransform(D2D1::Matrix3x2F::Rotation(15.0, D2D1PointF(100, 100))); 

이 ... 나는 다음과 같은 연결 오류가 얻을 : 시도 내가 예를 들어,

[ilink32 Error] Error: Unresolved external 'D2D1MakeRotateMatrix' referenced from C:\DP\TRUNK\SRC\CLIENTSIDE\APPLICATIONS\VIEWER\WIN32\DEBUG\MIMAGE.OBJ 

C++ 빌더가 이미 Direct2D의에 연결하는 설정을해야했는데 난 그냥 헤더를 포함합니다. 누구든지 C++ 빌더 방식으로 적절한 파일에 링크 할 수 있습니까?

답변

0

다른 출처의 용액을 발견했습니다. 여기에 있습니다 :

일부 연구 후에이 문제는 버그로 확인되지 않았습니다.

For many of the standard Windows API functions, the IDE will add the correct library automatically so that the dependencies on the function references will be satisfied. With DirectX (which is somewhat uncommonly used), the IDE does not automatically supply the library which corresponds to the header file, so this is causing the unresolved linker errors.

The solution is to either (as I mentioned previously) add the D2D1.lib to the project, or statically reference it in code:

// as long as D2D1.lib is on the library search path, it should be found 
#pragma comment(lib,"D2D1.lib") 

Some developers add the above line of code to their headers and so all you need to do is include the header and all is well... the DirectX team did not do this and hence the unresolved linker errors.

희망은이 문제를 명확히,