I try to use Tango and Phobo together in D2 and I downloaded the package from link and follow its installation process.
But it has only Linux installation but not windows.
This is what I do.
- Visual-D and DMD already installed. link
- I save the file to c:\Tango-D2-d2port
modify my C:\D\dmd2\windows\bin\sc.ini as followed
[Version] version=7.51 Build 020
; environment for both 32/64 bit
[Environment]
DFLAGS= -IC:\Tango-D2-d2port\ -L-LC:\Tango-D2-d2port\ "-I%@P%....\src\phobos" "-I%@P%....\src\druntime\import"
; optlink only reads from the Environment section so we need this redundancy ; from the Environment32 section (bugzilla 11302)
LIB="%@P%..\lib"
[Environment32]
LIB="%@P%..\lib"
LINKCMD=%@P%\link.exe
[Environment64]
LIB="%@P%..\lib64"
DFLAGS=%DFLAGS% -L/OPT:NOICF
LINKCMD=%VCINSTALLDIR%\bin\link.exe
I compile my code using following shell script file and I use dmd2\windows\bin\shell.exe to execute.
DMD=C:\D\dmd2\windows\bin\dmd
DFLAGS=
$(DMD) Main.d -debug -L+C:\Tango-D2-d2port\libtango-dmd
My sample code from the installation page mentioned above.
import tango.io.Stdout;
void main()
{
Stdout("Hello from Tango!").nl;
}
error message.
shell 1.05
C:\D\dmd2\windows\bin\dmd Main.d -debug -L+C:\Tango-D2-d2port\libtango-dmd
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Main.obj(Main)
Error 42: Symbol Undefined _D5tango2io6Stdout12__ModuleInfoZ
Main.obj(Main)
Error 42: Symbol Undefined _D5tango2io6Stdout6StdoutC5tango2io6stream6Format20__T12FormatOutputTaZ12FormatOutput
Main.obj(Main)
Error 42: Symbol Undefined _D5tango2io6stream6Format20__T12?Outp垿aZ?7newli嘜FNdZC銅
Main.obj(Main)
Error 42: Symbol Undefined _D5tango2io6stream6Format20__T12?Outp垿aZ?5printMFYC酷
--- errorlevel 4
I have been trying for 1-2 weeks already and this is the best I can get after I looked up many places for reference but are all futile.
It works now. 1. I have to use the one-click installation instead of using the zip file 2. the correct version: DFLAGS=-IC:\Tango-D2-d2port\ -L+C:\Tango-D2-d2port\ "-I%@P%....\src\phobos" "-I%@P%....\src\druntime\import"
there is no double -L as described in the tango installation website. It should be a typo. 3. $(DMD) Main.d -debug -L+C:\Tango-D2-d2port\libtango-dmd.lib <-- better to add .lib to specify which file.
Thank you.