# MIDIDeviceController.h causes compiler errors

**URL:** <https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419>\
**Category:** Plugins\
**Tags:** unreal-engine, Plugins, CPP, question\
**Created:** [December 15, 2016, 11:30pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419 "2016-12-15T23:30:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kowbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kowbell](https://forums.unrealengine.com/u/Kowbell)\
**Post date:** [December 15, 2016, 11:30pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/1 "2016-12-15T23:30:46Z")

</div>

The file MIDIDeviceController.h, (from the MIDIDevice plugin) when included, results in a compiler error:

```
CompilerResultsLog:Error: Error C:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80) : error C2143: syntax error: missing ';' before '*'C:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80): error C2143: syntax error: missing ';'
 before '*'
CompilerResultsLog: Info 
CompilerResultsLog:Error: Error C:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-intC:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80)
: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
CompilerResultsLog: Info 
CompilerResultsLog:Error: Error C:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80) : error C2238: unexpected token(s) preceding ';'C:\Program Files\Epic Games\4.14\Engine\Plugins\Runtime\MIDIDevice\Source\MIDIDevice\Public\MIDIDeviceController.h(80): error C2238: unexpected token(s) precedin
g ';'

```

The source file is totally unmodified - this happens out of the box. This makes working with MIDI devices in C++ impossible, as the MIDIDeviceController is used to interface with the devices.

**EDIT: Some extra information that may or may not help:**

I’ve added `"MIDIDevice"` to my `PublicDependencyModuleNames` line in my Build.cs, in the same way you add any plugin. I’m able to import `MIDIDeviceManager.h` without error with that added.

With further digging around, the particular line that has an error is `PortMidiStream* PMMIDIInputStream;` - the error is that `PortMidiStream` is not specified. I assume this specification is done in the `portmidi.h` file, which is included in the MIDIDevice plugin’s pre-compiled header. IntelliSense is giving me the -squiggle, saying that it cannot open that header file.

I assumed that maybe I had to do something extra to make sure this third-party dependency worked. I’ve tried using methods described in [these](https://answers.unrealengine.com/questions/18617/adding-third-party-dependency-for-core.html) [AnswerHub](https://answers.unrealengine.com/questions/243103/how-to-i-link-a-third-party-library-using-the-unre.html) [threads](https://answers.unrealengine.com/questions/110966/adding-external-dependencies.html), but to no avail.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [December 19, 2016, 7:35pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/2 "2016-12-19T19:35:55Z")

</div>

Hello ,

Have you tried doing this inside of a fresh project? I created a new C++ project based off the Third Person Template, enabled the MIDIDeviceController plugin, added a C++ class based off of actor, and then included the MIDIDeviceController.h using the following include statement and it compiled without any errors for me.

```
#include "Engine/Plugins/Runtime/MIDIDevice/Source/MIDIDevice/Public/MIDIDeviceController.h"

```

Please give this a try and let me know if you receive any errors.

---

<div class="post-metadata">

**Author:** ![Kowbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kowbell](https://forums.unrealengine.com/u/Kowbell)\
**Post date:** [December 20, 2016, 1:59am UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/3 "2016-12-20T01:59:13Z")

</div>

I tried that include on my project, but got a compile error claiming there was no such file or directory. I tried on a new Third Person C++ project, and got the same error.

Right now I’m importing the header by adding `"MIDIDevice"` to the `PublicDependencyModuleNames` line in my Build.cs file, which allows me to include `MIDIDeviceManager.h` without error, as well as include `MIDIDeviceController.h` with the bug given above - the compiler does find the file, just with an error. This works both on my current project as well as the default Third Person C++ project.

I’ll try re-installing 4.14.1 and see if anything changes.

Update: Re-installed 4.14.1, and both errors persist, even on another newly created Third Person C++ project.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [December 20, 2016, 9:52pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/4 "2016-12-20T21:52:44Z")

</div>

Ah, I’m seeing the issue now after including the module. I also can’t get it to include that file again without including the module. Not quite sure how it was working previously. I do see that MIDIDeviceController.cpp does have a couple of "int"s in it but those aren’t exposed to blueprints so they should be fine. I’m going to look into this further and get back to you.

---

<div class="post-metadata">

**Author:** ![Kowbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kowbell](https://forums.unrealengine.com/u/Kowbell)\
**Post date:** [December 20, 2016, 10:01pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/5 "2016-12-20T22:01:42Z")

</div>

Excellent! Thank you, I look forward to hearing back 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [December 23, 2016, 7:03pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/6 "2016-12-23T19:03:23Z")

</div>

After looking at the source code and the commit messages of when this plugin was added to the engine, it may be that this plugin is only meant to be implemented in Blueprint at the moment. I’m going to ask to person who created it to be sure but I won’t be able to contact them until after the holiday break. I’ll have an update for you shortly into the new year.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [January 16, 2017, 9:56pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/7 "2017-01-16T21:56:24Z")

</div>

Hello ,

I spoke with the person who created this plugin and they mentioned that while it isn’t intended to only be used in Blueprints, that’s all it was tested for and it was never tested in an external module. Due to this, I’ve placed a bug report in for the issue. You can find that bug here: [UE-40704](https://issues.unrealengine.com/issue/UE-40704)

Thank you for reporting this issue and have a nice day!

---

<div class="post-metadata">

**Author:** ![Kowbell](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kowbell](https://forums.unrealengine.com/u/Kowbell)\
**Post date:** [January 20, 2017, 10:09pm UTC](https://forums.unrealengine.com/t/mididevicecontroller-h-causes-compiler-errors/379419/8 "2017-01-20T22:09:12Z")

</div>

Thanks for the help!
