English 中文(简体)
C++ 避免图书馆连接
原标题:C++ Avoiding library linking

目前,我已经设置了一套++,如以下。

class FlowController
{
   public:
    //...
   private:
       cntrl::OneWayValve _intake;
}

如你能用一台芯片看到一米: 我的班子里有一个WayValve。 阀门在另一个图书馆居住,该图书馆在汇编时间上连接起来。 The cntrl:OneWayValve has a cntrl: 在执行过程中的价值就是如此。

class OneWayValve
{
   public:
    //...
   private:
       cntrl::Valve _valve;
}

和前线: 由于你不得不向前一位开发商提出询问,门槛值居住在不同的图书馆。

如今,我汇编了与IWayValve图书馆和护堤连接的IWayValve图书馆所需的Im级流动主计长: 仓库图书馆也是如此。

My question: Is it possible to only link with the cntrl::OneWayValve library at compile time?

Forward declaration?
Static libraries (really don t want to do this tho)?
Another alternative?

基本上不希望知道它使用一台芯片: 内部阀门是我的生意。

说明:顾问办公室的道歉是九。

Cheers, Ben

最佳回答

你可以做的是: 使用一个叫做“图书馆”的工具,向您的“IWayValve”图书馆提供图书馆。 我不知道你在使用哪一千米的非洲顾问/顾问来描述它如何使用视觉演播室,因为这个系统是我实际使用的唯一系统(除非你想计算CP/M+LB-80:-)

如果你为“你一WayalVve”项目提供“工具”,并选择“Coniguration ́brarian”-additional Dependencies,你可以在“额外附属条件”的环境下提及您的“传统图书馆”。 这将造成1WayValve。 平衡,以包含从阀门到底的任何物体。

问题回答

不幸的是,对于你来说,<代码>一个WayValve就设计得很好。 不仅你需要与这两个图书馆连接,而且如果<代码>Valve的班级变更,你还必须对<一个WayValve的图书馆和你的代码进行改装。

你们可以通过把其头盔中的所有“一千瓦”和“阀门”方法定义为一线。 然后,你不需要与图书馆联系。

但是,如果是这样设计的,那么与这一图书馆的联系会产生什么问题? 将图书馆动态连接起来毫无错误。





相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签