I-BGS-I
(I-BGS-I)
March 24, 2014, 1:38am
1
after I migrated the old project to the new version of the tool I’m having this problem with the class Http.h
Error 12 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 ) C:\Users\Francisco\Documents\Unreal Projects\ShooterGame\Intermediate\ProjectFiles\Module.ShooterGame.cpp.obj ShooterGame
i using this module HTTP exactly i used in old version, someone know what can be?
grateful for the attention
RCL
(Arciel Rekman)
March 24, 2014, 12:42pm
2
How are you using it? Are you calling that function from anywhere else?
If you are using it directly in your game, make sure that you have
PrivateDependencyModuleName.AddRange(new string[] {"HTTP"});
in its .Build.cs file.
Also add HTTP_API to FHttpModule::Exec declaration if you’re calling that function from your game (which is not advised).
I-BGS-I
(I-BGS-I)
March 24, 2014, 1:34pm
3
PrivateDependencyModuleName.AddRange(new string[] {“HTTP”}); that is ok
my request is:
FHttpModule *module = new FHttpModule();
Request = module->CreateRequest();
Request->SetVerb("GET");
Request->SetURL("url");
Request->OnProcessRequestComplete().BindUObject(this,&OnData);
as I said, the code was running on the old version, the only change was the construction of FHttpModule class, I used this syntax in old version:
FHttpModule *module = &FHttpModule::Get(); and now method Get dont exist, and module have a construct method
FHttpModule *module = new FHttpModule();
That suggests to me that the class was modified in some way
RCL
(Arciel Rekman)
March 24, 2014, 4:16pm
4
Get() should and does exist, and this is actually the only way you can use the HTTP module in your program. You cannot create a new instance of it that way.
Try opening /Engine/Source/Runtime/Online/HTTP/Public/HttpModule.h in text editor to double check that there are local changes that prevent you from seeing Get() method.
I-BGS-I
(I-BGS-I)
March 24, 2014, 4:29pm
5
what this means and how HTTP_API add?
HTTP_API static FHttpModule & Get ();
Grateful for the attention
RCL
(Arciel Rekman)
March 24, 2014, 4:45pm
6
Use the Get(), you don’t have to change that header. HTTP_API is a macro which makes FHttpModule::Get() visible for external modules.
Just use this code for creating requests:
TSharedRef< IHttpRequest > HttpRequest = FHttpModule::Get().CreateRequest();
I-BGS-I
(I-BGS-I)
March 24, 2014, 6:33pm
7
i got it, but look the print screen, i don´t know why,
but i don´t have access to method Get :~(
RCL
(Arciel Rekman)
March 24, 2014, 6:39pm
8
The hint may be inaccurate, especially if you are not using Visual Assist. Make sure you include Http.h and try compiling the code nevertheless.
I-BGS-I
(I-BGS-I)
March 24, 2014, 7:04pm
9
thks man u right only my visual studio dont find the method.
but now code compile fine
RCL
(Arciel Rekman)
March 24, 2014, 7:07pm
10
Great, glad it’s resolved
bach_1
(BachirEl khoury)
June 6, 2014, 12:14pm
11
@RCL I have included Http.h file, using Xcode, but compiler complains that Http.h not found. Please help thanks.
RCL
(Arciel Rekman)
June 10, 2014, 7:32pm
12
The module where you are including that header should list HTTP module as one of its dependencies.
In a bit more human terms, take a look at *.Build.cs file for to the code where you are trying to use Http.h, and add “HTTP” to PrivateDependencyModuleNames array. Take a look how CrashReporterClient.Build.cs does that for a reference.
Twinfun
(Twinfun)
September 23, 2014, 9:05pm
13
Hi RCL,
When you say “which is not advised” are you referring to calling “FHttpModule::Exec”, or are you recommending against using HTTP on the client side?
I’m assuming you mean the former, but I’m not quite sure.
RCL
(Arciel Rekman)
September 24, 2014, 12:02am
14
No, using HTTP module is fine