www.digitalmars.com         C & C++   DMDScript  

D - TinyPTC problems

reply "Robert M. Münch" <robert.muench robertmuench.de> writes:
Hi, I justed want to play around with D & TincPTC but I have some problems.
Here is what I have done:

1. I downloaded the D tinyptc stuff from Pavel
2. I downloaded the Windows D module from Pavel and replaced the original
one in the src/phobos folder
3. I downloaded the windows tinyPTC stuff
4. I downloaded the NASM assembler to get tinyPTC compiled
5. I called nasmw -o mmx.obj -f win32 mmx.asm
6. I converted mmx.obj with coff2omf and copied to the tinyPTC D directory
where voxel.d is in.
7. Than dmd voxel.d mmx.obj

And now I get:

[d:\develop\dmd\samples\tinypc]dmd voxel.d
link voxel,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

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

Any idea where the problem is? I'm not sure if I created tinyPTC correctly.
Is there more needed than just the ASM file?

--
Robert M. Münch
IT & Management Freelancer
Mobile: +49 (0)177 2452 802
Fax   : +49 (0)721 8408 9112
Web   : http://www.robertmuench.de
Jun 20 2002
parent reply Pavel Minayev <evilone omen.ru> writes:
On Thu=2C 20 Jun 2002 18=3A44=3A49 +0200 =22Robert M=2E M=FCnch=22 
=3Crobert=2Emuench=40robertmuench=2Ede=3E wrote=3A

=3E 4=2E I downloaded the NASM assembler to get tinyPTC compiled
=3E 5=2E I called nasmw -o mmx=2Eobj -f win32 mmx=2Easm

You don't really need these=2E They are only used by DirectX version of
TinyPTC=2C which I was unable to port due to the lack of DX import module=2E

=3E voxel=2Eobj=28voxel=29
=3E  Error 42=3A Symbol Undefined =5FDtinyptc=5Fptc=5Fopen=5FFAaiiZi
=3E voxel=2Eobj=28voxel=29
=3E  Error 42=3A Symbol Undefined =5FDtinyptc=5Fptc=5Fupdate=5FFPvZi
=3E --- errorlevel 2

You should first compile TinyPTC itself=3A

=09dmd -c tinyptc=2Ed

Then=2C you must link it with your program=3A

=09dmd voxel=2Ed tinyptc=2Eobj
Jun 20 2002
next sibling parent reply "Robert M. Munch" <robert.muench robertmuench.de> writes:
"Pavel Minayev" <evilone omen.ru> schrieb im Newsbeitrag
news:CFN374279538205787 news.digitalmars.com...
On Thu, 20 Jun 2002 18:44:49 +0200 "Robert M. Münch"
<robert.muench robertmuench.de> wrote:

 You don't really need these. They are only used by DirectX version of
 TinyPTC, which I was unable to port due to the lack of DX import module.

Hi, ah I see.
 You should first compile TinyPTC itself:
 dmd -c tinyptc.d

Do tinypc.d is all I need or are there are any other external link libs, objs as well? Here is what I get: D:\develop\dmd\bin\..\src\phobos\winutil.d(253): function memcpy symbol winutil.memcpy con flicts with string.memcpy at D:\develop\dmd\bin\..\src\phobos\string.d(44) The winutil.d is the one from your web-site. Robert
Jun 20 2002
parent reply "Robert M. Münch" <robert.muench robertmuench.de> writes:
"Robert M. Munch" <robert.muench robertmuench.de> schrieb im Newsbeitrag
news:aet90f$2779$1 digitaldaemon.com...

 Here is what I get:

 D:\develop\dmd\bin\..\src\phobos\winutil.d(253): function memcpy symbol
 winutil.memcpy con
 flicts with string.memcpy at D:\develop\dmd\bin\..\src\phobos\string.d(44)

 The winutil.d is the one from your web-site. Robert

Hi, well I just commented one of the declarations and than it compiles. However, than I have a next problem: [d:\develop\dmd\samples\tinypc]dmd voxel.d tinyptc.obj link voxel+tinyptc,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved tinyptc.obj(tinyptc) Error 42: Symbol Undefined __init_windows_RECT tinyptc.obj(tinyptc) Error 42: Symbol Undefined __init_windows_MSG --- errorlevel 2 Still anything missing now... Do I have to compile Pavels WINDOWS.D as well and link it with the other parts? Robert
Jun 21 2002
next sibling parent reply Pavel Minayev <evilone omen.ru> writes:
On Fri=2C 21 Jun 2002 20=3A39=3A18 +0200 =22Robert M=2E M=FCnch=22 
=3Crobert=2Emuench=40robertmuench=2Ede=3E wrote=3A

=3E Still anything missing now=2E=2E=2E Do I have to compile Pavels WINDOWS=2ED
as well
=3E and link it with the other parts=3F Robert
 
Not even that simple=2E Since there's already windows=2Eobj in phobos=2Elib=2C
it'll
get linked in the first time=2E

Probably the best solution is to rename windows=2Ed to something like
win32=2Ed=2C
and winutil=2Ed to win32util=2Ed=2C and then change the import clause in
tinyptc=2Ed=2E
Then just compile it all together=3A

