Borland 5 and linker errors

Started by
5 comments, last by JwayneT 23 years, 11 months ago
I was working on getting a skeleton going for a 2d game engine when I ran into some errors. I was working on integrating Direct Input into my program (yes I added dinput.lib to my project). But I keep getting linker errors like "Unresolved External ''DirectInputCreateEx'' refrenced from centaclass.obj." I''m using Borland Builder 5 standard, if that helps. When I hit F1 to find out what the errors mean, it says something to the effect of "the function wasn''t declared somewhere else in the project, like .lib or .obj file or something." But I made sure I used the right spelling and I even tracked down the decaration in the dinput.h file. I don''t know what to do. a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:grey;};-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]
Advertisement
It helps if you don''t spawn a new thread everytime it seems like it''s slowing down. Be a little patient.

Anyway, before you said that you were using the command line. Are you still using the command line compile? If so did you link against import32.lib?
I generally don''t do anything while I compile source. And as far as comand line, do you mean not using the IDE. I have tried tooling with everything. The Builder 5 uses VCL, which was written in object pascal. I don''t use VCL when I write code, I just write my own skeleton and work from there. Could that possible be the cause of anything, when I do include it I get more crap since it is pascal. I have been trying to find a way to eliminate that from my project and just go from what I have read. I have been using the tutorials from the Microsoft Direct X homepage, do you think that it could be the problem. And if it is why is it since it was Microsoft who wrote the Direct X headers. I am running out of Ideas.

a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]
Heh, I''ve had the same problem, with Builder 4.0. What you have to do is to create the DirectInput COM object directly. It isn''t any big deal, the only thing you have to do differently is to call the "Initialize" function that DirectInputCreateEx would have done for you.

Here is some code that might help.

//
// Create the DirectInput7 object
// Have to do it with CoCreateInstance - for some reason DirectInputCreateEx is not linking!

hResult=CoCreateInstance(CLSID_DirectInput,NULL,CLSCTX_INPROC,IID_IDirectInput7,(void **)&m_pDI);
hResult=m_pDI->Initialize((HINSTANCE)GetWindowLong(Application->Handle,GWL_HINSTANCE),DIRECTINPUT_VERSION);


m_pDI is declared in my app class as...

LPDIRECTINPUT7 m_pDI;

Let me know if this helps you out.

Dean M.
Well deanmat, what you have given me has fixed the DirectInputCreateEx problem, but I still have one left. The Microsoft Tutorial said to use the c_dfDIKeyboard variable to the method SetDataFormat of my DIRECTINUPTDEVICE7 variable, but it gives me linker errors to that too(the c_dfDIKeyboard variable).

a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]
Hmmmm....not sure what to say, that variable links just fine for me

The only thing I can think of, off the top of my head, is to make sure you''ve added ''dinput.lib'' (be sure to use the Borland libs) to your project and that you''ve included the "dinput.h" header file.

If I think of something else I''ll let you know.

Dean M.
I commented that action out just to see what would happen, and I got access violations. I was getting these well before c_dfDIKeyboard was called. I was also having trouble with the windows skeletons I had written. It seems that the RegisterClass function isn''t working right. Why is my compiler acting like a brick wall.

a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};-=CF=-
a.h{text-decoration:none;color:blue;};a.h:hover{text-decoration:underline;background:red;};

Why is it called a hot water heater? Isn't it cold when it goes in the tank?

[email=jtaylor@gtemail.net" class="h]-=CF=-[/email]

This topic is closed to new replies.

Advertisement