www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd and visual D

reply Vince <forumer smartmobili.com> writes:
Hi,

I wanted to test last dmd compiler with VisualD (Visual Studio plugin) on
Windows 7 64 bits.
I have installed dmd compiler inside C:\Developer\DLang and then started
Visual to create
a windows application but when I click on Build I get the following error :

------ Build started: Project: WindowsApp1, Configuration: Debug Win32 ------
Building Debug\WindowsApp1.exe...
winmain.d(3): Error: module runtime is in file 'core\runtime.d' which cannot
be read
import path[0] = C:\Developer\DLang\dmd\windows\bin\..\..\src\phobos
Building Debug\WindowsApp1.exe failed!
Details saved as "file://C:\Users\Vincent\Documents\Visual Studio
2010\Projects\WindowsApp1\Debug\buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Any idea
Sep 17 2010
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
Vince wrote:
 Hi,
 
 I wanted to test last dmd compiler with VisualD (Visual Studio plugin) on
 Windows 7 64 bits.
 I have installed dmd compiler inside C:\Developer\DLang and then started
 Visual to create
 a windows application but when I click on Build I get the following error :
 
 ------ Build started: Project: WindowsApp1, Configuration: Debug Win32 ------
 Building Debug\WindowsApp1.exe...
 winmain.d(3): Error: module runtime is in file 'core\runtime.d' which cannot
 be read
 import path[0] = C:\Developer\DLang\dmd\windows\bin\..\..\src\phobos
 Building Debug\WindowsApp1.exe failed!
 Details saved as "file://C:\Users\Vincent\Documents\Visual Studio
 2010\Projects\WindowsApp1\Debug\buildlog.html"
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
 
 Any idea
 
It seems there is an import path missing in the dmd compiler config file windows\bin\sc.ini. Did you modify it in any way? It should contain DFLAGS="-I% P%\..\..\src\phobos" "-I% P%\..\..\src\druntime\import" which causes import path[1] = C:\Developer\DLang\dmd\windows\bin\..\..\src\druntime\import to be shown for missing imports.
Sep 17 2010
parent reply Vince <forumer smartmobili.com> writes:
I have changed the dmd\windows\bin\sc.ini as suggested(and it was
weird because I had to use my text editor with administrator
rights) but I still have one error :

Build Log
Building Debug\WindowsApp1.exe
Command Line
set PATH=C:\Developer\DLang\windows\bin;C:\Program Files (x86)
\Microsoft SDKs\Windows\v7.0A\\bin;%PATH%
dmd -g -debug -X -Xf"Debug\WindowsApp1.json" -
of"Debug\WindowsApp1.exe_cv" -deps="Debug\WindowsApp1.dep" -
map "Debug\WindowsApp1.map" -L/NOMAP ole32.lib kernel32.lib
user32.lib comctl32.lib comdlg32.lib -L/SUBSYSTEM:WINDOWS winmain.d
if errorlevel 1 goto reportError
if not exist "Debug\WindowsApp1.exe_cv"
(echo "Debug\WindowsApp1.exe_cv" not created! && goto reportError)
echo Converting debug information...
"C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" -
D2 "Debug\WindowsApp1.exe_cv" "Debug\WindowsApp1.exe"
if errorlevel 1 goto reportError
if not exist "Debug\WindowsApp1.exe" (echo "Debug\WindowsApp1.exe"
not created! && goto reportError)

goto noError

:reportError
echo Building Debug\WindowsApp1.exe failed!

:noError
Output
winmain.d(3): Error: module runtime is in file 'core\runtime.d'
which cannot be read
import path[0] =
C:\Developer\DLang\dmd\windows\bin\..\..\src\phobos
import path[1] =
C:\Developer\DLang\dmd\windows\bin\..\..\src\druntime\import
Building Debug\WindowsApp1.exe failed!



Building Debug\WindowsApp1.exe failed!
Details saved as "file://C:\Users\Vincent\Documents\Visual Studio
2010\Projects\WindowsApp1\Debug\buildlog.html"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========


By the way, why does I had to modify the sc.ini of dmd folder? I
thought VisualD was using D2 compiler ie the dmd.exe found in dmd2
folder.
Sep 18 2010
parent reply Rainer Schuetze <r.sagitario gmx.de> writes:
I guess C:\Developer\DLang\dmd contains the D1 compiler. The WindowsApp 
example is for D2. You should change the dmd path in 
Tools->Options->Projects->Visual D, probably to C:\Developer\DLang\dmd2.

If this is the problem, the changes to sc.ini were unnecessary and 
should be undone.

Vince wrote:
 I have changed the dmd\windows\bin\sc.ini as suggested(and it was
 weird because I had to use my text editor with administrator
 rights) but I still have one error :
 
 Build Log
 Building Debug\WindowsApp1.exe
 Command Line
 set PATH=C:\Developer\DLang\windows\bin;C:\Program Files (x86)
 \Microsoft SDKs\Windows\v7.0A\\bin;%PATH%
 dmd -g -debug -X -Xf"Debug\WindowsApp1.json" -
 of"Debug\WindowsApp1.exe_cv" -deps="Debug\WindowsApp1.dep" -
 map "Debug\WindowsApp1.map" -L/NOMAP ole32.lib kernel32.lib
 user32.lib comctl32.lib comdlg32.lib -L/SUBSYSTEM:WINDOWS winmain.d
 if errorlevel 1 goto reportError
 if not exist "Debug\WindowsApp1.exe_cv"
 (echo "Debug\WindowsApp1.exe_cv" not created! && goto reportError)
 echo Converting debug information...
 "C:\Program Files (x86)\VisualD\cv2pdb\cv2pdb.exe" -
 D2 "Debug\WindowsApp1.exe_cv" "Debug\WindowsApp1.exe"
 if errorlevel 1 goto reportError
 if not exist "Debug\WindowsApp1.exe" (echo "Debug\WindowsApp1.exe"
 not created! && goto reportError)
 
 goto noError
 
 :reportError
 echo Building Debug\WindowsApp1.exe failed!
 
 :noError
 Output
 winmain.d(3): Error: module runtime is in file 'core\runtime.d'
 which cannot be read
 import path[0] =
 C:\Developer\DLang\dmd\windows\bin\..\..\src\phobos
 import path[1] =
 C:\Developer\DLang\dmd\windows\bin\..\..\src\druntime\import
 Building Debug\WindowsApp1.exe failed!
 
 
 
 Building Debug\WindowsApp1.exe failed!
 Details saved as "file://C:\Users\Vincent\Documents\Visual Studio
 2010\Projects\WindowsApp1\Debug\buildlog.html"
 ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
 ==========
 
 
 By the way, why does I had to modify the sc.ini of dmd folder? I
 thought VisualD was using D2 compiler ie the dmd.exe found in dmd2
 folder.
Sep 18 2010
parent Vince <forumer smartmobili.com> writes:
Yes it was the problem I have modified the variable env (something
like $DmdInstalldir) by my explicit path C:\Developer\DLang\dmd2
\windows\bin but a better solution would be to directly modify the
var env and to understand why it happened.
Sep 18 2010