Author Topic: Compiling D 2.0  (Read 11438 times)

Maxpm

  • Guest
Compiling D 2.0
« on: March 31, 2011, 11:35:08 pm »
It's relatively simple to set up Code::Blocks to compile D 1.0 programs, but I'm having a lot of trouble with D 2.0.

I went through all the paths in the compiler settings for the Digital Mars D compiler, changing the paths from "dmd" to "dmd2."  However, when I try to compile a simple "Hello, world!" program I get an error message saying the object file could not be read.  (It's not particularly helpful.)

Here's the full error:
Code
Compiling: hello.d
object.d: Error: module object is in file 'object.d' which cannot be read
import path[0] = C:\Compilers\dmd2\src\phobos
import path[1] = C:\Compilers\dmd2\bin\..\..\src\phobos
import path[2] = C:\Compilers\dmd2\bin\..\..\src\druntime\import

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Compiling D 2.0
« Reply #1 on: March 31, 2011, 11:59:03 pm »
Turn on Full Compiler Logging and hopefully the problem will be clear to an D programmer; not sure this site has that many D programmers on it.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Note: You might try a nightly build if not already using one.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Maxpm

  • Guest
Re: Compiling D 2.0
« Reply #2 on: April 01, 2011, 01:04:31 am »
I downloaded the latest nightly build and enabled full compiler logging.

Code
dmd.exe  -g -debug    -IC:\Compilers\dmd2\src\phobos  -c hello.d -ofobj\Debug\hello.obj
object.d: Error: module object is in file 'object.d' which cannot be read
import path[0] = C:\Compilers\dmd2\src\phobos
import path[1] = C:\Compilers\dmd2\bin\..\..\src\phobos
import path[2] = C:\Compilers\dmd2\bin\..\..\src\druntime\import

This is, of course, after a full cleaning.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Compiling D 2.0
« Reply #3 on: April 01, 2011, 01:13:12 am »
Something is broken in your compiler.
Try to compile from the command line and if it works it something in C::B, if it doesn't it is something with your setup...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Maxpm

  • Guest
Re: Compiling D 2.0
« Reply #4 on: April 01, 2011, 02:43:43 am »
Something is broken in your compiler.
Try to compile from the command line and if it works it something in C::B, if it doesn't it is something with your setup...

Attempting to compile from the command line produces the exact same error.

Maxpm

  • Guest
Re: Compiling D 2.0
« Reply #5 on: April 01, 2011, 02:58:45 am »
Attempting to compile from the command line produces the exact same error.

(I apologize if this is a double-post; it seems my messages keep disappearing.)

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Compiling D 2.0
« Reply #6 on: April 02, 2011, 03:39:32 am »
Hi, Maxpm,
I would like to describe simple steps for DMD compiling in CodeBlocks.

For Windows:
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Digital_Mars_D_Compiler_for_Windows
« Last Edit: April 04, 2011, 03:32:56 pm by wangdong1226 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiling D 2.0
« Reply #7 on: April 02, 2011, 09:14:53 am »
2). Settings.
You should add correct DMD pathes into Codeblocks' "default.conf" configuration file.
Here is the section about 'dmd' settings in my "default.conf" file for your reference.
[...]
Please don't edit this file manually. You can setup these path's in the compiler setup just fine. If you alter the configuration file manually you can easily screw Code::Blocks settings completely.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
« Last Edit: April 04, 2011, 03:32:10 pm by wangdong1226 »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiling D 2.0
« Reply #9 on: April 02, 2011, 11:17:36 pm »
...could you add this to the WiKi and point to it from this page:
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Misc._Custom_Compilers

...so that it doesn't get lost.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Maxpm

  • Guest
Re: Compiling D 2.0
« Reply #10 on: April 03, 2011, 01:32:02 am »
Thank you all for your help.  I can now compile and run D programs without any problems.  The syntax highlighting works as well, but code completion seems to be glitched.  No matter which keyword I (partially) type, I get the message "The Parser is still parsing files."  I'm assuming D code completion simply isn't supported yet in Code::Blocks, but is there a way to disable the feature just for D so I don't get this annoying message?

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Compiling D 2.0
« Reply #11 on: April 03, 2011, 09:28:22 am »
Thank you all for your help.  I can now compile and run D programs without any problems.  The syntax highlighting works as well, but code completion seems to be glitched.  No matter which keyword I (partially) type, I get the message "The Parser is still parsing files."  I'm assuming D code completion simply isn't supported yet in Code::Blocks, but is there a way to disable the feature just for D so I don't get this annoying message?

Yes, I'm meeting the same problem (I mean "The Parser is still parsing files.", but it does nothing), I think, in future, when CodeBlocks team improved the Code Completion part of CodeBlocks, then things will be improved.

I've submitted several times asking for improving D Language support in CodeBlocks, but unfortunately there is no one in CodeBlocks team using D Language or familiar with this language, so I think now things won't take on a new look. (maybe someone will be kindly to modify the Code Completion, I don't know)

I studied the C Language, and I'm not familiar with the C++, so I can do nothing on providing patches to CodeBlocks issue. But I made a personal decision that I will start to learn C++, after that I'll try to submit the improving patches to CodeBlocks core team to improve the support of D Language.
(but it will takes a long time when I familiar with the C++   :D)


Best regards.
David.
« Last Edit: April 03, 2011, 09:33:20 am by wangdong1226 »

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: Compiling D 2.0
« Reply #12 on: April 03, 2011, 09:32:20 am »
...could you add this to the WiKi and point to it from this page:
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Misc._Custom_Compilers

...so that it doesn't get lost.

OK, I'll try to add the description to the WiKi so that more people will see that and it won't get lost.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Compiling D 2.0
« Reply #13 on: April 03, 2011, 09:42:20 am »
but is there a way to disable the feature just for D so I don't get this annoying message?
Sure, just disable the CC plugin. It's useless for you anyways.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline wangdong1226

  • Multiple posting newcomer
  • *
  • Posts: 46
« Last Edit: April 04, 2011, 03:39:35 pm by wangdong1226 »