Skip to content
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

Fix linking error by explicitly instantiating a function template #36555

Merged
merged 1 commit into from
Dec 30, 2019

Conversation

Qrox
Copy link
Contributor

@Qrox Qrox commented Dec 30, 2019

Summary

SUMMARY: None

Purpose of change

advanced_inv_pane.cpp uses the function template advanced_inv_area::i_stacked, which is declared in advanced_inv_area.h, but defined in advanced_inv_area.cpp. This somehow causes linking to fail with MinGW-w64 on Windows, even though the function template should have been instantiated in advanced_inv_area.cpp, where it is also used.

Describe the solution

Explicitly instantiate the function template in advanced_inv_pane.cpp.

Testing

Link succeeded after the fix.

@Qrox
Copy link
Contributor Author

Qrox commented Dec 30, 2019

To add to the oddity, apparently the failure only happens with the Release configuration of CMake build.

@ZhilkinSerg ZhilkinSerg added Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system labels Dec 30, 2019
@ZhilkinSerg ZhilkinSerg merged commit 0b45fa8 into CleverRaven:master Dec 30, 2019
@Qrox Qrox deleted the template-instantiation branch December 31, 2019 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments OS: Windows Issues related to Windows operating system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants