-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline functions problem with AFX_EXT_CLASS #17
Comments
I guess inline functions should not go into the DLL, but stay in the header file, just like they do not end up in the compiled LIB file. |
Inline function from a dll get expanded into the application code and could also cause version conflicts, see https://docs.microsoft.com/en-us/cpp/build/exporting-and-importing-using-afx-ext-class?view=vs-2019 |
Of course all the functions could be moved from the header to the source file and not inlined. They are not that way simply because I did not mean to have a DLL initially. |
Speaking about inlining.
|
You can create a little example and use dumpbin to see that a function is also exported from the dll.
|
My previous message was too short and thus unclear. Definition in |
The Idea is to use AFX_EXT_CLASS to export the whole classs because you must be able to derive from them and we need the macros DYNAMIC_DECLARE_... so all class member functions are exported too. |
In non-dll builds |
I guess I don't get it ... how can the compiler inline functions that are defined in another compilation unit? Even if I use the inline keyword, shouldn't the function definition be in the header file? |
C++ Standards tells that a function defined inside a class definition is inline.
|
I want to create a dynamic Resizable library .dll instead of the static Resizable library .lib and want to use AFX_EXT_CLASS to make the task simple, but get error LNK2005 ... already defined in ... / fatal error LNK1169: one or more multiply defined symbols found.
Is it possible to move some inline functions e.g.
CResizableDialog::GetResizableWnd and all CResizableLayout::AddAnchor / AddAllOtherAnchors / RemoveAnchor
from the header to the cpp file?
The text was updated successfully, but these errors were encountered: