# Cannot include ShlObj\_core not package

**URL:** <https://forums.unrealengine.com/t/cannot-include-shlobj_core-not-package/457976>\
**Category:** Plugins\
**Tags:** header, unreal-engine, Packaging, Plugins, UE4, question, CPP\
**Created:** [November 3, 2019, 7:02pm UTC](https://forums.unrealengine.com/t/cannot-include-shlobj_core-not-package/457976 "2019-11-03T19:02:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ddc0261e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ddc0261e](https://forums.unrealengine.com/u/anonymous_user_ddc0261e)\
**Post date:** [November 3, 2019, 7:02pm UTC](https://forums.unrealengine.com/t/cannot-include-shlobj_core-not-package/457976/1 "2019-11-03T19:02:28Z")

</div>

Good afternoon,

I got a problem trying to package a plugin with the header : “ShlObj\_core.h” who let me read on AppData folder on Windows.

I got this problem first on a custom Blupint Plugin :

1. UATHelper: Package Plugin Task (Windows): In file included from XXX\Test\_Plugin\HostProject\Plugins\Test\_Plugin\Intermediate\Build\HTML5\UE4\Development\Test\_Plugin\Module.Test\_Plugin.cpp:3:
2. UATHelper: Package Plugin Task (Windows): XXX\Test\_Plugin\HostProject\Plugins\Test\_Plugin\Source\Test\_Plugin\Private\Test\_PluginBPLibrary.cpp(33,10): fatal error: ‘ShlObj\_core.h’ file not found
3. UATHelper: Package Plugin Task (Windows): #include “ShlObj\_core.h”
4. UATHelper: Package Plugin Task (Windows): ^ ~~~~~~~~~~~~~~
5. UATHelper: Package Plugin Task (Windows): 1 error generated.
6. UATHelper: Package Plugin Task (Windows): ERROR:root:compiler frontend failed to generate LLVM bitcode, halting
7. UATHelper: Package Plugin Task (Windows): Total build time: 16.19 seconds (Parallel executor: 3.77 seconds)
8. UATHelper: Package Plugin Task (Windows): Took 16.4941091s to run UnrealBuildTool.exe, ExitCode=5
9. UATHelper: Package Plugin Task (Windows): ERROR: UnrealBuildTool failed. See log for more details. (C:\Program Files\Epic Games\UE\_4.21\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Game-HTML5-Development.txt)
10. UATHelper: Package Plugin Task (Windows): (see C:\Program Files\Epic Games\UE\_4.21\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
11. UATHelper: Package Plugin Task (Windows): AutomationTool exiting with ExitCode=5 (5)
12. UATHelper: Package Plugin Task (Windows): BUILD FAILED

On my second try i try to create a plugin with just “ShlObj\_core.h” with the import lib plugin, and i got this error:

1. UATHelper: Package Plugin Task (Windows): Building 4 actions with 8 processes…
2. UATHelper: Package Plugin Task (Windows): [1/4] PCLaunch.rc
3. UATHelper: Package Plugin Task (Windows): [2/4] TestIncludeLib.cpp
4. UATHelper: Package Plugin Task (Windows): C:\Program Files\Epic Games\UE\_4.21\Engine\Source\Runtime\Core\Public\Core.h(6): warning: Monolithic headers should not be used by this module. Please change it to explicitly include the headers it needs.
5. UATHelper: Package Plugin Task (Windows): C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(603): warning C4005: ‘TEXT’: macro redefinition
6. UATHelper: Package Plugin Task (Windows): C:\Program Files\Epic Games\UE\_4.21\Engine\Source\Runtime\Core\Public\HAL/Platform.h(899): note: see previous definition of ‘TEXT’
7. UATHelper: Package Plugin Task (Windows): C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winioctl.h(10229): error C4668: ‘\_WIN32\_WINNT\_WIN10\_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’
8. UATHelper: Package Plugin Task (Windows): C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winioctl.h(10235): error C4668: ‘\_WIN32\_WINNT\_WIN10\_RS1’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’
9. UATHelper: Package Plugin Task (Windows): C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winioctl.h(10240): error C4668: ‘\_WIN32\_WINNT\_WIN10\_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’  
…
10. UATHelper: Package Plugin Task (Windows): C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winioctl.h(15657): error C4668: ‘\_WIN32\_WINNT\_WIN10\_RS1’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif’
11. UATHelper: Package Plugin Task (Windows): C:\XXX\Test\_ImportLib\TestIncludeLib\TestIncludeLib\HostProject\Plugins\TestIncludeLib\Source\TestIncludeLib\Private\TestIncludeLib.cpp(29): warning C4005: ‘SSF\_SHOWALLOBJECTS’: macro redefinition
12. UATHelper: Package Plugin Task (Windows): C:/Program Files (x86)/Windows Kits/10/Include/10.0.18362.0/um/ShlObj\_core.h(3356): note: see previous definition of ‘SSF\_SHOWALLOBJECTS’
13. UATHelper: Package Plugin Task (Windows): ERROR: UBT ERROR: Failed to produce item: C:\XXX\Test\_ImportLib\TestIncludeLib\TestIncludeLib\HostProject\Plugins\TestIncludeLib\Binaries\Win64\UE4Editor-TestIncludeLib.pdb
14. UATHelper: Package Plugin Task (Windows): (see C:\Program Files\Epic Games\UE\_4.21\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Editor-Win64-Development.txt for full exception trace)
15. UATHelper: Package Plugin Task (Windows): Total build time: 9.64 seconds (Parallel executor: 0.00 seconds)
16. UATHelper: Package Plugin Task (Windows): Took 10.0802356s to run UnrealBuildTool.exe, ExitCode=5
17. UATHelper: Package Plugin Task (Windows): ERROR: UnrealBuildTool failed. See log for more details. (C:\Program Files\Epic Games\UE\_4.21\Engine\Programs\AutomationTool\Saved\Logs\UBT-UE4Editor-Win64-Development.txt)
18. UATHelper: Package Plugin Task (Windows): (see C:\Program Files\Epic Games\UE\_4.21\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
19. UATHelper: Package Plugin Task (Windows): AutomationTool exiting with ExitCode=5 (5)
20. UATHelper: Package Plugin Task (Windows): BUILD FAILED

Here my code :  
#include “ShlObj\_core.h”  
#include  
#include  
//#include  
//#include  
//#include  
//#include  
//#include  
#include  
#include  
using std::string;  
#include  
using std::cout;  
using std::cerr;  
using std::endl;  
#include

#define SSF\_SHOWALLOBJECTS

//Local method : Convert TCHAR to string  
std::string TcharsToString(TCHAR const \* scz)  
{  
#ifdef UNICODE  
std::ostringstream ossA;  
ossA \<\< scz;  
return ossA.str();  
#else  
return scz;  
#endif  
}

void FTestIncludeLibModule::StartupModule()  
{  
//Test lib  
TCHAR szAppData[MAX\_PATH];  
HRESULT hr = SHGetFolderPath(NULL, CSIDL\_APPDATA, NULL, 0, szAppData);

```
cout << "Get Application Data" << endl;
string path = "";
TCHAR szPath[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL,
	CSIDL_APPDATA,
	NULL,
	0,
	szPath)))
{
	path = TcharsToString(szPath);
}

```

}
