Send Moses-support mailing list submissions to
moses-support@mit.edu
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.mit.edu/mailman/listinfo/moses-support
or, via email, send a message with subject or body 'help' to
moses-support-request@mit.edu
You can reach the person managing the list at
moses-support-owner@mit.edu
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Moses-support digest..."
Today's Topics:
1. undefined reference to `Moses::Parameter::LoadParam(int,
char**)' (Apurva Joshi)
2. Re: undefined reference to `Moses::Parameter::LoadParam(int,
char**)' (Jeroen Vermeulen)
----------------------------------------------------------------------
Message: 1
Date: Mon, 26 Oct 2015 17:58:52 +0530
From: Apurva Joshi <apurvajoshi1992@gmail.com>
Subject: [Moses-support] undefined reference to
`Moses::Parameter::LoadParam(int, char**)'
To: moses-support@mit.edu
Message-ID:
<CAMfCXbVAFR2x+oCq7WdDPMhX6LLvzuNACthEYq8q76ZYFEoX4w@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
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!!!! ...
apurvajoshi1992@gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/moses-support/attachments/20151026/f0b4d3a8/attachment-0001.html
------------------------------
Message: 2
Date: Mon, 26 Oct 2015 21:39:18 +0700
From: Jeroen Vermeulen <jtv@precisiontranslationtools.com>
Subject: Re: [Moses-support] undefined reference to
`Moses::Parameter::LoadParam(int, char**)'
To: Apurva Joshi <apurvajoshi1992@gmail.com>, moses-support@mit.edu
Message-ID:
<AE21B058-0815-493C-9B30-0E4F2B160F14@precisiontranslationtools.com>
Content-Type: text/plain; charset="utf-8"
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 <apurvajoshi1992@gmail.com> 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!!!! ...
>
>apurvajoshi1992@gmail.com
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Moses-support mailing list
>Moses-support@mit.edu
>http://mailman.mit.edu/mailman/listinfo/moses-support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/mailman/private/moses-support/attachments/20151026/453b4afe/attachment-0001.html
------------------------------
_______________________________________________
Moses-support mailing list
Moses-support@mit.edu
http://mailman.mit.edu/mailman/listinfo/moses-support
End of Moses-support Digest, Vol 108, Issue 72
**********************************************
Subscribe to:
Post Comments (Atom)
0 Response to "Moses-support Digest, Vol 108, Issue 72"
Post a Comment