Board index » cppbuilder » Error compiling DirectX Linker

Error compiling DirectX Linker


2007-11-16 11:32:56 PM
cppbuilder38
Hi
my code is :
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
/*------------------------------*/
#include "directx/d3d9.h"
#pragma comment (lib, "d3d9.lib")
LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 d3ddev;
void initD3D(HWND hWnd);
void render_frame(void);
void cleanD3D(void);
/*===============================*/
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// this function initializes and prepares Direct3D for use
void initD3D(HWND hWnd){
// create the Direct3D interface
d3d = Direct3DCreate9(D3D_SDK_VERSION);
// create a struct to hold various device information
D3DPRESENT_PARAMETERS d3dpp;
// clear out the struct for use
ZeroMemory(&d3dpp, sizeof(d3dpp));
// program windowed, not fullscreen
d3dpp.Windowed = TRUE;
// discard old frames
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
// set the window to be used by Direct3D
d3dpp.hDeviceWindow = hWnd;
// create a device class using this information and information from the
d3dpp stuct
d3d->CreateDevice(D3DADAPTER_DEFAULT,
D3DDEVTYPE_HAL,
hWnd,
D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp,
&d3ddev);
}
//====================================================================
but in compile time I recieve this error : D3D9.lib module contains invalid
OMF record, type 0x21 (possibly COFF)
what can I do??
 
 

Re:Error compiling DirectX Linker

LearnJoo wrote:
Quote
but in compile time I recieve this error : D3D9.lib module contains
invalid OMF record, type 0x21 (possibly COFF)

what can I do??
Remove the d3d9 lib file from your project. You need to get the C++Builder
compatible lib files from:
www.clootie.ru/delphi/DX92/CBuilder_DX92_libs.zip
HTH
Jon
 

Re:Error compiling DirectX Linker

Hi
Thanks to guide me
can you say me how can I guess about this before without your help??
:-)
"Jonathan Benedicto" < XXXX@XXXXX.COM >wrote in message
Quote
LearnJoo wrote:
>but in compile time I recieve this error : D3D9.lib module contains
>invalid OMF record, type 0x21 (possibly COFF)
>
>what can I do??

Remove the d3d9 lib file from your project. You need to get the C++Builder
compatible lib files from:

www.clootie.ru/delphi/DX92/CBuilder_DX92_libs.zip

HTH

Jon

 

{smallsort}