www.digitalmars.com         C & C++   DMDScript  

D - SDL, OpenGL, and TinyPTC

reply Mac Reiter <Mac_member pathlink.com> writes:
I have upgraded my DMC installation and installed the latest (0.36) DMD alpha.
All of the code in \samples\d compiles and executes just fine.

I am now trying to use the various ported modules from the DedicateD site,
starting with SDL, OpenGL, and TinyPTC.

1. I created a new directory \dmd\import -- somehow \dmd\include didn't seem
right since we don't use #include.  

2. I unzipped all of the packages into \dmd\import.

3. I moved \dmd\import\*.lib into \dmd\lib.

4. I modified \dmd\bin\sc.ini so that the flags variable included my import
directory.

I can now compile testgl, testbitmap, and voxel, but I keep getting linker
errors.  For the SDL/GL examples, the linkage errors sound like it can't find
SDL.lib and OpenGL32.lib.  TinyPTC (library that voxel uses) doesn't come with a
library, it is just an imported module.  I have downloaded the actual Windows
TinyPTC distribution, thinking that it might have a library or DLL I needed, but
it is all source code.

So I have two questions.  They probably arise from ignorance of the linker,
since I use DMC through SC, and it finds everything for me.

1. How do I get testgl and testbitmap to link to the libraries that are
available in \dmd\lib?  SC.INI is configuring the LIB variable correctly to
include this path, because that is where the phobos library is, and the other
programs are linking properly to phobos.

2. What am I doing wrong with the voxel demo?  It shouldn't be a library linkage
problem, because there isn't a library.  The error I get is:

voxel.obj(voxel)
Error 42: Symbol Undefined _Dtinyptc_ptc_open_FAaiiZi
voxel.obj(voxel)
Error 42: Symbol Undefined _Dtinyptc_ptc_update_FPvZi
--- errorlevel 2

Thanks in advance,
Mac
Aug 17 2002
parent reply Pavel Minayev <evilone omen.ru> writes:
On Sat=2C 17 Aug 2002 16=3A24=3A57 +0000 =28UTC=29 Mac Reiter
=3CMac=5Fmember=40pathlink=2Ecom=3E 
wrote=3A

=3E 1=2E How do I get testgl and testbitmap to link to the libraries that are
=3E available in =5Cdmd=5Clib=3F  SC=2EINI is configuring the LIB variable
correctly to
=3E include this path=2C because that is where the phobos library is=2C and the
other
=3E programs are linking properly to phobos=2E

You should tell linker which libs to link=2E It only links module =2Eobjs 
automatically=2C
not libraries =28Walter=2C maybe some way for a module to specify which
objs=2Flibs
it wants to link with=2C added into the language=3F=29=3A

=09dmd testbitmap=2Ed sdl=2Elib
=09dmd testgl=2Ed sdl=2Elib opengl32=2Elib
 
=3E 2=2E What am I doing wrong with the voxel demo=3F  It shouldn't be a
library 
linkage
=3E problem=2C because there isn't a library=2E  The error I get is=3A

=09dmd voxel=2Ed tinyptc=2Ed

Each module is a separate =2Eobj file=2E If you want to use it=2C you have to
link
with it=2E Standard modules are all in phobos=2Elib=2C which is always linked=2E
Any non-standard ones are left up to you=2E
Aug 17 2002
next sibling parent reply "Nils Beyer" <NilsBeyer web.de> writes:
Hi Pavel,


"Pavel Minayev" <evilone omen.ru> wrote:

 2. What am I doing wrong with the voxel demo?  It shouldn't be a library
 linkage problem, because there isn't a library.  The error I get is:
[...]

 dmd voxel.d tinyptc.d
Doesn't work: D:\DM\BIN\..\DINCLUDE\winutil.d(253): function memcpy symbol winutil.memcpy conflicts with string.memcpy at D:\DM\BIN\..\src\phobos\string.d(44) Greetings Nils
Aug 17 2002
parent reply Pavel Minayev <evilone omen.ru> writes:
On Sun, 18 Aug 2002 05:00:44 +0200 "Nils Beyer" <NilsBeyer web.de> wrote:

 Doesn't work:
 
 D:\DM\BIN\..\DINCLUDE\winutil.d(253): function memcpy symbol
 winutil.memcpy conflicts with string.memcpy at
 D:\DM\BIN\..\src\phobos\string.d(44)
Using my windows.d was always a pain in the... The best idea is to avoid using it at all, declaring all functions that it needs yourself. The latest DMD version has much better windows.d, many functions are already there. I'll try to make TinyPTC compatible with it.
Aug 18 2002
parent "Nils Beyer" <NilsBeyer web.de> writes:
Hey Pavel,


"Pavel Minayev" <evilone omen.ru> wrote:
 On Sun, 18 Aug 2002 05:00:44 +0200 "Nils Beyer" <NilsBeyer web.de> wrote:
 Using my windows.d was always a pain in the... The best idea
 is to avoid using it at all, declaring all functions that
 it needs yourself. The latest DMD version has much better
 windows.d, many functions are already there. I'll try to
 make TinyPTC compatible with it.
Yes, but using the with the newest DMD shipped windows.d produces: "tinyptc.d(264): cannot implicitly convert int to HANDLE" I would really like to see the voxel engine working... Perhaps you can send me a tinyptc.obj from you so that I can link that with the voxel.obj demo? Greetings Nils
Aug 18 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:CFN374859792530556 news.digitalmars.com...
(Walter, maybe some way for a module to specify which objs/libs
it wants to link with, added into the language?): In general there ought to be a way to pass implementation defined parameters to the compiler in the source code, but I haven't worked out the details.
Aug 18 2002