I'm trying to get some sample code to work happily with OpenMS and running into a great deal of trouble. I have (just a small sample program that shipped as an example):
#include <OpenMS/FILTERING/SMOOTHING/GaussFilter.h>
#include <OpenMS/FORMAT/MzMLFile.h>
#include <OpenMS/KERNEL/StandardTypes.h>
#include <stdio.h>
using namespace OpenMS;
using namespace std;
Int main(){
PeakMap exp;
MzMLFile mzdata_file;
mzdata_file.load("../sampledata_Centroidmode.mzML",exp);
GaussFilter g;
Param param;
param.setValue("gaussian_width",1.0);
g.setParameters(param);
g.filterExperiment(exp);
return 0;
}
And I compile it:
g++ -Wall -IOpenMS-1.7.0/include -IOpenMS-1.7.0/contrib/include -I/Library/Frameworks/QtCore.framework/Headers -arch i386 scratch.cpp
It comes up with a boatload of errors (about ~500Kb of them, actually). The problem seems to lie in "using namespace OpenMS;" A small sample of the errors:
Undefined symbols:
"OpenMS::DataValue::DataValue(int)", referenced from:
OpenMS::Internal::MzMLHandler<OpenMS::MSExperiment<OpenMS::Peak1D, OpenMS::ChromatogramPeak> >::handleUserParam_(OpenMS::String const&, OpenMS::String const&, OpenMS::String const&, OpenMS::String const&, OpenMS::String const&)in cc7cSzjW.o
"OpenMS::DataValue::DataValue()", referenced from:
OpenMS::Internal::MzMLHandler<OpenMS::MSExperiment<OpenMS::Peak1D, OpenMS::ChromatogramPeak> >::handleUserParam_(OpenMS::String const&, OpenMS::String const&, OpenMS::String const&, OpenMS::String const&, OpenMS::String const&)in cc7cSzjW.o
"OpenMS::SourceFile::operator!=(OpenMS::SourceFile const&) const", referenced from:
OpenMS::Internal::MzMLHandler<OpenMS::MSExperiment<OpenMS::Peak1D, OpenMS::ChromatogramPeak> >::writeTo(std::basic_ostream<char, std::char_traits<char> >&)in cc7cSzjW.o
OpenMS::Internal::MzMLHandler<OpenMS::MSExperiment<OpenMS::Peak1D, OpenMS::ChromatogramPeak> >::writeTo(std::basic_ostream<char, std::char_traits<char> >&)in cc7cSzjW.o
OpenMS::Internal::MzMLHandler<OpenMS::MSExperiment<OpenMS::Peak1D, OpenMS::ChromatogramPeak> >::writeTo(std::basic_ostream<char, std::char_traits<char> >&)in cc7cSzjW.o
...
ld: symbol(s) not found
collect2: ld returned 1 exit status
Does anyone have insight as to what I'm not doing right?
Try compiling it to an object file (-c) and see if the problems still occur. E..g.: Is this a compiling issue or a linking issue?
Also: Should there be a -L flag to search a particular library path? Should there be a -l flag to link in a particular library?