Cannot set include path for external headers in macro

Hello,

I am trying to load some external classes to use in a macro. If I add the include path interactively I can successfully include the header. However if I write the following macro test.C:

gInterpreter->AddIncludePath("path_to_header");
#include "myclass.h"
gSystem->Load("path_to_lib");

void test(){
std::cout << "test" << std::endl;
}

when I try to run it I get the following error:

 test.C:3:13: error: expected function body after function declarator
gInterpreter->AddIncludePath("./inc");  
 test.C:5:10: fatal error: 'myclass.h' file not found
#include "myclass.h"

Could you possibly tell me what I am doing wrong?
I am using ROOT 6.14.06 on Ubuntu 16.04.2 .

Best regards,
Ralitsa

Use:

R__ADD_LIBRARY_PATH(path)
R__LOAD_LIBRARY(library)
R__ADD_INCLUDE_PATH(path)

Thank you for the prompt reply. I did not realize the way to load changed in ROOT6. Now it works fine.

Best regards,
Ralitsa