www.digitalmars.com         C & C++   DMDScript  

D - linking

reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Just in case anyone else is having trouble linking, I finally figured out
how to get DMD to deal with multiple files and other libs and such and
here's the batch file I now have for building testgl:

cd \dmd\d\testgl
\dmd\bin\dmd testgl.d winbase.d wingdi.d winuser.d gdi32.lib user32.lib
kernel32.lib opengl32.lib -I\dmd\src\phobos

It no longer uses SC or shell scripts.  This is actually quite nice Walter,
thanks for enabling this.

BTW I also have a Visual Studio 6 utility project set up that builds D files
as custom build steps, so I can debug from the ide.  ;)

Sean
Jun 01 2002
next sibling parent reply "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
 BTW I also have a Visual Studio 6 utility project set up that builds D

 as custom build steps, so I can debug from the ide.  ;)

 Sean

Hi, Do you have a website where we can download it (or the way you set up Visual Studio). I would find it very nice to have an IDE where to produce and debug D-apps. It would make the work more (easier) enjoyable
Jun 02 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
They're just a few K (attached)

Not as convenient as I'd like.  It doesn't syntax highlight D files.  It
also doesn't allow you to define new file types in general so you can't make
a build rule for, say, to build D files you run dmd.exe with these
parameters.  So each file ends up with its own custom build step.

For a larger project I'd set it up to build thru a batch file or make and
have the whole project not set to build individual files but just to call
the batch file with different parameters when you hit F7.  But then you have
to maintain separately the list of files in the IDE and the list of files in
the batch or make file.  This is mainly a problem with Visual Studio 6;  I'm
not sure if VS .net is any better about this.  I've also tried MED (don't
like it so far) and TextPad (which seems to be growing into more of a HTML
editor than an IDE).  Maybe I should look for a new tool.  I'm sure I could
configure Multi-Edit or one of those other high-dollar programmer's editors
to make working with D a snap.  What is really needed is something that is
an IDE integrated with MAKE.  Kind of a GUI front end for MAKE that just
also happens to be a text editor, debugger, and type and object browser
would be perfect; especially if it comes with its own D compiler.  ;)  I'm
not opposed to gluing together other tools, but integration actually does
help productivity.

If I could just get Visual Studio to have an explorer window instead of the
project window!

