FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to include minid in a project ?

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
moechofe



Joined: 07 Oct 2006
Posts: 25
Location: Paris, France

PostPosted: Sat Oct 07, 2006 5:23 pm    Post subject: How to include minid in a project ? Reply with quote

I dont find the solution to use minid, and to run the simple.md script.
DrakeX can you explain the way. Please ?

sorry for my english
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Mon Oct 16, 2006 11:38 am    Post subject: Reply with quote

Wow, where'd you get my other forum name?

In any case, if you look in the /trunk/minid directory of the repo, you will find compile.bat. This is kind of a remnant of my personal batch file system, but it shouldn't be too hard to figure out the compiler command line. So given the compile.bat:

Code:
@echo off
set DFLAGS=-debug -g -oftest.exe -I"C:\dmd\proj\minid"
set DPROG=test
set DFILES=state.d types.d ?DPROG?.d compiler.d opcodes.d stringlib.d arraylib.d tablelib.d baselib.d
set DLIBS=

call \dmd\proj\maincompile.bat


You just kind of put together the pieces on the command line:

Code:
dmd -debug -g -oftest.exe -I"C:\dmd\proj\minid" state.d types.d test.d compiler.d opcodes.d stringlib.d arraylib.d tablelib.d baselib.d


The order of the .d files is important! There is a bug in DMD (and GDC as well) which will cause the compiler to spit out stupid errors which just don't really exist; changing the order of the files to what is makes those errors go away.

Once compiled, there will be a test.exe which you can then run, which will attempt to compile and run simple.md. Keep in mind though that the current compiler in the repo is not exactly.. functional. It has a bug in it which I am still trying to fix (but haven't had much time). So you could try checking out an earlier revision.
Back to top
View user's profile Send private message
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Tue Oct 31, 2006 6:19 pm    Post subject: don't compile! Reply with quote

I used you dmd code to compile MiniD,it display error,help me!

Code:
D:\D\minid>dmd -debug -g -oftest.exe -I.. state.d types.d test.d compiler.d opco
des.d stringlib.d arraylib.d tablelib.d baselib.d
D:\D\dmd\bin\..\..\dm\bin\link.exe state+types+test+compiler+opcodes+stringlib+a
rraylib+tablelib+baselib,test.exe,,user32+kernel32/co/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

test.obj(test)
 Error 42: Symbol Undefined _D5minid7mathlib4initFC5minid5state7MDStateZv
test.obj(test)
 Error 42: Symbol Undefined _D5minid7charlib4initFC5minid5state7MDStateZv
--- errorlevel 2
deleting old intermediate files ...

D:\D\minid>



Why compile MiniD to lib,then link it?

Code:
build -release -O -clean -inline  -lib -full -allobj all.d -I.. -T..\minid.lib

then:
Code:
dmd -oftest test.d minid.lib -I.. -release


all on DMD172,windows xp .
________
volcano vaporizers


Last edited by ideage on Wed Feb 02, 2011 5:02 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Tue Oct 31, 2006 6:45 pm    Post subject: Reply with quote

aha, I download new MiniD from SVN, modified compile command,it work!

Code:
dmd -debug -g -oftest.exe -I.. state.d types.d compiler.d opcodes.d stringlib.d arraylib.d tablelib.d baselib.d mathlib.d charlib.d test.d



compile to lib don't work.
Your "simple.md" comment some test,I delete comment, don't work yet!
________
health store


Last edited by ideage on Wed Feb 02, 2011 5:02 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Oct 31, 2006 10:09 pm    Post subject: Reply with quote

Quote:
compile to lib don't work.


Ah! Thanks for finding that bug. There's a function in MDState, called "printStack," which is only compiled in the debug build. When you compile the library with -release but the program with -debug, what happens is that the program expects the MDState functions to be at different indices from where they really are. So I've marked the printStack function as final, and it works now. (I'll upload the source to the SVN repo tonight.)

Quote:
Your "simple.md" comment some test,I delete comment, don't work yet!


There is one part of it which shouldn't work yet -- but that's because I haven't finished the IO library yet. But all of the other parts should work. Actually, when I update the repo tonight, that part that doesn't work is going to be moved out into a "wc.md" file.
Back to top
View user's profile Send private message
ideage



Joined: 12 Jul 2006
Posts: 63
Location: china

PostPosted: Wed Nov 01, 2006 12:42 am    Post subject: Reply with quote

Thank you for MiniD hard-working!

Quote:
which is only compiled in the debug build


I try it in debug build,but display error all the same.

Code:
hello 4 world!
Error: Access Violation

________
herbal health


Last edited by ideage on Wed Feb 02, 2011 5:02 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Wed Nov 01, 2006 12:29 pm    Post subject: Reply with quote

You try downloading the newest MiniD from the SVN yet? If that still doesn't fix it, maybe something else is going wrong.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group