Custom location includes not added at runtime

79 views
Skip to first unread message

Kuba Roth

unread,
Dec 12, 2014, 8:48:55 PM12/12/14
to runtimecompi...@googlegroups.com
Hi Doug,

According to the docs a cusom include paths can be added via m_pRuntimeObjectSystem->AddIncludeDir(). This does not seems to work in my case (modified ConsoleExample)
All builds correctly and runs fine but fails at runtime when the first change is introduced.
The error complains about missing headers:

......./RuntimeObject01.cpp:7:26: error: GU/GU_Detail.h: No such file or directory

The runtime compilation points only to the RuntimeObjectSystem and RuntimeCompiler include directories. I wonder if AddIncludeDir() has to be called at certain place to be registered?

Currently this is done in ConsoleGame::Init() before constructing the first object.


Thanks,
kuba

PS. The problem only appears when working with third party libraries.

Doug Binks

unread,
Dec 13, 2014, 6:29:19 AM12/13/14
to Runtime-Compiled C++
This should be done after the m_pRuntimeObjectSystem->Initialise() call, but other than that it can be done any time before you expect to get a compile.

I've added something myself to the example as a test and could see the include being used by the compiler. Could you check the compiler output to see if you get a -I"your_path"


--
You received this message because you are subscribed to the Google Groups "Runtime-Compiled C++" group.
To unsubscribe from this group and stop receiving emails from it, send an email to runtimecompiledcpl...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kuba Roth

unread,
Dec 15, 2014, 2:00:11 PM12/15/14
to runtimecompi...@googlegroups.com
Thanks,
I tested again this morning and all is working now. New include paths and custom compile flags are listed every time the file is modified.

Just for the record. If SetAdditionalCompileOptions flags are not followed by a whitespace they are concatenated with SerAdditionalLinkOptiins and throw a link error. Appending a space to the compileOptions string resolves the problem.

Thank you,
Kuba

Doug Binks

unread,
Dec 15, 2014, 2:18:53 PM12/15/14
to Runtime-Compiled C++
Thanks - I'll see if I can fix that issue! If you like you can file it under github.

Kuba Roth

unread,
Dec 15, 2014, 4:21:38 PM12/15/14
to runtimecompi...@googlegroups.com
Sure, I'll do that right away.

Doug Binks

unread,
Dec 16, 2014, 4:17:39 AM12/16/14
to runtimecompi...@googlegroups.com
Thanks - will get onto this as soon as I can!

On 15 December 2014 at 22:21, Kuba Roth <kuba...@gmail.com> wrote:
Sure, I'll do that right away.

Vamidi

unread,
Aug 7, 2019, 5:03:48 PM8/7/19
to Runtime-Compiled C++
Hi there,

Great library! Although for me the AddIncludeDir doesn't seems to work.

..\MacroDefinitions.h(3): fatal error C1083: Cannot open include file: 'rttr/registration_friend': No such file or directory (compiling source file ..\runtimeobject01.cpp)
and this is my include dir "path\to\rttr\include\rttr" 


Op dinsdag 16 december 2014 10:17:39 UTC+1 schreef Doug Binks:
Thanks - will get onto this as soon as I can!
On 15 December 2014 at 22:21, Kuba Roth <kuba...@gmail.com> wrote:
Sure, I'll do that right away.

--
You received this message because you are subscribed to the Google Groups "Runtime-Compiled C++" group.
To unsubscribe from this group and stop receiving emails from it, send an email to runtimecompiledcplusplus+unsub...@googlegroups.com.

Doug Binks

unread,
Aug 8, 2019, 5:04:09 AM8/8/19
to Runtime-Compiled C++
From the looks of the error your include directory should be "path\to\rttr\include\" since the include file already has the rttr folder in it's path.

If this isn't the issue, it could be that you're not passing a full path. 

A useful trick for getting full paths is to call the function IRuntimeObjectSystem::FindFile( __FILE__ ) to retrieve the full path of the file this line is in, then use ParentPath() to get the parent path of this file and add your include dir from there. For example in my code I have:

// Add include directories relative to this file
FileSystemUtils::Path basePath = m_SystemTable.pRuntimeObjectSystem->FindFile( __FILE__ );

basePath = basePath.ParentPath();
FileSystemUtils::Path includeDir = basePath / "RuntimeModifiable";
m_SystemTable.pRuntimeObjectSystem->AddIncludeDir(includeDir.c_str());

Vamidi

unread,
Aug 8, 2019, 7:52:38 AM8/8/19
to Runtime-Compiled C++
that is very useful I will try it out! And yes the double rttr directory was intended (my mistake for not pointing that out). I will get back to you if it works out!

