mhoopmann / mstoolkit

Automatically exported from code.google.com/p/mstoolkit
27 stars 10 forks source link

Compiling using libmstoolkit.a error: 'f_off' doe not name a type #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I'm trying to write a program that uses mstoolkit to read mz* files.
Ultimately I want to create a function where you pass it a file name and a scan 
Id and the function returns a map<double, double> of the spectrum. So far I'm 
not having much luck compiling with the library. Here is what I've done:

Downloaded revision 44 from SVN.
Successfully compiled the static library in linux (Centos 6.4). 

Tried to compile this main function using the library. 
Here is the main.cpp file:
/********************************************************/
#include <iostream>
#include <string>
#include <map>
#include "MSReader.h"

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    MSReader X; // just testing this out.
    return 0;
}
/******************************************************/

Compile command: 
g++ -O2 -Imstoolkit/include -Lmstoolkit -llibmstoolkit main.cpp -o testApp.exe

This is the error:
In file included from mstoolkit/include/MSReader.h:6,                           

                 from main.cpp:4:                                                      
mstoolkit/include/mzParser.h:144: error: ‘f_off’ does not name a type       

mstoolkit/include/mzParser.h:300: error: ‘f_off’ does not name a type       

mstoolkit/include/mzParser.h:301: error: ‘f_off’ does not name a type       

mstoolkit/include/mzParser.h:320: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:320: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:321: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:322: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:323: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:324: error: ‘f_off’ has not been declared      

mstoolkit/include/mzParser.h:325: error: ‘f_off’ does not name a type       

mstoolkit/include/mzParser.h:332: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:336: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:339: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:366: error: ‘f_off’ has not been declared
mstoolkit/include/mzParser.h:411: error: ‘f_off’ does not name a type
In file included from mstoolkit/include/MSReader.h:6,
                 from main.cpp:4:
mstoolkit/include/mzParser.h:443: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:476: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:515: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:531: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:563: error: ‘f_off’ does not name a type
In file included from mstoolkit/include/MSReader.h:6,
                 from main.cpp:4:
mstoolkit/include/mzParser.h:1118: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:1146: error: ‘f_off’ does not name a type
mstoolkit/include/mzParser.h:1216: error: ‘ramp_fileoffset_t’ does not name 
a type
mstoolkit/include/mzParser.h:1246: error: ‘ramp_fileoffset_t’ does not name 
a type
mstoolkit/include/mzParser.h:1256: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1257: error: expected constructor, destructor, or 
type conversion before ‘*’ token
mstoolkit/include/mzParser.h:1258: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1260: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1261: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1262: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1269: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1270: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1271: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1280: error: ‘ramp_fileoffset_t’ has not been 
declared
mstoolkit/include/mzParser.h:1281: error: ‘ramp_fileoffset_t’ has not been 
declared
In file included from main.cpp:4:
mstoolkit/include/MSReader.h:127: error: ISO C++ forbids declaration of 
‘ramp_fileoffset_t’ with no type
mstoolkit/include/MSReader.h:127: error: expected ‘;’ before ‘*’ token

Any help will be greatly appreciated. 

Original issue reported on code.google.com by damian.f...@gmail.com on 15 Apr 2013 at 2:01

GoogleCodeExporter commented 9 years ago
Hi Damian,

Sorry for the slow reply. I'll need to set up some sort of email alert. My bad.

Try adding -DGCC to your command line when compiling with g++

Cheers,
Mike

Original comment by mhoopm...@systemsbiology.org on 24 Apr 2013 at 5:23

GoogleCodeExporter commented 9 years ago

Original comment by mhoopm...@systemsbiology.org on 12 Aug 2014 at 4:17