=09dmd tinyptc=2Ed win32=2Ed win32util=2Ed 


 
Jun 21 2002
parent reply "Robert M. Munch" <robert.muench robertmuench.de> writes:
"Pavel Minayev" <evilone omen.ru> schrieb im Newsbeitrag
news:CFN374289657175926 news.digitalmars.com...
On Fri, 21 Jun 2002 20:39:18 +0200 "Robert M. Münch"
<robert.muench robertmuench.de> wrote:

 Probably the best solution is to rename windows.d to something like

 and winutil.d to win32util.d,

Ok I did this within the src/phobos dircetory and placed the original windows.d in it again too. I although tried to put win32.d and win32util.d into the tinyPTC directory... no change in results.
 and then change the import clause in tinyptc.d. Then just compile it all

 dmd tinyptc.d win32.d win32util.d

I tried this too but used: dmd -c Than I tried dmd voxel.d tinyptc.obj and gob the same result as last time but the lines now read: d:\develop\dmd\samples\tinypc]dmd voxel.d tinyptc.obj link voxel+tinyptc,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved tinyptc.obj(tinyptc) Error 42: Symbol Undefined __init_win32_RECT tinyptc.obj(tinyptc) Error 42: Symbol Undefined __init_win32_MSG --- errorlevel 2 Strange... I had a look at the win32.d sources and RECT and MSG are structs. So this __init* stuff should be added by the compiler (to initialize the data members?) and it seems as this functions are missing. So what's the problem here? Is it a compiler but? Am I missing some link files? Robert
Jun 21 2002
parent "Robert M. Münch" <robert.muench robertmuench.de> writes:
"Robert M. Munch" <robert.muench robertmuench.de> schrieb im Newsbeitrag
news:aevvc5$2chi$1 digitaldaemon.com...

 Strange... I had a look at the win32.d sources and RECT and MSG are

 So this __init* stuff should be added by the compiler (to initialize the
 data members?) and it seems as this functions are missing. So what's the
 problem here? Is it a compiler but? Am I missing some link files? Robert

I further played around but no success. So I give up and have a look at it sometimes later... don't know where the problem is. Robert
Jun 23 2002
prev sibling parent reply "Robert M. Münch" <robert.muench robertmuench.de> writes:
"Robert M. Münch" <robert.muench robertmuench.de> schrieb im Newsbeitrag
news:aevrce$28c4$1 digitaldaemon.com...

 Hi, well I just commented one of the declarations and than it compiles.
 However, than I have a next problem:

 [d:\develop\dmd\samples\tinypc]dmd voxel.d tinyptc.obj
 link voxel+tinyptc,,,user32+kernel32/noi;
 OPTLINK (R) for Win32  Release 7.50B1
 Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

 tinyptc.obj(tinyptc)
  Error 42: Symbol Undefined __init_windows_RECT
 tinyptc.obj(tinyptc)
  Error 42: Symbol Undefined __init_windows_MSG
 --- errorlevel 2

 Still anything missing now... Do I have to compile Pavels WINDOWS.D as

 and link it with the other parts? Robert

Walter, can you tell me something about this problem? I'm completely unable to solve it... this __init stuff seems to be something the compiler normally adds but is missing now. Robert
Jul 01 2002
parent "Walter" <walter digitalmars.com> writes:
"Robert M. Münch" <robert.muench robertmuench.de> wrote in message
news:afrhil$12nr$1 digitaldaemon.com...
 "Robert M. Münch" <robert.muench robertmuench.de> schrieb im Newsbeitrag
 news:aevrce$28c4$1 digitaldaemon.com...
 tinyptc.obj(tinyptc)
  Error 42: Symbol Undefined __init_windows_RECT
 tinyptc.obj(tinyptc)
  Error 42: Symbol Undefined __init_windows_MSG
 --- errorlevel 2


 to solve it... this __init stuff seems to be something the compiler

 adds but is missing now. Robert

What those symbols are are the static initializers for struct RECT and struct MSG, which are defined in windows.obj.
Jul 08 2002
prev sibling parent "Sean L. Palmer" <seanpalmer earthlink.net> writes:
But you have a (partial) DirectX import module now.  ;)

Sean

"Pavel Minayev" <evilone omen.ru> wrote in message
news:CFN374279538205787 news.digitalmars.com...
On Thu, 20 Jun 2002 18:44:49 +0200 "Robert M. Münch"
<robert.muench robertmuench.de> wrote:

 4. I downloaded the NASM assembler to get tinyPTC compiled
 5. I called nasmw -o mmx.obj -f win32 mmx.asm

You don't really need these. They are only used by DirectX version of TinyPTC, which I was unable to port due to the lack of DX import module.
 voxel.obj(voxel)
  Error 42: Symbol Undefined _Dtinyptc_ptc_open_FAaiiZi
 voxel.obj(voxel)
  Error 42: Symbol Undefined _Dtinyptc_ptc_update_FPvZi
 --- errorlevel 2

You should first compile TinyPTC itself: dmd -c tinyptc.d Then, you must link it with your program: dmd voxel.d tinyptc.obj
Jun 20 2002