I just thought of something.  Maybe if you could configure a folder so that
while you're browsing in there, if you hit a certain key it performs some
action (possibly with use of information such as which folder you're
currently in;  what file you're looking at;  what is selected; etc).  But
ONLY while you're in one of the subfolders or a document located in a
subfolder.  This would be like integrating the compiler into the explorer
window.  I know you can also compile files using the context menu in the
explorer;  I've also attached a d.reg file that you can merge that *should*
make your computer (if it's running windows ;) able to compile a .D file
into a .OBJ or .EXE file by right-clicking it and selecting Compile or
Compile And Link.  You may have to customize the path in the registry (or
explorer's Tools | Folder Options | File Types) to point to the correct
location of your dmd.exe and phobos lib.  I'm interested to know if it works
on other peoples' machines besides mine.  If you're worried, all these
attachments are text files and can be perused.

Sean

"Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
news:adcg5n$2ivo$1 digitaldaemon.com...
 BTW I also have a Visual Studio 6 utility project set up that builds D

 as custom build steps, so I can debug from the ide.  ;)

 Sean

Hi, Do you have a website where we can download it (or the way you set up Visual Studio). I would find it very nice to have an IDE where to produce and debug D-apps. It would make the work more (easier) enjoyable

Jun 02 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adcopu$2rh6$1 digitaldaemon.com...

 Not as convenient as I'd like.  It doesn't syntax highlight D files.  It
 also doesn't allow you to define new file types in general so you can't

 a build rule for, say, to build D files you run dmd.exe with these
 parameters.  So each file ends up with its own custom build step.

By the way, I've seen a Visual Studio addin once, which added support for another language (Euphoria) to VS. It added syntax highlighting, that's for sure, but I don't remember if it was able to associate the appropriate compiler with .exw files. I wonder if something like this can be done for D? Might check the MSDN...
Jun 02 2002
parent reply "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
 By the way, I've seen a Visual Studio addin once, which added support
 for another language (Euphoria) to VS. It added syntax highlighting,
 that's for sure, but I don't remember if it was able to associate the
 appropriate compiler with .exw files. I wonder if something like this
 can be done for D? Might check the MSDN...

Thanks a lot, I found what you meant on the internet, did a little bit of research at codeguru and found what I had to do to enable syntax colouring. Attached you find: * d.ico: an icon for .d-files (I didn't know if one already exists, so I created one) > put it in \dmd\bin * d.reg: assigns an icon to .d-files, adds context menu's to them, make them start with Msdev.exe = slightly modified version from the one from Sean L. Palmer (thanks) * syntax.reg: make syntax highlighting work under Visual Studio * usertype.dat: keywords for D. > put it in the directory where msdev.exe resides Hope this can help some
Jun 02 2002
parent reply "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
 Thanks a lot, I found what you meant on the internet, did a little bit of
 research at codeguru and found what I had to do to enable syntax
 colouring.
 Attached you find:
 * d.ico: an icon for .d-files (I didn't know if one already exists, so I
 created one)
    > put it in \dmd\bin
 * d.reg: assigns an icon to .d-files, adds context menu's to them, make

 start with Msdev.exe
      = slightly modified version from the one from Sean L. Palmer (thanks)
 * syntax.reg: make syntax highlighting work under Visual Studio
 * usertype.dat: keywords for D.
    > put it in the directory where msdev.exe resides

 Hope this can help someone

Stupid of me, forgotten to attach those files
Jun 02 2002
next sibling parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
That's cool.  After looking at it, I believe a more thorough job can be
done, to the point of making D its own file type, its own syntax type, and
possibly even get DevStudio to know that D files are supposed to be built
with dmd.exe.  Maybe even make a D project type that links with DM link.

I'll keep you guys posted.

Sean

"Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
news:addls7$119m$1 digitaldaemon.com...
 Thanks a lot, I found what you meant on the internet, did a little bit


 research at codeguru and found what I had to do to enable syntax
 colouring.
 Attached you find:
 * d.ico: an icon for .d-files (I didn't know if one already exists, so I
 created one)
    > put it in \dmd\bin
 * d.reg: assigns an icon to .d-files, adds context menu's to them, make

 start with Msdev.exe
      = slightly modified version from the one from Sean L. Palmer


 * syntax.reg: make syntax highlighting work under Visual Studio
 * usertype.dat: keywords for D.
    > put it in the directory where msdev.exe resides

 Hope this can help someone

Stupid of me, forgotten to attach those files

Jun 02 2002
parent reply "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adduam$1jti$1 digitaldaemon.com...
 That's cool.  After looking at it, I believe a more thorough job can be
 done, to the point of making D its own file type, its own syntax type, and
 possibly even get DevStudio to know that D files are supposed to be built
 with dmd.exe.  Maybe even make a D project type that links with DM link.

When I was looking for it this afternoon, I encountered the ideal solution: Micro$oft provides an "Visual Studio Integrator Program (VSIP)": "For example, a user might want to incorporate a new programming language into the Visual Studio .NET IDE, possibly creating a need for: - A new project type. - A customized editor. - Advanced debugging features. " Just what we needed for D, Unfortunately you cannot download it for free, you have to sign up and pay for it: The cost for joining VSIP is $10,000 US per year for a three year contract. Academic involvement with the program requires a Microsoft sponsor to help cover associated VSIP expenses What a pity it's not in my budget :-) Though there are solutions: some programs managed to integrate into VStudio 6.0 at a very smooth way and (what is much more important) give their source code, the one I mean is at http://www.wndtabs.com/ At CodeProject an artictle about the same is also available, it's called "Undocumented Visual C++", you could guess it wouldn't be documented http://www.codeproject.com/macro/openvc.asp I think syntax highlighting is all-right and for the other stuff we have to go this way (class view subclassing,...) Much work to do, and that with the exams in front Jonas
Jun 02 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
news:ade3ba$1ugb$1 digitaldaemon.com...

 Though there are solutions: some programs managed to integrate into

 6.0 at a very smooth way and (what is much more important) give their

 code, the one I mean is at http://www.wndtabs.com/

 At CodeProject an artictle about the same is also available, it's called
 "Undocumented Visual C++", you could guess it wouldn't be documented
 http://www.codeproject.com/macro/openvc.asp

 I think syntax highlighting is all-right and for the other stuff we have

 go this way (class view subclassing,...)
 Much work to do, and that with the exams in front

After some examination of msdev.exe and related files, I've found out that all syntax highlighting is stored in the PKG files (actually DLLs) with names like devcpp.pkg, devhtmx.pkg etc. Looking inside with a hex editor, you'll find list of keywords, dialogs (ClassWizard is also there!), list of file extensions... I made a copy of devcpp.pkg and used a resource editor and a hex editor to tweak it a bit... now it shows "D files" in the open menu, but I still can't get syntax highlighting to work. Oh well. And those PKGs aren't documented anywhere in MSDN...
Jun 03 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
In the registry you can make a new class of files (look under "Build
System") but that by itself also isn't enough to get anything done.  It does
affect the dropdown list in the "Tabs" tab of the settings dialog.

Maybe if we did both?

It appears M$ doesn't want just anybody extending their Visual Studio.  They
want to sell you a $10000 Visual Studio Extension Kit.

Sean

"Pavel Minayev" <evilone omen.ru> wrote in message
news:adf79p$o78$1 digitaldaemon.com...
 "Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
 news:ade3ba$1ugb$1 digitaldaemon.com...

 Though there are solutions: some programs managed to integrate into

 6.0 at a very smooth way and (what is much more important) give their

 code, the one I mean is at http://www.wndtabs.com/

 At CodeProject an artictle about the same is also available, it's called
 "Undocumented Visual C++", you could guess it wouldn't be documented
 http://www.codeproject.com/macro/openvc.asp

 I think syntax highlighting is all-right and for the other stuff we have

 go this way (class view subclassing,...)
 Much work to do, and that with the exams in front

After some examination of msdev.exe and related files, I've found out that all syntax highlighting is stored in the PKG files (actually DLLs) with names like devcpp.pkg, devhtmx.pkg etc. Looking inside with a hex editor, you'll find list of keywords, dialogs (ClassWizard is also there!), list of file extensions... I made a copy of devcpp.pkg and used a resource editor and a hex editor to tweak it a bit... now it shows "D files" in the open menu, but I still can't get syntax highlighting to work. Oh well. And those PKGs aren't documented anywhere in MSDN...

Jun 03 2002
next sibling parent reply "Walter" <walter digitalmars.com> writes:
If you fellows want to put together a zip file to do this, and write a short
set of instructions, I'll be happy to make it available on the web
site. -Walter

"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adgalp$1u5v$1 digitaldaemon.com...
 In the registry you can make a new class of files (look under "Build
 System") but that by itself also isn't enough to get anything done.  It

 affect the dropdown list in the "Tabs" tab of the settings dialog.

 Maybe if we did both?

 It appears M$ doesn't want just anybody extending their Visual Studio.

 want to sell you a $10000 Visual Studio Extension Kit.

 Sean

 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:adf79p$o78$1 digitaldaemon.com...
 "Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
 news:ade3ba$1ugb$1 digitaldaemon.com...

 Though there are solutions: some programs managed to integrate into

 6.0 at a very smooth way and (what is much more important) give their

 code, the one I mean is at http://www.wndtabs.com/

 At CodeProject an artictle about the same is also available, it's



 "Undocumented Visual C++", you could guess it wouldn't be documented
 http://www.codeproject.com/macro/openvc.asp

 I think syntax highlighting is all-right and for the other stuff we



 to
 go this way (class view subclassing,...)
 Much work to do, and that with the exams in front

After some examination of msdev.exe and related files, I've found out


 all syntax highlighting is stored in the PKG files (actually DLLs) with
 names like devcpp.pkg, devhtmx.pkg etc. Looking inside with a hex


 you'll find list of keywords, dialogs (ClassWizard is also there!), list
 of file extensions... I made a copy of devcpp.pkg and used a resource
 editor and a hex editor to tweak it a bit... now it shows "D files" in
 the open menu, but I still can't get syntax highlighting to work. Oh
 well. And those PKGs aren't documented anywhere in MSDN...


Jun 03 2002
parent "Sean L. Palmer" <seanpalmer earthlink.net> writes:
We will if we can figure out how to get &%*!  dev studio to do it properly.
;)

Sean

"Walter" <walter digitalmars.com> wrote in message
news:adgof1$2de0$1 digitaldaemon.com...
 If you fellows want to put together a zip file to do this, and write a

 set of instructions, I'll be happy to make it available on the web
 site. -Walter

 "Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
 news:adgalp$1u5v$1 digitaldaemon.com...
 In the registry you can make a new class of files (look under "Build
 System") but that by itself also isn't enough to get anything done.  It

 affect the dropdown list in the "Tabs" tab of the settings dialog.

 Maybe if we did both?

 It appears M$ doesn't want just anybody extending their Visual Studio.

 want to sell you a $10000 Visual Studio Extension Kit.

 Sean

 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:adf79p$o78$1 digitaldaemon.com...
 "Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
 news:ade3ba$1ugb$1 digitaldaemon.com...

 Though there are solutions: some programs managed to integrate into

 6.0 at a very smooth way and (what is much more important) give




 source
 code, the one I mean is at http://www.wndtabs.com/

 At CodeProject an artictle about the same is also available, it's



 "Undocumented Visual C++", you could guess it wouldn't be documented
 http://www.codeproject.com/macro/openvc.asp

 I think syntax highlighting is all-right and for the other stuff we



 to
 go this way (class view subclassing,...)
 Much work to do, and that with the exams in front

After some examination of msdev.exe and related files, I've found out


 all syntax highlighting is stored in the PKG files (actually DLLs)



 names like devcpp.pkg, devhtmx.pkg etc. Looking inside with a hex


 you'll find list of keywords, dialogs (ClassWizard is also there!),



 of file extensions... I made a copy of devcpp.pkg and used a resource
 editor and a hex editor to tweak it a bit... now it shows "D files" in
 the open menu, but I still can't get syntax highlighting to work. Oh
 well. And those PKGs aren't documented anywhere in MSDN...



Jun 03 2002
prev sibling parent "Pavel Minayev" <evilone omen.ru> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adgalp$1u5v$1 digitaldaemon.com...

 In the registry you can make a new class of files (look under "Build
 System") but that by itself also isn't enough to get anything done.  It

 affect the dropdown list in the "Tabs" tab of the settings dialog.

 Maybe if we did both?

I did both. No, it still doesn't work.
Jun 03 2002
prev sibling parent reply "Carlos" <carlos8294 msn.com> writes:
i don't know if it happened only to me, but i couldn't open the d files
until i changed the attributes of the type (of file) and set the application
as its full path + filename (c:\....\msdev.exe). Before that, windows said
"file (something).d can't be found ...". Was that supposed to happen?

"Jonas" <jonas.vermeulen student.kuleuven.ac.be> escribió en el mensaje
news:addls7$119m$1 digitaldaemon.com...
 Thanks a lot, I found what you meant on the internet, did a little bit


 research at codeguru and found what I had to do to enable syntax
 colouring.
 Attached you find:
 * d.ico: an icon for .d-files (I didn't know if one already exists, so I
 created one)
    > put it in \dmd\bin
 * d.reg: assigns an icon to .d-files, adds context menu's to them, make

 start with Msdev.exe
      = slightly modified version from the one from Sean L. Palmer


 * syntax.reg: make syntax highlighting work under Visual Studio
 * usertype.dat: keywords for D.
    > put it in the directory where msdev.exe resides

 Hope this can help someone

Stupid of me, forgotten to attach those files

Jun 03 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Your devstudio is probably installed somewhere different.  Open the .REG
file with a text editor and make the path correct, then re-merge and try
again.

Sean

"Carlos" <carlos8294 msn.com> wrote in message
news:adh0k4$2maf$1 digitaldaemon.com...
 i don't know if it happened only to me, but i couldn't open the d files
 until i changed the attributes of the type (of file) and set the

 as its full path + filename (c:\....\msdev.exe). Before that, windows said
 "file (something).d can't be found ...". Was that supposed to happen?

 "Jonas" <jonas.vermeulen student.kuleuven.ac.be> escribió en el mensaje
 news:addls7$119m$1 digitaldaemon.com...
 Thanks a lot, I found what you meant on the internet, did a little bit


 research at codeguru and found what I had to do to enable syntax
 colouring.
 Attached you find:
 * d.ico: an icon for .d-files (I didn't know if one already exists, so



 created one)
    > put it in \dmd\bin
 * d.reg: assigns an icon to .d-files, adds context menu's to them,



 them
 start with Msdev.exe
      = slightly modified version from the one from Sean L. Palmer


 * syntax.reg: make syntax highlighting work under Visual Studio
 * usertype.dat: keywords for D.
    > put it in the directory where msdev.exe resides

 Hope this can help someone

Stupid of me, forgotten to attach those files


Jun 03 2002
parent reply "Carlos" <carlos8294 msn.com> writes:
it is installed in a different path ("archivos de programa" instead of
"program files"), but i made it work anyway. what i'm asking if that was
normal.

"Sean L. Palmer" <seanpalmer earthlink.net> escribió en el mensaje
news:adhfma$3m5$1 digitaldaemon.com...
 Your devstudio is probably installed somewhere different.  Open the .REG
 file with a text editor and make the path correct, then re-merge and try
 again.

 Sean

 "Carlos" <carlos8294 msn.com> wrote in message
 news:adh0k4$2maf$1 digitaldaemon.com...
 i don't know if it happened only to me, but i couldn't open the d files
 until i changed the attributes of the type (of file) and set the

 as its full path + filename (c:\....\msdev.exe). Before that, windows


 "file (something).d can't be found ...". Was that supposed to happen?


Jun 03 2002
parent reply "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
"Carlos" <carlos8294 msn.com> wrote in message
news:adhg7o$4a7$1 digitaldaemon.com...
 it is installed in a different path ("archivos de programa" instead of
 "program files"), but i made it work anyway. what i'm asking if that was
 normal.

 "Sean L. Palmer" <seanpalmer earthlink.net> escribió en el mensaje
 news:adhfma$3m5$1 digitaldaemon.com...
 Your devstudio is probably installed somewhere different.  Open the .REG
 file with a text editor and make the path correct, then re-merge and try
 again.

 Sean

 "Carlos" <carlos8294 msn.com> wrote in message
 news:adh0k4$2maf$1 digitaldaemon.com...
 i don't know if it happened only to me, but i couldn't open the d



 until i changed the attributes of the type (of file) and set the

 as its full path + filename (c:\....\msdev.exe). Before that, windows


 "file (something).d can't be found ...". Was that supposed to happen?



I didn't include the pathname in the .reg file, because msdev.exe was in my path and so Windows would find it. I thought that was the default behaviour of VStudio installer (to setup the path that way). Don't you have an MSDevDir environment variable neither?
Jun 03 2002
parent reply "Sean L. Palmer" <seanpalmer earthlink.net> writes:
Setting those env vars is an option when installing DevStudio.  If you
don't, you can always run vcvars32.bat right?

Sean

"Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
news:adhneh$bem$1 digitaldaemon.com...
 "Carlos" <carlos8294 msn.com> wrote in message
 news:adhg7o$4a7$1 digitaldaemon.com...
 it is installed in a different path ("archivos de programa" instead of
 "program files"), but i made it work anyway. what i'm asking if that was
 normal.

 "Sean L. Palmer" <seanpalmer earthlink.net> escribió en el mensaje
 news:adhfma$3m5$1 digitaldaemon.com...
 Your devstudio is probably installed somewhere different.  Open the



 file with a text editor and make the path correct, then re-merge and



 again.

 Sean



Jun 04 2002
parent "Jonas" <jonas.vermeulen student.kuleuven.ac.be> writes:
You're right, I hadn't thought about it.
That will probably be the cause.
Jonas

"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adhq4s$f4h$1 digitaldaemon.com...
 Setting those env vars is an option when installing DevStudio.  If you
 don't, you can always run vcvars32.bat right?

 Sean

 "Jonas" <jonas.vermeulen student.kuleuven.ac.be> wrote in message
 news:adhneh$bem$1 digitaldaemon.com...
 "Carlos" <carlos8294 msn.com> wrote in message
 news:adhg7o$4a7$1 digitaldaemon.com...
 it is installed in a different path ("archivos de programa" instead of
 "program files"), but i made it work anyway. what i'm asking if that



 normal.

 "Sean L. Palmer" <seanpalmer earthlink.net> escribió en el mensaje
 news:adhfma$3m5$1 digitaldaemon.com...
 Your devstudio is probably installed somewhere different.  Open the



 file with a text editor and make the path correct, then re-merge and



 again.

 Sean




Jun 04 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Sean L. Palmer" <seanpalmer earthlink.net> wrote in message
news:adbldf$1lp6$1 digitaldaemon.com...
 Just in case anyone else is having trouble linking, I finally figured out
 how to get DMD to deal with multiple files and other libs and such and
 here's the batch file I now have for building testgl:

 cd \dmd\d\testgl
 \dmd\bin\dmd testgl.d winbase.d wingdi.d winuser.d gdi32.lib user32.lib
 kernel32.lib opengl32.lib -I\dmd\src\phobos

 It no longer uses SC or shell scripts.  This is actually quite nice

 thanks for enabling this.

You're welcome. I'm also working on fixing the .ini files so you won't need environment variables anymore.
Jun 02 2002