Have a Problem in compiling a Sample smile Progrm ( ubuntu )

The engine.
Post Reply
cheetiabhi
Posts: 2
Joined: Thu Jan 24, 2013 6:03 pm

Have a Problem in compiling a Sample smile Progrm ( ubuntu )

Post by cheetiabhi »

Hello,

Can you helping me in compiling a sample tutorial program of smile in ubuntu. I am a new user of smile. I am in need of compilation steps to do it ubuntu.
When i try to compile a code i am getting some errors like :

abhi@ubuntu:~/Desktop/smile_linux_x64_gcc_4_4_5$ g++ hello.cpp -o hello
/tmp/ccxN6xrF.o: In function `CreateDataset()':
hello.cpp:(.text+0x55b): undefined reference to `DSL_dataset::DSL_dataset()'
hello.cpp:(.text+0x5a0): undefined reference to `DSL_dataset::AddIntVar(std::string, int)'
hello.cpp:(.text+0x623): undefined reference to `DSL_dataset::AddFloatVar(std::string, float)'
hello.cpp:(.text+0x652): undefined reference to `DSL_dataset::SetNumberOfRecords(int)'
/tmp/ccxN6xrF.o: In function `DSL_dataset::~DSL_dataset()':
hello.cpp:(.text._ZN11DSL_datasetD2Ev[_ZN11DSL_datasetD5Ev]+0x15): undefined reference to `DSL_dataset::FreeData()'
/tmp/ccxN6xrF.o: In function `DSL_dataset::GetNumberOfRecords() const':
hello.cpp:(.text._ZNK11DSL_dataset18GetNumberOfRecordsEv[_ZNK11DSL_dataset18GetNumberOfRecordsEv]+0x21): undefined reference to `DSL_dataset::GetRealRowCount() const'
/tmp/ccxN6xrF.o: In function `DSL_dataset::GetInt(int, int) const':
hello.cpp:(.text._ZNK11DSL_dataset6GetIntEii[_ZNK11DSL_dataset6GetIntEii]+0x23): undefined reference to `DSL_dataset::ValidateIdx(int, int) const'
/tmp/ccxN6xrF.o: In function `DSL_dataset::GetFloat(int, int) const':
hello.cpp:(.text._ZNK11DSL_dataset8GetFloatEii[_ZNK11DSL_dataset8GetFloatEii]+0x23): undefined reference to `DSL_dataset::ValidateIdx(int, int) const'
/tmp/ccxN6xrF.o: In function `DSL_dataset::SetInt(int, int, int)':
hello.cpp:(.text._ZN11DSL_dataset6SetIntEiii[_ZN11DSL_dataset6SetIntEiii]+0x26): undefined reference to `DSL_dataset::ValidateIdx(int, int) const'
/tmp/ccxN6xrF.o: In function `DSL_dataset::SetFloat(int, int, float)':
hello.cpp:(.text._ZN11DSL_dataset8SetFloatEiif[_ZN11DSL_dataset8SetFloatEiif]+0x28): undefined reference to `DSL_dataset::ValidateIdx(int, int) const'
/tmp/ccxN6xrF.o: In function `DSL_dataset::IsMissing(int, int) const':
hello.cpp:(.text._ZNK11DSL_dataset9IsMissingEii[_ZNK11DSL_dataset9IsMissingEii]+0x77): undefined reference to `DSL_dataset::IsMissingFloat(int, int, float) const'
collect2: error: ld returned 1 exit status
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Have a Problem in compiling a Sample smile Progrm ( ubun

Post by shooltz[BayesFusion] »

You're getting linker errors, because you didn't specify the libraries to link with. Add "-lsmilearn -lsmile" to your g++ command line.
Post Reply