0

I am using c++builder, I have spent huge time to enable option to finally visualize the result of precompiled files without success, on vc++(just for good illustration) just going to project options->C/C++->Preprocessor->Process to file.

#define PROP(type, var)                                                 \
    protected:                                                      \
        type m_##var;                                               \
    public:                                                         \
    __declspec(property(get = get##var, put = set##var)) type var;  \
    type get##var() const { return m_##var;}                             \
    void set##var(type v) { m_##var = v; this->SetPropertyValue<type>(L"##var",m_##var, v); }

any ideas?

OverB
  • 55
  • 7
  • why do you want that ? There is no information in a precompiled header that isn't in the comprising header-files. It's just a compilation trick to speed up common includes. Don't waste anymore of your (valuable) time on it. – engf-010 Sep 23 '22 at 14:28
  • @engf-010 I am just created some macro, and i don't know why isn't work, best why is to visualize the result. – OverB Sep 23 '22 at 15:10
  • Make absolutely certain that the macro works without precompiled headers first. If you have a bug that in a precompiled header, it probably isn't because of precompiling. More likely it is merely made visible as a side effect of precompiling. – user4581301 Sep 23 '22 at 15:14
  • And there is always the great question of, "Is a macro more suitable here than an inlined function?" – user4581301 Sep 23 '22 at 15:16
  • Nothing in the OP's post mentions **precompiled header**. That is a very different thing from just looking at the **preprocessor's output**, which BTW C++Builder does support via its [command-line preprocessor](https://docwiki.embarcadero.com/RADStudio/en/CPP32.EXE,_the_C_Compiler_Preprocessor), ie: [CPP32 as a Macro Preprocessor](https://docwiki.embarcadero.com/RADStudio/en/CPP32.EXE,_the_C_Compiler_Preprocessor#CPP32_as_a_Macro_Preprocessor) – Remy Lebeau Sep 23 '22 at 18:45
  • @Remy Lebeau: I understand what you're saying ,but OP has a problem with 'visualizing precompiled files' ,which (IMO) automatically rules out preprocessed output since those files are plain text files. – engf-010 Sep 23 '22 at 20:41
  • Hi @OverB, I think it would be helpful if you described how you created the *.i files methioned in the question's title, which you want to visualize. (You have already said why you want to do that in a previous comment, and I can understand the motivation. I think I can help with the macro definition, but I do not know C++Builder well enough to understand how to create *.i files.) – T. Herzke Oct 09 '22 at 17:59
  • Hi@T. Herzke, sometimes we need to visualize the result of pre-processing, i have to say i am just using c++ for less then 1 year, without any finished project. and i have to learn and try and observe the result. – OverB Oct 09 '22 at 18:28
  • Hi @OverB, well could you please just give the command line how to create the *.i file, or alternatively give step-by-step instructions how to create the *.i files mentioned in the title of your question, please? – T. Herzke Oct 09 '22 at 19:22
  • @T. Herzke, that what i am asking for!!!; i said 'without success' – OverB Oct 09 '22 at 20:34
  • You have specifically mentioned "precompiled file (`*.i`) on c++builder" in your question. Your question is about how to "visualize" these existing "`*.i`" files. Please explain how you have created these `*.i` files, exactly. After that, I'll try to help with any preprocessor problems. – T. Herzke Oct 09 '22 at 23:01
  • yes, there is something called *.i, similar to vc++, but in the documentation, and i can't found any way to activate. – OverB Oct 10 '22 at 14:29

0 Answers0