# LNK2001 unresolved external symbal "wchar\_t"

**URL:** <https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [May 28, 2024, 1:58am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262 "2024-05-28T01:58:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xanderxavier](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/xanderxavier/32/564710_2.png) [@Xanderxavier](https://forums.unrealengine.com/u/Xanderxavier)\
**Post date:** [May 28, 2024, 1:58am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/1 "2024-05-28T01:58:56Z")

</div>

![Greenshot-2024-05-28 03_52_48](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/b/2/5b2b7b319b2da69e6edfe681fcd60f00c25b603a.jpeg)

So basically when building from UE source release branch at v 5.4.1 (fork(with no changes syncd to main)) I get the following errors, this on VS 2022 Pro 17.10, any ideas how to fix, alas double clicking the error does not take me to the code so bit confused ?

In the Output :  
96\>Building CmdLink…  
03:39:41:476 96\>Using Visual Studio 2022 14.38.33138 toolchain (C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.38.33130) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).  
03:39:41:476 96\>[Upgrade]  
03:39:41:476 96\>[Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:  
03:39:41:476 96\>[Upgrade] IncludeOrderVersion = EngineIncludeOrderVersion.Oldest  
03:39:41:476 96\>[Upgrade] Suppress this message by setting ‘IncludeOrderVersion = EngineIncludeOrderVersion.Latest;’ in CmdLink.Target.cs.  
03:39:41:476 96\>[Upgrade] Alternatively you can set this to ‘EngineIncludeOrderVersion.Latest’ to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.  
03:39:41:476 96\>[Upgrade]  
03:39:41:476 96\>Determining max actions to execute in parallel (16 physical cores, 32 logical cores)  
03:39:41:476 96\> Executing up to 16 processes, one per physical core  
03:39:41:476 96\>Using Parallel executor to run 2 action(s)  
03:39:41:476 96\>------ Building 2 action(s) started ------  
03:39:41:892 96\>[1/2] Link [x64] CmdLink.exe  
03:39:41:948 96\>Module.Core.11.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.14.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.3.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.8.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.9.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.10.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t \* GInternalProjectName” (?GInternalProjectName@@3PA\_WA)  
03:39:41:948 96\>Module.Core.3.cpp.obj : error LNK2001: unresolved external symbol “wchar\_t const \* const GForeignEngineDir” (?GForeignEngineDir@@3PEB\_WEB)  
03:39:41:948 96\>…\Binaries\Win64\CmdLink.exe : fatal error LNK1120: 2 unresolved externals  
03:39:41:948 96\>Total time in Parallel executor: 0.48 seconds  
03:39:41:948 96\>Total execution time: 81.76 seconds  
03:39:41:983 96\>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat CmdLink Win64 Development -WaitMutex -FromMsBuild -architecture=x64” exited with code 6.  
03:39:41:983 96\>Done building project “CmdLink.vcxproj” – FAILED.

---

<div class="post-metadata">

**Author:** ![ejacosta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ejacosta](https://forums.unrealengine.com/u/ejacosta)\
**Post date:** [June 3, 2024, 6:48pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/2 "2024-06-03T18:48:10Z")

</div>

I’m not sure if this is correct, but I added the following code between the includes and enum EErrorMessage (~ln9) to CmdLink.cpp and the CMDLink project compiled. It’s similar to what they do in other Programs if you do a Find in files for GInternalProjectName.

#if !defined(UE\_PROJECT\_NAME)  
TCHAR GInternalProjectName[64] = TEXT(“CmdLink”);  
#else  
TCHAR GInternalProjectName[64] = TEXT(PREPROCESSOR\_TO\_STRING(UE\_PROJECT\_NAME));  
#endif  
IMPLEMENT\_FOREIGN\_ENGINE\_DIR()

---

<div class="post-metadata">

**Author:** ![letthemicefree](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/letthemicefree/32/989563_2.png) [@letthemicefree](https://forums.unrealengine.com/u/letthemicefree)\
**Post date:** [June 21, 2024, 4:15pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/3 "2024-06-21T16:15:04Z")

</div>

The fix from ue5-main upstream is to add

```auto
#include "RequiredProgramMainCPPInclude.h"

IMPLEMENT_APPLICATION(CmdLink, "CmdLink")

```

before the enum EErrorMessage declaration and to add `"Projects"` to the `PrivateDependencyModuleNames`.

It can already be done in 5.4.2 manually.

---

<div class="post-metadata">

**Author:** ![waliwaliwala](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@waliwaliwala](https://forums.unrealengine.com/u/waliwaliwala)\
**Post date:** [June 24, 2024, 1:20pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/4 "2024-06-24T13:20:23Z")

</div>

I’ve add this 2 line in _CmdLink.cpp_, and add “Projects” to PrivateDependencyModuleNames in _Launch.Build.cs_, but it still compiles ““Interfaces/IPluginManager.h”: No such file or directory CmdLink”, sorry did i make any mistake?

---

<div class="post-metadata">

**Author:** ![letthemicefree](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/letthemicefree/32/989563_2.png) [@letthemicefree](https://forums.unrealengine.com/u/letthemicefree)\
**Post date:** [June 24, 2024, 5:25pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/5 "2024-06-24T17:25:07Z")

</div>

> [@waliwaliwala](#):
>

It should be in `CmdLink.Build.cs` not `Launch.Build.cs` ?

---

<div class="post-metadata">

**Author:** ![KillerSneak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/killersneak/32/754802_2.png) [@KillerSneak](https://forums.unrealengine.com/u/KillerSneak)\
**Post date:** [July 23, 2024, 2:26pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/6 "2024-07-23T14:26:48Z")

</div>

Tried this my build still failed and have some “other -new issues”

> [@Build errors upgrading from 5.3.1 to 5.4.3](https://forums.unrealengine.com/t/build-errors-upgrading-from-5-3-1-to-5-4-3/1946935/3):
>
> Errors: Severity Code Description Project File Line Suppression State Details Error MSB3073 The command "..\..\Build\BatchFiles\Build.bat WebTests Win64 Development -WaitMutex -FromMsBuild -architecture=x64 -Mode=Test" exited with code 6. WebTests F:\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44 Error MSB3073 The command "..\..\Build\BatchFiles\Build.bat AutoRTFMTests Win64 Development -Project="F:\UnrealEngine\Engine\Programs\AutoRTFMTests\Aut…

---

<div class="post-metadata">

**Author:** ![DryreL](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dryrel/32/1042339_2.png) [@DryreL](https://forums.unrealengine.com/u/DryreL)\
**Post date:** [September 24, 2024, 7:35am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/7 "2024-09-24T07:35:18Z")

</div>

I’ve got the same error. Any solution?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/f/3/ef30cd8dd7c0db62d9dbae56c6fb32c46e4b3ddb.png)

---

<div class="post-metadata">

**Author:** ![DryreL](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dryrel/32/1042339_2.png) [@DryreL](https://forums.unrealengine.com/u/DryreL)\
**Post date:** [September 24, 2024, 7:52am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/8 "2024-09-24T07:52:33Z")

</div>

Thanks man, you’re a **hero**! It solved my problem.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/e/ceee1634e836e2c7dc118ff9a40037e72ca4294d.png)

---

<div class="post-metadata">

**Author:** ![DryreL](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dryrel/32/1042339_2.png) [@DryreL](https://forums.unrealengine.com/u/DryreL)\
**Post date:** [October 24, 2024, 10:18am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/10 "2024-10-24T10:18:55Z")

</div>

Hi! I already added the screenshot. Copy the code & paste it to CmdLink.cpp

---

<div class="post-metadata">

**Author:** ![douglasdriving](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@douglasdriving](https://forums.unrealengine.com/u/douglasdriving)\
**Post date:** [March 18, 2025, 12:42am UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/11 "2025-03-18T00:42:34Z")

</div>

just wanted to confirm that this fix worked for me as well. the code that you posted are using curly brackets around CmdLink, which caused errors for me. The code I used was the following:

```cpp
#if !defined(UE_PROJECT_NAME)
TCHAR GInternalProjectName[64] = TEXT("CmdLink");
#else
TCHAR GInternalProjectName[64] = TEXT(PREPROCESSOR_TO_STRING(UE_PROJECT_NAME));
#endif
IMPLEMENT_FOREIGN_ENGINE_DIR()

```

Added right after include statements in the `...\Engine\Source\Programs\CmdLink\Private\CmdLink.cpp`. Straight brackets around `"CmdLink"` seemed important.

Also, a trick i discovered to quickly test this is to only build the specific module in visual studio. So when you open up the Unreal Engine solution, you can open the solutions explorer (view \> solutions explorer). In there, open the “programs” folder and scroll down to find the module that causes errors (in this case, CmdLink). Right click on it and hit “build”. This is A LOT quicker than rebuilding the entire solution and makes error fixing easier.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/a/84a3ee8d0c9ceb5b34c8aba7c744d059d2544891.png)

---

<div class="post-metadata">

**Author:** ![no\_reply](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@no\_reply](https://forums.unrealengine.com/u/no_reply)\
**Post date:** [July 27, 2026, 1:21pm UTC](https://forums.unrealengine.com/t/lnk2001-unresolved-external-symbal-wchar-t/1876262/12 "2026-07-27T13:21:01Z")

</div>

It’s actually much simpler. The problem is that your project doesn’t have a **primary game module**.

The module specified in your `YourProject.Target.cs` (via `ExtraModuleNames`) must use `IMPLEMENT_PRIMARY_GAME_MODULE(...)` instead of `IMPLEMENT_MODULE(...)`.

For example:

```auto
#include "Modules/ModuleManager.h"

IMPLEMENT_PRIMARY_GAME_MODULE(FYourModule, YourModule, "YourProject");

```

instead of:

```auto
IMPLEMENT_MODULE(FYourModule, YourModule);

```

`IMPLEMENT_PRIMARY_GAME_MODULE` exports the engine symbols required by the Launch module (such as `GInternalProjectName`, `GIsGameAgnosticExe`, and `GForeignEngineDir`). If your primary game module uses `IMPLEMENT_MODULE` instead, you’ll typically get unresolved external symbol linker errors for those globals.
