Converting Directx8 LIB to a DLL

corey taylor corey.taylor@gmail.com
Sat Jun 28 06:03:00 GMT 2008


On Fri, Jun 27, 2008 at 11:31 PM, Michael Hutton
<michael.hutton@westnet.com.au> wrote:
> Hello,
>
> I would be grateful for any help. I am programming DirectX using BB4W (BBC
> Basic For Windows) by R.T.Russell.  It is a BASIC interpreter. I have been
> programming DirectX applications and have been able to use D3D8.dll with no
> problems but I want to be able to use D3DX8.LIB functions via BASIC. I think
> that in C/C++ the application links the D3DX8.LIB at compile time (??) and I
> have no way in BASIC to do that. I have been able to use the functions in
> D3DX8D.DLL (debug) version but I am not allowed, due to copyright
> restrictions, to redistribute that dll.
> I have been told that with gcc I would be able 'export' the LIB to a DLL and
> then I would be able to redistribute this with my applications. I have
> downloaded gcc, but in all honesty it is all Greek to me.

Why do you think that you would not be able to redistribute?  Why not
redistibute the DirectX installer?  Are you talking about the debug
version because distributing that isn't really needed.

The .lib file you want does not contain the code - you cannot export
it into a "different" dll.  In any case, that wouldn't actually change
you redistributing issue (if there is one).  Accessing the functions
as you're doing below is probably what you want; you simply need to
ensure that the user has installed DirectX with that dll.

> Would anyone be kind enough to either guide me through what I want to do, or
> direct me to the best place? I  know it is a lot to ask.

Someone is going to get upset if I mention this here, but you'll have
to search the Microsoft website for the DirectX redistributable.  This
isn't something gcc can help you with.

> In the mean time I'm going to do a bit of reading ( I would just like to
> state that at the moment I don't even know the difference between a LIB and
> a DLL!) and try to make in roads into this problem.

Well in this case, the directx dll's are dynamically linkable
libraries while the corresponding .lib files for those directx dl's
are import libraries.  They are not static libraries.  As you might
not know, with microsoft compilers you link to a .lib for both static
and dynamic libraries.

> For instance, in BB4W for me to use any procedure in D3DX8D.DLL I would do
> the following
>       [ also install D3D8.dll...
>       ...]
>
>     file$="d3dx8d.dll"         SYS "LoadLibrary", file$ TO D3DX%
>     IF D3DX%=0 THEN PRINT"No D3DX support.":VDU7:WAIT 50
>         SYS "GetProcAddress", D3DX%, "D3DXCreateMesh" TO `D3DXCreateMesh`
>     IF `D3DXCreateMesh`=0 THEN PRINT"`D3DXCreateMesh` not supported."
>     SYS "GetProcAddress", D3DX%, "D3DXCreateTeapot" TO `D3DXCreateTeapot`
>     IF `D3DXCreateTeapot`=0 THEN PRINT"No cuppa!"
>     SYS "GetProcAddress", D3DX%, "D3DXCreateBox" TO `D3DXCreateBox`
>     IF `D3DXCreateBox`=0 THEN PRINT"No Box"
>     SYS "GetProcAddress", D3DX%, "D3DXCreateCylinder" TO
> `D3DXCreateCylinder`
>     IF `D3DXCreateCylinder`=0 THEN PRINT"No Cylinder"
>     SYS "GetProcAddress", D3DX%, "D3DXCreateSphere" TO `D3DXCreateSphere`
>     IF `D3DXCreateSphere`=0 THEN PRINT"No Sphere"
>     SYS "GetProcAddress", D3DX%, "D3DXLoadMeshFromX" TO `D3DXLoadMeshFromX`
>     IF `D3DXLoadMeshFromX`=0 THEN PRINT"No Sphere"
>     SYS "GetProcAddress", D3DX%, "D3DXCreateBuffer" TO `D3DXCreateBuffer`
>     IF `D3DXCreateBuffer`=0 THEN PRINT"Procedure CreateBuffer Not found."
>
> I am able to use the D3DXfunctions.... but am not allowed to redistribute
> the file.

Do that and research redistributable DirectX installations.

corey



More information about the Gcc-help mailing list