jbattini / fast-cpp-csv-parser

Automatically exported from code.google.com/p/fast-cpp-csv-parser
0 stars 0 forks source link

Unable to compilte using #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. g++ main.cpp -o t.exe -std=c++0x -lpthread
2.
3.

What is the expected output? What do you see instead?

C:\Users\Hassan\Documents\NetBeansProjects\MALT-extractor>g++ main.cpp -o t.exe 
-std=c++0x -lpthread
In file included from main.cpp:9:0:
csv.h:102:19: error: field 'bytes_read' has incomplete type
csv.h: In member function 'void io::LineReader::init()':
csv.h:145:5: error: 'bytes_read' was not declared in this scope
csv.h:147:6: error: invalid use of incomplete type 'struct std::future<int>'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/future:111:11: error: 
declaration of 'struct std::future<int>'
csv.h: In member function 'char* io::LineReader::next_line()':
csv.h:214:8: error: 'bytes_read' was not declared in this scope
csv.h:220:7: error: invalid use of incomplete type 'struct std::future<int>'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/future:111:11: error: 
declaration of 'struct std::future<int>'
csv.h: In destructor 'io::LineReader::~LineReader()':
csv.h:256:7: error: 'bytes_read' was not declared in this scope
In file included from main.cpp:9:0:
csv.h: In constructor 'io::CSVReader<column_count, trim_policy, quote_policy, 
overflow_policy, comment_policy>::CSVReader(Args ...)':
csv.h:877:31: error: 'to_string' is not a member of 'std'
main.cpp: In function 'int main(int, char**)':
main.cpp:28:7: error: 'cout' is not a member of 'std'
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/future: At global scope:
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/future:143:5: error: 
'std::future<typename std::result_of<_Functor(_ArgTypes ...)>::type> std::async
(std::launch, _Fn&&, _Args&& ...) [with _Fn = 
io::LineReader::init()::<lambda()>, _Args = {}, typename 
std::result_of<_Functor(_ArgTypes ...)>::type =
 int]', declared using local type 'io::LineReader::init()::<lambda()>', is used but never defined [-fpermissive]
c:\mingw\bin\../lib/gcc/mingw32/4.6.2/include/c++/future:143:5: error: 
'std::future<typename std::result_of<_Functor(_ArgTypes ...)>::type> std::async
(std::launch, _Fn&&, _Args&& ...) [with _Fn = 
io::LineReader::next_line()::<lambda()>, _Args = {}, typename 
std::result_of<_Functor(_ArgTypes ...)>::t
ype = int]', declared using local type 
'io::LineReader::next_line()::<lambda()>', is used but never defined 
[-fpermissive]

What version of the product are you using? On what operating system?
I am using mingw ( gcc 4.6.2) on windows vista

Please provide any additional information below.

Original issue reported on code.google.com by hassanba...@gmail.com on 25 Jan 2013 at 9:26

GoogleCodeExporter commented 8 years ago
I think the main error is this one:

csv.h:102:19: error: field 'bytes_read' has incomplete type 

which claims that std::future<int> has not been defined, which is strange as 
<future> is included. Does the future example from 
http://en.cppreference.com/w/cpp/thread/future compile and run? If it does not 
then the problem is with your compiler. If it does could you provide the 
main.cpp file.

Original comment by strasser...@gmail.com on 25 Jan 2013 at 2:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Have you tried the minimal examples from 
http://en.cppreference.com/w/cpp/thread/future ? I do not have access to a 
MinGW compiler and can therefore not test whether incomplete C++11 support is 
indeed the culprit as I suspect.

Regards

Original comment by strasser...@gmail.com on 28 Jan 2013 at 10:30

GoogleCodeExporter commented 8 years ago
It seems that future is not supported yet on MinGW

http://stackoverflow.com/questions/10209871/c11-stdasync-doesnt-work-in-mingw

Regards

Original comment by hassanba...@gmail.com on 29 Jan 2013 at 1:15

GoogleCodeExporter commented 8 years ago
You can try making bytes_read and int and replacing all instances of 
bytes_read.get() with the code that was delegated to the future. This way it 
might work on your compiler. If you do this then please post your code so that 
other people using this MinGW version can use it too.

Original comment by strasser...@gmail.com on 30 Jan 2013 at 2:39