# How to use unreal engine modules in C++ (Linker Error)

**URL:** <https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104>\
**Category:** C++\
**Tags:** modules, linker-error, unreal-engine, Android, CPP, question\
**Created:** [December 24, 2022, 2:59pm UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104 "2022-12-24T14:59:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivansh\_pandey2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shivansh_pandey2/32/710746_2.png) [@shivansh\_pandey2](https://forums.unrealengine.com/u/shivansh_pandey2)\
**Post date:** [December 24, 2022, 2:59pm UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104/1 "2022-12-24T14:59:28Z")

</div>

I am trying to use unreal’s built-in “AndroidAdvertising” module in c++.  
Below is the AndroidAdvertising module’s location in 4.27  
 ![LocationOfModuleAndroidAdvertising2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/c/0/4c0069e8c10eda5a940a4921dafe0981adf7d92d.png)

Firstly, I added “AndroidAdvertising” to the build.cs

 ![PublicDependencyModulesProject750](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/9/d/d9dad3bbad5bdfdcf9aa3b0e1eff68bfcf0db8d7.png)

.uproject  
 ![uprojectfile](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/0/8/90875af000ad230ab001bbc4a16da5ba0e0d338b.png)

target.cs  
 ![TargetcsOfProject750](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/2/1f239b61d85b0e2f9bf5094e93800ff79df48726.png)

After this I tried to build the solution(without adding any extra code) which gave a linking error:

> LINK : fatal error LNK1181: cannot open input file ‘E:\Unreal Engine\UE\_4.27\Engine\Intermediate\Build\Win64\UE4Editor\Development\AndroidAdvertising\UE4Editor-AndroidAdvertising.lib’

Full Log File: [Build.txt](https://forums.unrealengine.com/uploads/short-url/dFpYGhVlS2OZBmGlrUqgBVKFzz.txt) (1.5 KB)

Project Structure:  
 ![ProjectStructure2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/f/3ff7b3cef3818f175de28d493b3a5d90f1d5209b.png)

I have a custom “Android” module in which I am trying to access unreal’s “AndroidAdvertising” module.

complete project([Project750.rar - Google Drive](https://drive.google.com/file/d/12LHW8QKr1Q2mO9hzGadnnf9GSZjNT00Z/view?usp=sharing))

Any help or suggestion will be appreciated.

---

<div class="post-metadata">

**Author:** ![executed\_dazza\_666](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@executed\_dazza\_666](https://forums.unrealengine.com/u/executed_dazza_666)\
**Post date:** [December 24, 2022, 4:42pm UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104/2 "2022-12-24T16:42:15Z")

</div>

Could it be that the `Type` is `Editor` when it is a `Runtime` module?

---

<div class="post-metadata">

**Author:** ![shivansh\_pandey2](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shivansh_pandey2/32/710746_2.png) [@shivansh\_pandey2](https://forums.unrealengine.com/u/shivansh_pandey2)\
**Post date:** [December 25, 2022, 3:53am UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104/3 "2022-12-25T03:53:47Z")

</div>

Set the `module` `type` to `Runtime` :  
 ![AndroidAdvertisingSettoRuntimeinP750uproject](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/b/69bc2e3550ada994f697584286bd513a16464bd5.png)

then → “`Generate Visual Studio project files`” → “`Build`”

Still Got the same Error: `LINK : fatal error LNK1181: cannot open input file ...\AndroidAdvertising\UE4Editor-AndroidAdvertising.lib'`

Build Log: [Build2.txt](https://forums.unrealengine.com/uploads/short-url/413sfPTGW48xJdg6qkJ9pKLZ2SU.txt) (2.0 KB)

---

<div class="post-metadata">

**Author:** ![PresumptivePanda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/presumptivepanda/32/1194593_2.png) [@PresumptivePanda](https://forums.unrealengine.com/u/PresumptivePanda)\
**Post date:** [December 28, 2022, 1:02am UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104/4 "2022-12-28T01:02:42Z")

</div>

This topic has been moved from **International** to **Programming & Scripting: C++**.

When posting, please review the categories to ensure your topic is posted in the most relevant space. Hopefully, this category change will help you to get an answer.

In the meantime, good luck and happy developing. 🙂

---

<div class="post-metadata">

**Author:** ![GeorgeTheDev\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GeorgeTheDev\_1](https://forums.unrealengine.com/u/GeorgeTheDev_1)\
**Post date:** [March 29, 2023, 8:43pm UTC](https://forums.unrealengine.com/t/how-to-use-unreal-engine-modules-in-c-linker-error/735104/5 "2023-03-29T20:43:20Z")

</div>

HELP plzz, did you fix it???
