I have written a project (consisting of several cpp and h files) in MS Visual Studio 2015 on Windows but I need to run it on Ubuntu. Is there any way I can do this? I tried by simply witting
$ g++ -std=c++0x *.cpp
but I get a lot of errors:
In file included from DataTable.cpp:1:0:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
DataTable.cpp: In member function ‘void DataTable::printTable(std::ostream&)’:
DataTable.cpp:12:22: error: ‘data’ was not declared in this scope
DataTable.cpp: In member function ‘void DataTable::addData(std::string)’:
DataTable.cpp:22:8: error: ‘class DataTable’ has no member named ‘data’
In file included from ElfSymbol.h:7:0,
from ElfSymbol.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from LineParser.h:11,
from Instruction.h:5,
from Instruction.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from Instruction.h:5:0,
from Instruction.cpp:1:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
In file included from Instruction.cpp:1:0:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
Instruction.cpp: In member function ‘void Instruction::setAddr(std::string)’:
Instruction.cpp:59:2: error: ‘addr’ was not declared in this scope
Instruction.cpp: In member function ‘std::string Instruction::getAddr()’:
Instruction.cpp:64:9: error: ‘addr’ was not declared in this scope
Instruction.cpp: In member function ‘std::string Instruction::getDataString()’:
Instruction.cpp:130:15: error: ‘addr’ was not declared in this scope
Instruction.cpp:141:15: error: ‘addr’ was not declared in this scope
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from LineParser.h:11,
from LineParser.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from LineParser.cpp:1:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from LineParser.cpp:1:0:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
LineParser.cpp:7:13: error: ‘instructionStrings’ is not a member of ‘LineParser’
LineParser.cpp:7:13: error: ‘instructionStrings’ is not a member of ‘LineParser’
LineParser.cpp:7:43: error: template argument 2 is invalid
LineParser.cpp:7:43: error: template argument 4 is invalid
LineParser.cpp:7:71: error: invalid type in declaration before ‘;’ token
LineParser.cpp: In static member function ‘static bool LineParser::isInstruction(std::string, SymbolTable)’:
LineParser.cpp:412:14: error: ‘instructionStrings’ was not declared in this scope
LineParser.cpp:412:32: error: template argument 2 is invalid
LineParser.cpp:412:32: error: template argument 4 is invalid
LineParser.cpp:412:44: error: expected initializer before ‘it’
LineParser.cpp:413:6: error: ‘it’ was not declared in this scope
LineParser.cpp:413:27: error: request for member ‘end’ in ‘LineParser::instructionMap’, which is of non-class type ‘int’
LineParser.cpp: In static member function ‘static void LineParser::initializeInsMap()’:
LineParser.cpp:1622:26: error: ‘INT’ was not declared in this scope
LineParser.cpp:1623:26: error: ‘JMP’ was not declared in this scope
LineParser.cpp:1624:27: error: ‘CALL’ was not declared in this scope
LineParser.cpp:1625:26: error: ‘RET’ was not declared in this scope
LineParser.cpp:1626:25: error: ‘JZ’ was not declared in this scope
LineParser.cpp:1627:26: error: ‘JNZ’ was not declared in this scope
LineParser.cpp:1628:26: error: ‘JGZ’ was not declared in this scope
LineParser.cpp:1629:27: error: ‘JGEZ’ was not declared in this scope
LineParser.cpp:1630:26: error: ‘JLZ’ was not declared in this scope
LineParser.cpp:1631:27: error: ‘JLEZ’ was not declared in this scope
LineParser.cpp:1633:27: error: ‘LOAD’ was not declared in this scope
LineParser.cpp:1634:29: error: ‘LOADUB’ was not declared in this scope
LineParser.cpp:1635:29: error: ‘LOADSB’ was not declared in this scope
LineParser.cpp:1636:29: error: ‘LOADUW’ was not declared in this scope
LineParser.cpp:1637:29: error: ‘LOADSW’ was not declared in this scope
LineParser.cpp:1639:28: error: ‘STORE’ was not declared in this scope
LineParser.cpp:1640:29: error: ‘STOREB’ was not declared in this scope
LineParser.cpp:1641:29: error: ‘STOREW’ was not declared in this scope
LineParser.cpp:1643:27: error: ‘PUSH’ was not declared in this scope
LineParser.cpp:1644:26: error: ‘POP’ was not declared in this scope
LineParser.cpp:1646:26: error: ‘ADD’ was not declared in this scope
LineParser.cpp:1647:26: error: ‘SUB’ was not declared in this scope
LineParser.cpp:1648:26: error: ‘MUL’ was not declared in this scope
LineParser.cpp:1649:26: error: ‘DIV’ was not declared in this scope
LineParser.cpp:1650:26: error: ‘MOD’ was not declared in this scope
LineParser.cpp:1651:26: error: ‘AND’ was not declared in this scope
LineParser.cpp:1652:25: error: ‘OR’ was not declared in this scope
LineParser.cpp:1653:26: error: ‘XOR’ was not declared in this scope
LineParser.cpp:1654:26: error: ‘NOT’ was not declared in this scope
LineParser.cpp:1655:26: error: ‘ASL’ was not declared in this scope
LineParser.cpp:1656:26: error: ‘ASR’ was not declared in this scope
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from main.cpp:9:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from SymbolTable.h:7,
from main.cpp:9:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from SymbolTable.h:7:0,
from main.cpp:9:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
In file included from ElfSymbol.h:7:0,
from SymbolTable.h:6,
from SymbolTable.cpp:1:
DataTable.h:9:14: sorry, unimplemented: non-static data member initializers
DataTable.h:9:14: error: in-class initialization of static data member ‘data’ of non-literal type
In file included from LineParser.h:12:0,
from SymbolTable.h:7,
from SymbolTable.cpp:1:
Instruction.h:18:14: sorry, unimplemented: non-static data member initializers
Instruction.h:18:14: error: in-class initialization of static data member ‘addr’ of non-literal type
In file included from SymbolTable.h:7:0,
from SymbolTable.cpp:1:
LineParser.h:27:7: error: use of enum ‘instructionStrings’ without previous declaration
LineParser.h:31:21: error: ‘instructionStrings’ was not declared in this scope
LineParser.h:31:39: error: template argument 2 is invalid
LineParser.h:31:39: error: template argument 4 is invalid
But it all worked without an error on VS.