Thread overview
SDL, OpenGL, and TinyPTC
Aug 17, 2002
Mac Reiter
Aug 17, 2002
Pavel Minayev
Aug 18, 2002
Nils Beyer
Aug 18, 2002
Pavel Minayev
Aug 18, 2002
Nils Beyer
Aug 18, 2002
Walter
August 17, 2002
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


August 17, 2002
On Sat, 17 Aug 2002 16:24:57 +0000 (UTC) Mac Reiter <Mac_member@pathlink.com> wrote:

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

You should tell linker which libs to link. It only links module .objs
automatically,
not libraries (Walter, maybe some way for a module to specify which objs/libs
it wants to link with, added into the language?):

	dmd testbitmap.d sdl.lib
	dmd testgl.d sdl.lib opengl32.lib

> 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

Each module is a separate .obj file. If you want to use it, you have to link with it. Standard modules are all in phobos.lib, which is always linked. Any non-standard ones are left up to you.
August 18, 2002
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


August 18, 2002
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.
August 18, 2002
"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.


August 18, 2002
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