cp->CompilerOptions = "/optimize"; and other questions

cp->CompilerOptions = "/optimize";

statement lists only one parameter /optimize. What if I need to use more than one Do I have to list them all in one string or I can use a sequence of statements:

cp->CompilerOptions = "/optimize";
cp->CompilerOptions = "/Z7";
cp->CompilerOptions = "/Gd";
or for this matter:
cp->CompilerOptions = "/Od";

Also can I use this statement:
cp->CompilerOptions = "/Ox"; versus "/optimize"

It is unclear from MSDN documentation which way one should take to assign more than one option. Are the statements above cumulative

A related question will concern

cp->ReferencedAssemblies->Add( "System.dll" );

Can I put a few dll files into one string and how or use a few ->add statements The semantics of the ->add() statement seems to suggest that multiple statements are OK.

Thanks.






Answer this question

cp->CompilerOptions = "/optimize"; and other questions

  • Ravi Varma

    Replies in points:
     1) If you don't get replies on the .net development forums, please let me know and I will contact the owner straight ahead.

    2) Concerning the example:
    ICodeCompiler^ compiler = provider->CreateCompiler();
        CompilerParameters^ cp = gcnew CompilerParameters;
        if ( ( !cp) || ( !compiler) )
        {
           return false;
        }

    Of course, I didn't know if it is deprecated and that confirms my point that the question wasn't suitable in these forums since myself and others on the VC++ forums are not familiar or experienced with using such classes. You basically confirmed what I was trying to explain but through a great example. That is the exact reason why we created more than one forum.

    3) With regard to the post of Christian, if you look carefully at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=150182&SiteID=1, you will see that the title in his single post (and not the thread title) was: Visual Basic setting compiler options programatically. The user posted first under Visual basic so the threads were merged in the C++ forum which is the correct forum for it. So Christian did the corretc thing. DeepaHadimani actually came back original post and edited it and added the midl comment to explain more and hence I was able to explain more and point to the correct owners concerning midl (midl wasn't there in the original post by DeepaHadimani).

    I am glad you were able to make progress and thanks for raising such issues.

    Thanks,
     Ayman Shoukry
     Program Manager
     VC++ Team





  • gpetrosh

    The help of the related topic states:

    MSDN2 Library
     > .NET Development > .NET Framework SDK > Class Library Reference > System.Web.Configuration > Compiler Class > Compiler Properties > CompilerOptions Property

    I don't believe the C++ owns the framework SDK and that is why I suggested the other forum.

    Any ways, As I mentioned earlier, I am open for suggestions.

    Have a great night!

    Thanks,
    Ayman Shoukry
    Program Manager
    VC++ Team

  • NormanL

    Hi Alex,
    Your mesages have either been deleted (email gets sent to you with the reason of the deletion) since they are off topic to this forum or moved to other suitable forums. I have seen folks who mentioned that such emails doesn't actually reach them. I will contact the forum owners for such an issue.

    Most of the questions you posted are really not related or owned by the VC team and hence being forwarded to appropriate forums

    For example: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=152605&SiteID=1

    More than one person have posted to you already telling you that this is not the appropriate forums for some of your other questions but you still wanted to use them. This confuses other users specially when searching for answers and hence moderators try to minimize the noise as much as possbile.

    If you look at the help of the classes you are using (e.g.: http://msdn2.microsoft.com/en-us/library/system.web.configuration.compiler.compileroptions.aspx) you will see that they are part of the general .net development. That is why there is the .net development forum for such issues.

    I personally helped you at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=150669&SiteID=1 and took me sometime to dig into the issue while I am sure folks on the .net developement forums would have answered in a lot less time than myself.

    Please let me know if anything is unclear or if this doesn't make sense.

    I will advise the other moderators to follow a better way next time by posting that the topic is not suitable for the forums and lock the thread for a certain period of time to make sure original posters get to see the message. Then we will probably be deleting it to avoid search noise.

    Please let me know if you have better suggestions and I will be more than happy to work them out with you or propagate them to the owners.

    Note: Really the red messages won't get you any where except aggrevating the situation or annoying some of the folks that might be trying to help you.  Also, I have noticed that in lots of your posts (e.g. your second post at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=152605&SiteID=1) you are using inappropriate words and hence I am sure some moderators will delete such posts. Nevertheless, I understand your frustration and open for any better suggestions.

    Thanks,
      Ayman Shoukry
      Program Manager
      VC++ Team

  • genius15

    It is a footnote of a general nature.

    I have noticed that recently two of my threads have been purged from the forum because the C++ team apparently disliked the unflattering remarks I've made about the level and quality of support.

    I want to put them on notice that I will not tolerate this practice in the future. From now on I will take a screen capture of all messages I've posted as well as all responses. If it is necessary I will take the issue to the highest level of Microsoft to punish those responsible. So be aware.

    You may purge this particular message after reading it if you want.

    Thanks.


  • gruflee

    Hi Ayman,

    I will try the .NET Development forum. What turned me off when I looked up to them was the small number of posts and tepid activity. Again, I should stress it appeared to me this way. I will give it another go.

    You mentioned "inappropriate language" in your previous post but I do not think saying "support in this forum is rotten" is inappropriate language. I will give you a few examples but before that I want to say that in my opinion you should be more interested in creating productive and receptive environment in this forum than any of the users. I can crack any issue myself although it might take longer but some people may be turned off by a formalistic and should I say heartless approach some of you practice. You in particular and Microsoft in general have a vested interest in this community to grow. It has even been a topic of articles in Financial Times and other business publications.

    Let's take CompileCode routine which you helped me to compile in one of the previous threads. It did compile but you either did not notice or did not bother mentioning that the code was using a depricated method and would crash at runtine. Here it is:

    ICodeCompiler^ compiler = provider->CreateCompiler();
        CompilerParameters^ cp = gcnew CompilerParameters;
        if ( ( !cp) || ( !compiler) )
        {
           return false;
        }
    You are a professional C++ developer; you should know which classes have become obsolete and try to steer people out of trouble. You did not. It cost me at least two days. In the end I figured out what was going on, reworked the code and now it runs well but not before I posted another message and got a totally uninformative reply at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=152605&SiteID=1 by John Lewicki:
    "All the methods from the ICodeCompiler interface have been moved to CodeDomProvider itself.  So you dont need to call CreateCompiler on a CodeDomProvider instance.  You just use the CodeDomProvider instance itself. FYI: this is described in the MSDN docs for ICodeCompiler"

    Of course, everything is described somewhere, perhaps even in MSDN, and I reread their documentation at least three times before posting here. The question is how described and in what language. Many explanations over there are too brief and use high level of professional slang when notions are defined through other equally abstract notions. I am just starting to climb out of the very beginner's state in C++ and for me it was too abstract to understand. I cracked it finally two days later but I wish people were more condescending if I may.

    Here is an example of MSDN obscurity:
    "CodeDomProvider.CompileAssemblyFromDom Method  
    Compiles an assembly based on the System.CodeDom trees contained in the specified array of CodeCompileUnit objects, using the specified compiler settings
    ."  In my opinion it is a totally circuitous definition.

    I do not know how other people feel about this forum: it is their problem but I've noticed some replies that provoked my ire. Take this thread for instance:
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=150182&SiteID=1
    DeepaHadimani is asking: "I want to know how to set Visual C++ compiler options programatically." and Christian Graus - MVP, C++ answers: "So why ask in the C++ forum "

    I would have fired the fellow just for a single answer like this. Where would you go with a question like DeepaHadimani's. If you have a meaningful answer, EXPLAIN. Do not give people a sadistic run around. It is interesting DeepaHadimani never came back to say anything but other people asked questions,
    Vikas Taneja, for instance. In that particular thread you actually tried to explain the issue in more detail in the end but I liked your noncommittal: "some of the above options might work." It is something!

    Well, at the end of the day I am happy with my progress so far although it's been a rough ride. I understand that it is a very difficult subject and requires considerable penetration into concepts but my experience could have been made easier if better help were available. I also noticed that you react to criticizm and perhaps you will take some notes. It will be good.

    Many thanks.
     



  • Seaman Jiang

    Ayman thanks,

    I will study what you've said tomorrow. Maybe I will admit that you are right, I do not know. In the past I've checked with the forum you've directed me (.NET Development) and found it not related to my questions at all AT THIS STAGE. When it comes to doing sockets and connections, I hope it will be in a week or two, that will be another issue.

    Today I finally realized that overall I am making significant progress albeit slower than I hoped.

    I will revisit the issue tomorrow.

    Thanks.



  • cp->CompilerOptions = "/optimize"; and other questions