Sounds like you're not linking to the object file generated from Parameter.cpp.
Jeroen On October 26, 2015 7:28:52 PM GMT+07:00, Apurva Joshi <[email protected]> wrote: >hello all, following is my program...... m executing one step at a time >from moses-cmd/src/main.cpp.... > >#include<iostream> >#include<fstream> >#include<ostream> >#include<cstdlib> >#include<sstream> >#include"ThreadPool.h" >#include"OutputCollector.h" >#include"Parameter.h" > > >using namespace std; >using namespace Moses; > >using namespace std; >class ExampleTask : public Moses::Task >{ >private: >unsigned int m_id; >string m_message; >Moses::OutputCollector* m_collector; >public: >ExampleTask(unsigned int id, string message, Moses::OutputCollector* >collector): >m_id(id), >m_message(message), >m_collector(collector) {} >~ExampleTask() {} >void Run() { >// length of pause >int r = rand()%10; >// pause >int j = 0; >for(int i=0; i<1e8*r; i++) { j+=i; } > > > >// write message (and length of pause) >ostringstream out; >out << m_message << " (" << r << ")" << endl; >m_collector->Write(m_id, out.str()); >} >}; >int main (int argc, char** argv) >{ >// output into file >string outfile = "output-file.txt"; >std::ofstream *outputStream = new ofstream(outfile.c_str()); >Moses::OutputCollector* outputCollector = new >Moses::OutputCollector(outputStream); > >// set up tasks >srand(time(NULL)); >ExampleTask *task0 = new ExampleTask(0,"zero",outputCollector); > >task0->Run(); > >// NEW : problem in below part > >Moses::Parameter params; > if (!params.LoadParam(argc,argv)) { > std::cout<<"\nexit ............\n\n"; > exit(1); > } > else > { > std::cout<<"\nno exit ............\n\n"; > } > >} > > >in above program m transmitting "zero" to class ExampleTask which will >call >function "run()" to print "zero" to output file "output-file.txt" >....its >working correctly...but when i add part NEW ....den its showing me >following error.... > >undefined reference to `Moses::Parameter::Parameter()' >undefined reference to `Moses::Parameter::LoadParam(int, char**)' > > > >actually in my directory , i added "parameter.h" its corresponding >other >file also...and still its showing above error...plz help!!!! ... > >[email protected] > > >------------------------------------------------------------------------ > >_______________________________________________ >Moses-support mailing list >[email protected] >http://mailman.mit.edu/mailman/listinfo/moses-support
_______________________________________________ Moses-support mailing list [email protected] http://mailman.mit.edu/mailman/listinfo/moses-support
