# Unresolved external in FHTTPModule

**URL:** <https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322>\
**Category:** C++\
**Tags:** build, unreal-engine, http, UE4, question, CPP\
**Created:** [February 3, 2016, 7:49pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322 "2016-02-03T19:49:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![davek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davek](https://forums.unrealengine.com/u/davek)\
**Post date:** [February 3, 2016, 7:49pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/1 "2016-02-03T19:49:29Z")

</div>

I just can’t figure this one out. All the threads about HTTP seem to be quite old. I’m on 4.10.

2\> [14/14] Link UE4Editor-FOTBS-Win64-DebugGame.dll  
2\> Creating library D:\UnrealEngine4\Projects\FOTBS\Intermediate/Build/Win64\UE4Editor\DebugGame\UE4Editor-FOTBS-Win64-DebugGame.lib and object D:\UnrealEngine4\Projects\FOTBS\Intermediate/Build/Win64\UE4Editor\DebugGame\UE4Editor-FOTBS-Win64-DebugGame.exp  
2\>FOTBSHTTP.cpp.obj : error LNK2001: unresolved external symbol “public: virtual bool \_\_cdecl FHttpModule::Exec(class UWorld \*,wchar\_t const \*,class FOutputDevice &)” (?Exec@FHttpModule@@UEAA\_NPEAVUWorld@@PEB\_WAEAVFOutputDevice@@@Z)  
2\>FOTBSHTTP.cpp.obj : error LNK2019: unresolved external symbol “public: virtual class TSharedRef \_\_cdecl FHttpModule::CreateRequest(void)” (?CreateRequest@FHttpModule@@UEAA?AV?$TSharedRef@VIHttpRequest@@$0A@@@anonymous_user_9674a66c) referenced in function “public: void \_\_cdecl UFOTBSHTTP::MakeRequest(void)” (?MakeRequest@UFOTBSHTTP@@QEAAXXZ)  
2\>FOTBSHTTP.cpp.obj : error LNK2001: unresolved external symbol “private: virtual void \_\_cdecl FHttpModule::StartupModule(void)” (?StartupModule@FHttpModule@@EEAAXXZ)  
2\>FOTBSHTTP.cpp.obj : error LNK2001: unresolved external symbol “private: virtual void \_\_cdecl FHttpModule::ShutdownModule(void)” (?ShutdownModule@FHttpModule@@EEAAXXZ)  
2\>D:\UnrealEngine4\Projects\FOTBS\Binaries\Win64\UE4Editor-FOTBS-Win64-DebugGame.dll : fatal error LNK1120: 4 unresolved externals

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [February 4, 2016, 3:43pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/2 "2016-02-04T15:43:51Z")

</div>

Looks like you aren’t including the http module into your project. I’m not sure what the exact dependency is, but check that you have this somewhere. In your MyGame.build.cs file.

```
	PublicDependencyModuleNames.AddRange(
		new string[] {
			...
			"HTTP",
                        ...

```

You could touch one of the http cpp files (add a compiler error) and see if it catches it. I suspect it won’t.

---

<div class="post-metadata">

**Author:** ![davek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davek](https://forums.unrealengine.com/u/davek)\
**Post date:** [February 5, 2016, 6:39am UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/3 "2016-02-05T06:39:33Z")

</div>

Hi Josh, thanks for your reply. I included the dependency module and no change, still unresolved. And of course, adding compiler error into the HttpModule.cpp is not picked up by the compiler, even after dependency module inclusion.  
Basically - no change at all.

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [February 6, 2016, 12:33am UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/4 "2016-02-06T00:33:22Z")

</div>

If you are making a C++/Native application and not a fully blueprint game the fact that the forced compiler error isn’t being picked up means something isn’t right about the dependency checking or your build.cs file. Which certainly continue to cause link errors.

Can you look at your link.exe command line and see if the module is being referenced there? Or in any of the build command output?

I’d have to look into the UBT code to see where you could output some debugging to see what modules your project is attempting to bring in.

---

<div class="post-metadata">

**Author:** ![davek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@davek](https://forums.unrealengine.com/u/davek)\
**Post date:** [February 6, 2016, 7:08am UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/5 "2016-02-06T07:08:50Z")

</div>

Thank you for the suggestion. I’m on VS2015 so I don’t see the link.exe command line. Is there a way for me to see it ? I’ve included “HTTP” in both Build and Target.cs files

**Build.cs**

using UnrealBuildTool;

public class FOTBS : ModuleRules  
{  
public FOTBS(TargetInfo Target)  
{  
PublicDependencyModuleNames.AddRange(new string[] { “Core”, “CoreUObject”, “Engine”, “InputCore” , “HTTP” });  
}  
}

**FOTBSHTTP.h**

#pragma once

#include “FOTBS.h”

#include “Runtime/Online/HTTP/Public/Http.h”

#include “FOTBSHTTP.generated.h”

UCLASS()  
class UFOTBSHTTP : public UObject  
{  
GENERATED\_BODY()

public:  
UFOTBSHTTP();

```
void MakeRequest();

void OnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);

```

};

**FOTBSHTTP.cpp**

#include “FOTBS.h”

#include “FOTBSHTTP.h”

#include “Public/FOTBSHUD.h”

#include “Runtime/Online/HTTP/Public/HttpModule.h”

#include “Runtime/Online/HTTP/Public/Http.h”

UFOTBSHTTP::UFOTBSHTTP() {

}

void UFOTBSHTTP::MakeRequest() {

```
FHttpModule httpmodule = FHttpModule::Get();
TSharedRef<IHttpRequest> HttpRequest = httpmodule.CreateRequest();
HttpRequest->SetVerb("GET");
HttpRequest->SetURL(FString("http://myserver.com"));
HttpRequest->OnProcessRequestComplete().BindUObject( this, &UFOTBSHTTP::OnResponseReceived );
HttpRequest->ProcessRequest();

```

}

void UFOTBSHTTP::OnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) {

```
FString responseData = Response->GetContentAsString();

if (!bWasSuccessful)
{
	UE_LOG(LogTemp, Error, TEXT("Response was invalid! Please check the URL."));
	return;
}

```

}

While I spent the last 25 years coding, the last time I was working with C++ was in DOS4GW times and the Windows syntax is certainly new to me so I keep spending time looking for answers. Would you by any chance be able to recommend good read about the logic behind modules and dependencies and maybe Visual Studio-specific considerations?

---

<div class="post-metadata">

**Author:** ![Crzyhomer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Crzyhomer](https://forums.unrealengine.com/u/Crzyhomer)\
**Post date:** [February 9, 2016, 7:46pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/6 "2016-02-09T19:46:05Z")

</div>

Try upping the verbosity of logging under Tools:Options:ProjectsAndSolutions:BuildAndRun  
[MSDN Link](https://msdn.microsoft.com/query/dev12.query?appId=Dev12IDEF1&l=EN-US&k=k(VS.ToolsOptionsPages.Projects.Build_and_Run)&rd=true)

I’m not familiar with your build flow. Internally we have Incredibuild and UnrealBuildTool (UBT) will generate a file that describes all the cl.exe and link.exe operations. Vanilla VS20xx will output a log as well.

I believe UBT ultimately uses MSBuild.exe to build things in your case, so there should be a log file somewhere with the output. I’m sorry I’m in “hand wavy” mode at the moment.

Add “-verbose” and/or “-xgeexport” to the compiler settings. They are under the NMake section of VS20xx. Right click on your project settings, Properties, Configuration Properties, NMake. You’ll see the Build and Rebuild command lines.

As for “good reads”, Unreal does a bunch of trickery with modules, but ultimately they are just DLLs. It’s more a Windows consideration than a VS consideration. Unreal/UBT handles all the `__declspec(dllexport)` and `__declspec(dllimport)` magic via our MODULENAME\_API define.  
If you search for the variable `ModuleApiDefine` in our .cs files ( **UEBuildModule.cs** ), you’ll see how that magic works. That converts to the right thing in **WindowsPlatform.h** (or any of the other platforms)

In this case I’m expecting the `HTTP_API` to be defined, which I believe it is, but then the .lib/.dll are not being included and thus the link error.

---

<div class="post-metadata">

**Author:** ![DesertEagle\_PWN](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DesertEagle\_PWN](https://forums.unrealengine.com/u/DesertEagle_PWN)\
**Post date:** [June 29, 2018, 6:07pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/7 "2018-06-29T18:07:04Z")

</div>

Upvoted: I likewise encountered this issue working with HTTPModule in custom 4.20 engine build, still trying to rectify the problem.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_6779e972](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_6779e972](https://forums.unrealengine.com/u/anonymous_user_6779e972)\
**Post date:** [October 8, 2018, 12:24pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/8 "2018-10-08T12:24:49Z")

</div>

Did you find an answer to this? I have the same problem in 4.20 (installed build). I did add “HTTP” to the Build.cs file. But it still fails.

edit: It must be a problem with my project (or the fact that I am trying to use the HttpModule in a plugin module). If I create a new project and add a C++ class with the HttpModule, it compiles fine.

---

<div class="post-metadata">

**Author:** ![ANLevant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ANLevant](https://forums.unrealengine.com/u/ANLevant)\
**Post date:** [July 9, 2020, 2:05am UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/9 "2020-07-09T02:05:17Z")

</div>

This did the trick for me

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_73ecf7ab](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_73ecf7ab](https://forums.unrealengine.com/u/anonymous_user_73ecf7ab)\
**Post date:** [February 6, 2022, 10:18pm UTC](https://forums.unrealengine.com/t/unresolved-external-in-fhttpmodule/346322/10 "2022-02-06T22:18:31Z")

</div>

Changing this:

FHttpModule Http = FHttpModule::Get();

To this:

FHttpModule \* Http = &FHttpModule::Get();

Resolved the linking error for me.
