Compiling a header and two cpp files

messages.h

#ifndef MESSAGES_H #define MESSAGES_H #include <iostream> Messages() #endif

messages.cpp

[code]#include “messages.h”

void Messages(){
cout << “Message from message.h”;
}
[/code]
messageMain.cpp

#include "messages.h" void MessageMain(){ cout << "Inside main message..." }

This is the code I want to run, it runs fine using g++. I have no idea how to run in ROOT, also is it possible to run outside ROOT using Aclic ?

It does not:

$ g++ messages.cpp messageMain.cpp -o test messages.cpp:3:1: error: expected constructor, destructor, or type conversion before ‘void’ messageMain.cpp:2:1: error: expected constructor, destructor, or type conversion before ‘void’
you are missing some semicolons, namespaces, type declaration and a “main” function.

I think you should provide a real working example :wink: