www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Stumped

reply pragma <pragma_member pathlink.com> writes:
I have an  rsp file that I'm using to build a sizable D application (DSP core to
be precise).  When compiling I get this error:

"kind ASM declaration must be at module level"

There's no mention of this on the wiki, and searching the digitalmars site via
google turns up nothing.

I'm using "private import" all over the place, and I've already checked for
inclusion cycles.  Contrary to what the message might imply, I'm not using any
"asm{}" statements in my code.

Anyway, can anyone confirm what exactly this error message means?

- EricAnderton at yahoo
Mar 17 2005
parent reply pragma <pragma_member pathlink.com> writes:
In article <d1dj4p$2jh8$1 digitaldaemon.com>, pragma says...
I have an  rsp file that I'm using to build a sizable D application (DSP core to
be precise).  When compiling I get this error:

"kind ASM declaration must be at module level"

There's no mention of this on the wiki, and searching the digitalmars site via
google turns up nothing.

I'm using "private import" all over the place, and I've already checked for
inclusion cycles.  Contrary to what the message might imply, I'm not using any
"asm{}" statements in my code.

Anyway, can anyone confirm what exactly this error message means?

- EricAnderton at yahoo
Nevermind. This is what happens when you don't document how to build your application, only to put it down for a few months. DSP has a dependency upon the concurrent lib from dsource. My version may be a touch dated. "concurrent\locks\queuedsync.d" Line 1786:
     version = ASM;
Commenting out the offending line did the trick. Concurrent is too big for my purposes anyway, so I think I'll go with Ben's lib instead. ;) - EricAnderton at yahoo
Mar 17 2005
parent reply Derek Parnell <derek psych.ward> writes:
On Fri, 18 Mar 2005 04:32:32 +0000 (UTC), pragma wrote:

 In article <d1dj4p$2jh8$1 digitaldaemon.com>, pragma says...
I have an  rsp file that I'm using to build a sizable D application (DSP core to
be precise).  When compiling I get this error:

"kind ASM declaration must be at module level"

There's no mention of this on the wiki, and searching the digitalmars site via
google turns up nothing.

I'm using "private import" all over the place, and I've already checked for
inclusion cycles.  Contrary to what the message might imply, I'm not using any
"asm{}" statements in my code.

Anyway, can anyone confirm what exactly this error message means?

- EricAnderton at yahoo
Nevermind. This is what happens when you don't document how to build your application, only to put it down for a few months. DSP has a dependency upon the concurrent lib from dsource. My version may be a touch dated. "concurrent\locks\queuedsync.d" Line 1786:
     version = ASM;
Commenting out the offending line did the trick. Concurrent is too big for my purposes anyway, so I think I'll go with Ben's lib instead. ;)
It would have been nice if DMD had have displayed the file name and line number of the offending statement ;-) Curiously, you get a different message depending on *where* you place the version statement. Inside a class or struct definition you get the (weird) message you reported, but if inside a free function you get ... test.d(4): (condition) expected after version test.d(4): found '=' instead of statement which would have been trivial to find. -- Derek Melbourne, Australia 18/03/2005 3:38:04 PM
Mar 17 2005
parent pragma <pragma_member pathlink.com> writes:
In article <d7wexkgmo4c5.1xinwyect28ui$.dlg 40tude.net>, Derek Parnell says...
On Fri, 18 Mar 2005 04:32:32 +0000 (UTC), pragma wrote:
 Nevermind.  
 
 This is what happens when you don't document how to build your application,
only
 to put it down for a few months.
 
 DSP has a dependency upon the concurrent lib from dsource.  My version may be a
 touch dated.  
 
 "concurrent\locks\queuedsync.d" Line 1786:
     version = ASM;
Commenting out the offending line did the trick. Concurrent is too big for my purposes anyway, so I think I'll go with Ben's lib instead. ;)
It would have been nice if DMD had have displayed the file name and line number of the offending statement ;-)
I'ts definately a bug I'd say. I'll post it to d.bugs later. It's worth mentioning that I used message pragmas (pragma(msg,"hello");) to track down where, during compilation, message was being generated.
 pragma(msg,"thisfile.startinclude");
 private include locks.queuedsync;
 pragma(msg,"thisfile.endinclude");
which gives the output:
 thisfile.startinclude
 kind ASM declaration must be at module level
 thisfile.endinclude
. which helps you narrow down which include is responsible. I had to go about 5 includes deep in my code before I found it. :)
Curiously, you get a different message depending on *where* you place the
version statement. Inside a class or struct definition you get the (weird)
message you reported, but if inside a free function you get ...

  test.d(4): (condition) expected after version
  test.d(4): found '=' instead of statement

which would have been trivial to find.
And those are still *terrible* error messages, as they have nothing to do with what went wrong (well, except the line number). That's certainly one for the bugs list. - EricAnderton at yahoo
Mar 18 2005