Probably my last Irr+Borland question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
mistercrabb
Posts: 12
Joined: Sat Feb 17, 2007 9:26 pm

Probably my last Irr+Borland question

Post by mistercrabb »

Sorry about these repeated similar questions :oops: .
I have one last problem.
Im trying to make Irrlicht 1.3 work with borland turbo c++.
I havnt compiled a dll, and i didnt think i needed to..
But maybe i do..
Anyway.. when i try to compile anything i get:
[Linker Error] Error: Unresolved external '__stdcall irr::createDevice(irr::video::E_DRIVER_TYPE, const irr::core::dimension2d<int>&, unsigned int, bool, bool, bool, irr::IEventReceiver *, const char *)' referenced from F:\CPP\DEBUG_BUILD\MAIN.OBJ
I have the lib and the dll in the right places, but im not sure if i need to convert them to a suitable format for borland? I think someone provided some files when i was trying to make 1.2 work, but i cant really remember what i did. So, if anyone can tell me how to fix my error and/or provide me with whatever files i need, i'd be very grateful. Thanks :)
Dave
Posts: 25
Joined: Wed Mar 28, 2007 11:00 am

Post by Dave »

I don't really know Borland Turbo C++, but I've used Borland C++ Builder and in the beginning had many problems when using DLL's in projects. You should ask yourself the following things:

- Have you included all the correct files to your project? (.h, .dll, etc).
- Are the correct files included in the unit where you try to call a function from Irrlicht?

Your error, however, indicates an unresolved external, which most of the time is beeing caused by a bad .lib file. In Borland C++ Builder there was a tool in the /bin directory which could create library files from any dll. I don't know the filename, so you should try to search there. That program also has some kind of switch (could be -a) that gives all the functions a slighty different name. You could try to use the program on your Irrlicht DLL and perhaps then the linker won't complain anymore.

Sometimes it also works to delete all the object files before compilation, so a complete rebuild of your project.
mistercrabb
Posts: 12
Joined: Sat Feb 17, 2007 9:26 pm

Post by mistercrabb »

Nothings working. I've tried converting the lib, and ive tried making new ones using implib from both the dll and a def file i found in the gcc lib section, as well as my own def file i made with impdef. I also tried all the -a triggers. I still get the same error. Im not sure why this is. Ill carry on trying, but can anyone else offer any hints?
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

I've tried converting the lib, and ive tried making new ones using implib from both the dll and a def file i found in the gcc lib section, as well as my own def file i made with impdef.
You can't convert the lib,you have to rebuild the DLL from the source.

Which tools are you using? The free command line tools or the also free Borland Turbo Explorer BDS 4.0?

Anyway, here is atutorial.
gunnicom
Posts: 13
Joined: Tue Apr 24, 2007 9:32 pm

Post by gunnicom »

For me it sounds like a missing linker option i.e. in gcc environment it would be something like "-L/path/to/irrlichtlib -lirrlicht"
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

Also, after building the DLL per Quibbler's tutorial, be sure to define WIN32 in the conditional defines to run the examples.

Otherwise it won't link with the same error you already posted about.

Also requires _control87(MCW_EM,MCW_EM) in main before device creation.Also need to include float.h someplace for that to work.I put it in irrlicht.h.


And one more thing:In Quibbler's tutorial he said build the DLL with stdcall calling convention.The default in the projects is C call,which worked fine for me.But if you use stdcall,also use stdcall in your code.

I think that's it.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Could someone pleae tell me the command line to create a .lib and .dll with BCC55? I want to integrate it into a Makefile and don't use project files.
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

The command line switch to generate a windows DLL is -tWD.

Well...hang on I just looked in my build project.

The compiler uses -tWM for windows multithreaded,

and the linker uses -Tpd for a windows DLL.

Edit: and the linker also uses -aa for 32 bit windows application.
-ap is a 32 bit windows console application. I think -ap is the default.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I think I already made a dll before, now I even made one with DirectX9 support (hopefully). I also linked the app (defining WIN32 made the deal). But there is no output at all, the app closes immediately. What's this? Adding the fp control statement did not change anything.
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

Not sure what the problem is.

But if you want the full command line, including all the .objs,here is a Rapidshare link:Irrlicht-1.3 Borland Command Line since it is too long to post here.
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post by etcaptor »

hybrid wrote:Could someone pleae tell me the command line to create a .lib and .dll with BCC55? I want to integrate it into a Makefile and don't use project files.
Hybrid, it's very good that Irrlicht team starts Borland implementation.
I'm sorry that can't visit Irrlicht forum often, so still not tried 1.3 version with BCB, but HFlat said me that complete this task.
BCB5 was with 5.5 compiler equipment and with older 0.X Irrlicht versions I was tried and all was ok.
Only several lines of code was changed vs BCB6.

Here is a good link about generating of make files, replacing default IDE compiller and some speed optimizations:

Image

Here is a short description and download link:

http://andy.jgknet.de/cpp/index.php?pag ... erspeedfix[/img]
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

But there is no output at all, the app closes immediately. What's this?
I got Irrlicht 1.3 to build with Borland C++ 5.5 by using Code::Blocks,and so far the examples are working OK.

Code::Blocks needs to be adjusted to build the DLL,the default linker command is incorrect.

If anyone wants the project,let me know.
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

HLFat wrote:
But there is no output at all, the app closes immediately. What's this?
I got Irrlicht 1.3 to build with Borland C++ 5.5 by using Code::Blocks,and so far the examples are working OK.

Code::Blocks needs to be adjusted to build the DLL,the default linker command is incorrect.

If anyone wants the project,let me know.
Hmm.

Updated info here
mistercrabb
Posts: 12
Joined: Sat Feb 17, 2007 9:26 pm

Post by mistercrabb »

I cant compile the dll. I just get error after error, which i have no idea how to fix. I followed the tutorial carefully.

I give up. Can someone just upload a dll/lib/whatever for me please?
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

Ok...try this:Irrlicht-1.3-B

And,as always, put _control87(MCW_EM,MCW_EM); in main before device creation,and define WIN32 in the defines.Plus include <float.h> someplace.

Also, the files in the 'include' directory will have to be modified per the tutorial.

If that gives you problems, see Darseq's latest post for Irrlicht 1.3 for Builder 6.

It's here,on the last page.

Plus, he includes a build project.Give that a try.Turbo Explorer will import the BCB6 build projects.

This DLL has no DirectX 8 support.

And a whole bunch of warnings is normall.I normally turn them off.

Edit:I just made a new download with my modified include files,since everyone does them a little different.Darseq made some interesting changes to matrix4.h.

Edit twice: Looks like the Builder6 DLL will work for Turbo Explorer.
Post Reply