IDE refusing to recognise macro? Try close and re-open IDE

For anyone else who seemed to have an issue with the IDE error-sensing refusing to recognise the DECLARE_DYNAMIC_MULTICAST_DELEGATE macro even though Unreal compiled successfully and well outside the normal timeframe for these sort of things to get recognised, try closing and re-opening the IDE.

5 Likes

Thank you@ederkley, that was causing me much undo stress!

I’ve noticed it happens a lot with the Class defining macros. Like the UClass for instance. From what I could gather, the iDE is confused every time the line in which the Class declaration starts change. So, every line added or removed before UClass can produce this kind of behaviour and requires restarting the IDE for me which is really annoying.

HI I have found an easier way to solve the #include in the header file problem.

After you have #include the file that you want, go to the editor and compile, it would work.
If it doesn’t there is a bug in your code.

Once compilation is complete go back to visual studio and set the solution configuration to development and then back to development editor. Like this:

set it first to this:
https://community.gamedev.tv/uploads/short-url/wtcEs57C58irue5mmFjSSpT4VFz.JPG
Then back to this:
https://community.gamedev.tv/uploads/short-url/roov3lWjwtpyjXvboePEIf4Bwft.JPG
then wait for a while and all errors will go away. It has worked for me so far.

Another point you don’t need to #include files in the cpp if you do this, only in the header file.

This is a method I use for when i add a new #include in the header file in ue4 version 4.16.
It looks like every time you add a line of code above:
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
in your header file it will give the errors you guys are talking about.

To recap all you have to do is:

1)compile in unreal (it would work)

2/3) Do what the pictures tell you to do in visual studio.

ps: This is for visual studio 2015 don’t know if it works for the 2017 version

3 Likes

ty ty ty

On another note, have you guys had problems with UE not treating the DECLARE_DYNAMIC_MULTICAST_DELEGATE macro correctly? When I compile my code WITH a semicolon after the macro, it works. However, when I compile my code WITHOUT a semicolon next to the DECLARE_DYNAMIC_MULTICAST_DELEGATE macro, UE gives me the error: Error: Missing ‘;’ before ‘UCLASS’.

I thought macros didn’t need semicolons at the end of their lines? Or is is that macros declared outside of a class DO need semicolons? Or is the DECLARE_DYNAMIC_MULTICAST_DELEGATE macro special?

Privacy & Terms