开发者

Where should I put my DECLSPEC for a namespace?

given the following namespace, where do I put my declspec (for dll export) i I want all the methods in said namespace to be exported into the DLL?

namespace AguiText {
    void drawTextArea(AguiGraphicsManager *g, const AguiFont &font,const AguiRectangle &area,
        const AguiColor &color, const std::vector<std::string> &lines,
        AguiHorizontalAlignmentEnum horizontalAlignment, AguiVerticalAlignmentEnum verticalAlignment);

    void divideText(std::vector<std::string> &words, 
        const std::string &text,const AguiFont &font, int maxWidth = -1);
    void makeTextLines(const AguiFont &font,const std::vector<std::string> &words,
        std::vector<std::string> &lineWords, int maxW开发者_Go百科idth );
    void pointInTextArea(const AguiFont &font, 
        const AguiRectangle &area, const AguiPoint &point, 
        const std::vector<std::string> &lines, AguiRectangle &retRect,
        int &retIndex, AguiHorizontalAlignmentEnum horizontalAlignment, AguiVerticalAlignmentEnum verticalAlignment);

}

Thanks


There is no need to export a namespace. From a compiled code perspective, namespaces are meaningless. You cannot reference them in code, they just define scope.

Namespaces wind up becoming part of class/function names during the name mangling process. They are not separate entities once a source file is compiled.

If you want to export the contents of a namespace, you need to export those entities, not the namespace itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