Op donderdag 8 augustus 2019 11:04:09 UTC+2 schreef Doug Binks:

Vamidi

unread,
Aug 8, 2019, 9:02:16 AM8/8/19
to Runtime-Compiled C++
Update, I tried the way you said and from the debug options I copied the value and run it in the explorer. The path comes out correct. here is my debug output.

[14:21:28] VIVID_ENGINE: cl /nologo /Zi /FC /MDd /LDd /Od  /D UNICODE /D _UNICODE  /MP /Fo"D:\Personal\VividEngine\VividEditor\Runtime\DEBUG_DEBUG\\" /D WIN32 /EHa /FeC:\Users\user\AppData\Local\Temp\F0CF.tmp /FdC:\Users\user\AppData\Local\Temp\F0CF.pdb  /I "d:\downloads\runtimecompiledcplusplus-master\aurora\runtimeobjectsystem" /I "d:\downloads\runtimecompiledcplusplus-master\aurora\RuntimeCompiler" /I "d:\personal\vividengine\vividengine\Source\" /I "d:\personal\vividengine\vividengine\Vendor\" /I "d:\personal\vividengine\vividengine\Intermediate\BuildInc\" /I "d:\personal\vividengine\vividengine\Vendor\cppfs\include\" /I "d:\personal\vividengine\vividengine\Vendor\spdlog\include\" /I "d:\personal\vividengine\vividengine\Vendor\rttr\include\rttr\" /I "d:\personal\vividengine\vividengine\Vendor\glm\include\" /I "d:\personal\vividengine\vividengine\Vendor\ImGui\" /I "d:\personal\vividengine\vividengine\Vendor\moodycamelinclude\" /I "d:\personal\vividengine\vividengine\Vendor\assimpinclude\" /I "d:\personal\vividengine\vividengine\Vendor\RuntimeCompiledPlusPlus\include\" /I "d:\personal\vividengine\vividengine\Vendor\rttr\include\rttr" /I "D:\Personal\VividEngine\Builds\x64\DebugEditor\"  "d:\personal\vividengine\vivideditor\source\runtimeobject01.cpp" "d:\personal\vividengine\vivideditor\runtime\debug_debug\objectinterfacepermodulesource.obj"



Op donderdag 8 augustus 2019 11:04:09 UTC+2 schreef Doug Binks:
From the looks of the error your include directory should be "path\to\rttr\include\" since the include file already has the rttr folder in it's path.

Doug Binks

unread,
Aug 8, 2019, 1:34:19 PM8/8/19
to Runtime-Compiled C++
Does this solve the problem for you now or are you still getting compile errors?

Vamidi

unread,
Aug 8, 2019, 5:48:26 PM8/8/19
to Runtime-Compiled C++
No unfortunately it didn't, still the same error. cannot include file --> C1083

Op donderdag 8 augustus 2019 19:34:19 UTC+2 schreef Doug Binks:

Doug Binks

unread,
Aug 9, 2019, 4:49:08 AM8/9/19
to Runtime-Compiled C++
From your debug output the include directory is being set twice - I'm not sure what that will do but although it's probably not a problem I would remove it.

I also note your include paths have a "\" at the end when I do that I get an error "cl : Command line error D8038 : invalid argument", since \" escapes the quote and creates a longer string, you should remove them so the paths are just like:

Vamidi

unread,
Aug 9, 2019, 7:41:08 AM8/9/19
to Runtime-Compiled C++
Hi yea I tried to remove it as well, and it works as in no error or command line error. But still error of not finding the include file.
 It all works if I use relative paths, but I really want to get it to work this way.

Op vrijdag 9 augustus 2019 10:49:08 UTC+2 schreef Doug Binks:

Doug Binks

unread,
Aug 9, 2019, 7:45:53 AM8/9/19
to Runtime-Compiled C++
I would double check that your include directory plus the include path is actually a file, as the RCC++ is correctly passing the include path to the compiler.

So if you have:

#include "rttr/registration_friend.h"

and your path is:

d:\personal\vividengine\vividengine\Vendor\rttr\include\rttr

Then you should have the file:

d:\personal\vividengine\vividengine\Vendor\rttr\include\rttr\rttr\registration_friend.h

Vamidi

unread,
Aug 9, 2019, 9:01:34 AM8/9/19
to Runtime-Compiled C++
You rock! so stupid of myself to overlook that! Thankyou for your time!! appreciate it!

Op vrijdag 9 augustus 2019 13:45:53 UTC+2 schreef Doug Binks:
Reply all
Reply to author
Forward
0 new messages