Q_DECL_EXPORT keyword meaning

后端 未结 2 1902
故里飘歌
故里飘歌 2021-02-18 21:25

Q_DECL_EXPORT int main(int argc, char **argv)

What does this Q_DECL_EXPORT before int main(...) means?

2条回答
  •  难免孤独
    2021-02-18 22:08

    Its not a keyword, its a macro to encapsulate the different compiler specific keywords to declare a function as being exported.

    See also Q_DECL_EXPORT and Creating Shared Libraries.

    It is usually used with libraries to define those functions which need to be exported from the library, in order to be imported ("used") by other libraries or by executables.

    I have not seen this with a main function so far, but that could be a blackberry specific thing. On the other hand, this tutorial does not use the macro with the main() function either, so it can probably be removed.

提交回复
热议问题