problems creating an executable file with .o files in different folders using g++
<p>I have two c++ files at different locations </p>

<ol>
<li>hello.cc in /home/testing/src/impl/hello.cc</li>
<li>messages.cc in /home/testing/src/msg/messages.cc</li>
</ol>

<p>in hello.cc we have an include for messages.h </p>

<p>so i was sucessfull to compile hello.cc using below command
g++ -c -I/home/testing/src/msg hello.cc (this generated an hello.o file in /home/testing/src/impl/)</p>

<p>now i compiled the messages.cc using command
g++ -c messages.cc (this generated an messages.o file in /home/testing/src/msg/)</p>

<p><strong>now what i want is to make and executable file using hello.o</strong></p>

<p>using below command</p>

<p>g++ -o hello hello.o</p>

<p>this is the error i am getting</p>

<pre>
Undefined                       first referenced
 symbol                             in file
message                             hello.o
ld: fatal: Symbol referencing errors. No output written to hello
collect2: ld returned 1 exit status
</pre>

<p>please help me to solve this issue</p>
