You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a project using multiple compilation units, which are later linked together, linking will fail if we define any non-inline freestanding functions, because the name of the function will be present in every compilation unit that includes the opencmw headers.
Up to now we solved this by making all these functions inline, which will allow multiple definitions to exist by mangling their names (or actually inline them).
Since this actually duplicates the methods in the executable this is probably not the smartest way to do this.
@giucam also stumbled upon this and proposed a different solution which adds a precompiler definition to decide whether the function should be declared or defined in this compilation unit, see #264. Since this is a bit non-intuitive from a user perspective we setteled to first change them to inline (#266) which is in line what we do elsewhere in the project and then discuss what to do next.
The text was updated successfully, but these errors were encountered:
If a project using multiple compilation units, which are later linked together, linking will fail if we define any non-inline freestanding functions, because the name of the function will be present in every compilation unit that includes the opencmw headers.
Up to now we solved this by making all these functions inline, which will allow multiple definitions to exist by mangling their names (or actually inline them).
Since this actually duplicates the methods in the executable this is probably not the smartest way to do this.
@giucam also stumbled upon this and proposed a different solution which adds a precompiler definition to decide whether the function should be declared or defined in this compilation unit, see #264. Since this is a bit non-intuitive from a user perspective we setteled to first change them to inline (#266) which is in line what we do elsewhere in the project and then discuss what to do next.
The text was updated successfully, but these errors were encountered: