Am 18.06.2012 21:12, schrieb Don Duvall:

Hello, I am learning D still and don't understand the toolchain so well
yet, and when I try to switch out the rdmd to a dmd in the run_example
batch script it errors out.

Is it possible to get an example build script that compiles instead of
using rdmd?

rdmd automatically finds all .d files that the app.d depends on - dmd
doesn't do this and thus the linking will fail. If you just want to
build without running you can also navigate to the example directory
(e.g. examples/http_server) and then execute "vibe build". You will then
get an app.exe that can be run manually.

Alternatively, building without rdmd just requires to pass all source
files to the compiler. Something like the following should work:

On Windows:

rem find all source files
cd ../source
dir /s /b .d > ../examples/http_server/files.txt
cd ../examples/http_server/source
dir /s /b
.d >> ../files.txt
rem remove some files now by hand...

rem build the example
cd ..
set LIBDIR=....\lib\win-i386
set LIBS="%LIBDIR%\event2.lib" "%LIBDIR%\eay.lib" "%LIBDIR%\ssl.lib"
ws2_32.lib
dmd -ofapp.exe -I../../source -Isource -Jviews %LIBS% @files.txt

On Posix systems:

find all source files

cd ../source
find -name .d > ../examples/http_server/files.txt
cd ../examples/http_server/source
find -name
.d >> ../files.txt

remove some files now by hand...

build the example

cd ..
LIBS=-L-levent_pthreads -L-levent -L-lssl -L-lcrypto
dmd -ofapp -I../../source -Isource -Jviews $LIBS @files.txt

The following files need to be removed from files.txt prior to
compilation as they are currently not compiling successfully:

deimos/ev.d
core/drivers/ev.d
core/drivers/win32.d
core/drivers/winrt.d
stream/base64.d

I just did a quick test on windows, so no guarantee that the posix
version works correctly.

Regards,
Sönke