I am trying to compile a C ++ program with multiple files!
mainfile.cc
#include<iostream> #include "funcfile.hh" int main() { init(); }
funcfile.hh
#include<iostream> void init();
funcfile.cc
#include<iostream> #include "funcfile.hh" using namespace std; void init() { cout<<"hi"<<endl; }
I am creating a binary as shown below:
> CC funcfile.cc mainfile.cc -o output funcfile.cc: mainfile.cc: ld: warning: symbol .dynsym[19] has invalid section index; ignored: (file /usr/local/opt/SunWorkShop/sws_5.0/SUNWspro/lib/libm.so value=19);
And when I execute the output:
> ./output hi >
But my concern here is that I have to take care of the message at compile time:
ld: warning: symbol .dynsym[19] has invalid section index; ignored: (file /usr/local/opt/SunWorkShop/sws_5.0/SUNWspro/lib/libm.so value=19);
CC Version:
> CC -V CC: WorkShop Compilers 5.0 98/12/15 C++ 5.0
source share