Jump to content
Sign in to follow this  
guzewski

Compiler Option -d (how To Define A Value)

Recommended Posts

I'm trying to define a value in my program, using the compiler command line option -d.

 

It seems that this option does not behave like the gcc -D option, where you can supply a value with the definition (e.g. -Dfoo=bar will have the effect of #define foo bar in the source code)

 

With the SourceBoost C compiler, anything I put after the -d option has a value of 1. I have tried stuff like -d foo=bar but foo always has a value of 1.

 

Is there some way to make this option do what I need, or perhaps there is another way?

 

regards,

-mark guzewski

Share this post


Link to post
Share on other sites
I'm trying to define a value in my program, using the compiler command line option -d.

 

It seems that this option does not behave like the gcc -D option, where you can supply a value with the definition (e.g. -Dfoo=bar will have the effect of #define foo bar in the source code)

 

With the SourceBoost C compiler, anything I put after the -d option has a value of 1. I have tried stuff like -d foo=bar but foo always has a value of 1.

 

Is there some way to make this option do what I need, or perhaps there is another way?

 

regards,

-mark guzewski

 

I don't know if you're still looking for an answer to this, but you can define your value with a 1, and then use #ifdef in the code to set a global variable accordingly, depending upon what you've defined with the -d option.

Share this post


Link to post
Share on other sites

This is a compiler bug. Even the preprocessor does allow setting define values in command line compiler does not handle this. Will be fixed in v7.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...