Closed Donaldpherman closed 5 years ago
This is by design. As the name suggests "Trial & Error Include Removal" only tries removing an include and tries if the file in question still compiles.
Judging from your error, unlike what you describe your header seems to declare the function with __declspec(dllexport)
whereas your duplicated predeclaration (why?) does not, leading the file to compile fine but no longer exporting the symbol
I upgraded my OP a bit. I don't have a duplicate declaration.
In your previous description you had, but the important problem is of course still the same: There is nothing preventing aName.h from being removed but then you loose the dllexport specifier since you didn't repeat that for the function defintion
I have the declaration of a function in the global namespace in a header file "aName". The file with definition include the #include "aName.h" header and builds. Another project call the function and builds OK.
When I run Trial & Error Include Removal on differentName.cpp it removed the #include "aName.h" and give me the message Successfully removed #include: 'aName.h'
Removed 1 #include directives from 'differentName.cpp'
When I try to build the solution I get a linker error. error LNK2019: unresolved external symbol "declspec(dllimport) void cdecl func