www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - How to Declare a new pragma ?

reply "FrankLike" <1150015857 qq.com> writes:
I want to get that :  pragma(link, "SUBSYSTEM WINDOWS,4.0");

But get error:pragma link unrecognized pragma(link)?
How can I to do?

Thank you.
Dec 21 2014
parent reply ketmar via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
On Sun, 21 Dec 2014 16:42:45 +0000
FrankLike via Digitalmars-d-learn <digitalmars-d-learn puremagic.com>
wrote:

 I want to get that :  pragma(link, "SUBSYSTEM WINDOWS,4.0");
=20
 But get error:pragma link unrecognized pragma(link)?
 How can I to do?
=20
 Thank you.
you have to patch the compiler to recognize your new pragma and do something with it. you can't do this from your D code.
Dec 21 2014
parent reply "FrankLike" <1150015857 qq.com> writes:
On Sunday, 21 December 2014 at 17:04:45 UTC, ketmar via 
Digitalmars-d-learn wrote:
 On Sun, 21 Dec 2014 16:42:45 +0000
 FrankLike via Digitalmars-d-learn 
 <digitalmars-d-learn puremagic.com>
 wrote:

 I want to get that :  pragma(link, "SUBSYSTEM WINDOWS,4.0");
 
 But get error:pragma link unrecognized pragma(link)?
 How can I to do?
 
 Thank you.
you have to patch the compiler to recognize your new pragma and do something with it. you can't do this from your D code.
Now ,x64 mainform always have the console window,and the entry is main. could you do it? Thank you.
Dec 21 2014
parent reply Mike Parker <aldacron gmail.com> writes:
On 12/22/2014 9:21 AM, FrankLike wrote:

 Now ,x64  mainform  always  have  the  console  window,and  the entry
 is main.
 could  you  do  it?
 Thank  you.
Since 64-bit DMD uses the Microsoft toolchain, you need to pass a parameter on the command line to the MS linker. Linker parameters are passed with -L <parameter> See [1] for information about the /SUBSYSTEM option, which is what you want in this case. Probably something like this: -L/SUBSYSTEM:WINDOWS,5.02 [1] http://msdn.microsoft.com/en-us/library/fcc1zstk.aspx
Dec 21 2014
parent "FrankLike" <1150015857 qq.com> writes:
On Monday, 22 December 2014 at 00:55:08 UTC, Mike Parker wrote:
 On 12/22/2014 9:21 AM, FrankLike wrote:

 Now ,x64  mainform  always  have  the  console  window,and  
 the entry
 is main.
 could  you  do  it?
 Thank  you.
Since 64-bit DMD uses the Microsoft toolchain, you need to pass a parameter on the command line to the MS linker. Linker parameters are passed with -L <parameter> See [1] for information about the /SUBSYSTEM option, which is what you want in this case. Probably something like this: -L/SUBSYSTEM:WINDOWS,5.02 [1] http://msdn.microsoft.com/en-us/library/fcc1zstk.aspx
Thank you. -L/ENTRY:mainCRTStartup it's ok
Dec 22 2014