Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

JwayneT

Borland 5 and linker errors

This topic is 6916 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. -=CF=-

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

-=CF=-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

-=CF=-

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

-=CF=-

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!