progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.64k stars 2.21k forks source link

Errors on VS2012 #15

Closed bnascimento closed 9 years ago

bnascimento commented 9 years ago

I have a bunch of errors using visual studio 2012.

e.g. Error 1 error C2332: 'class' : missing tag name

Can anyone help?

fwsGonzo commented 9 years ago

You need to show all the errors, as you simply pasted the least useful error. The only thing I can tell you is that you made a mistake, and are either re-defining something that already exists (declared with a typedef) or you are missing braces. One of the errors can be something like C2011: '' : 'enum' type redefinition, which tells you that an enum with the same name already exists.

So no, no one can help you until you provide ALL the information needed for us to help you. :+1:

EDIT: a classic mistake is that you have a typedef for some type that matches the name of a private member of a class, say: int private_member;

Elsewhere in your code you have a typedef: typedef struct s private_member;

In your class, this then turns into: int struct;

bnascimento commented 9 years ago

Error 6 error C2332: 'class' : missing tag name c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 17 FRTester Error 7 error C2872: '' : ambiguous symbol c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 17 FRTester Error 8 error C2011: '' : 'enum' type redefinition c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 17 FRTester Error 9 error C2143: syntax error : missing ',' before '...' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 17 FRTester Error 10 error C2061: syntax error : identifier 'Args' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 18 FRTester Error 11 error C2065: 'Args' : undeclared identifier c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 19 FRTester Error 12 error C2143: syntax error : missing ')' before '...' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 19 FRTester Error 13 error C2039: 'type' : is not a member of '`global namespace'' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 19 FRTester Error 14 error C2143: syntax error : missing ';' before '}' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 31 FRTester Error 15 error C2143: syntax error : missing ';' before '{' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 36 FRTester Error 16 error C2143: syntax error : missing ';' before '{' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 40 FRTester Error 17 error C2143: syntax error : missing ')' before ';' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 41 FRTester Error 18 error C2143: syntax error : missing ';' before '{' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 42 FRTester Error 19 error C2143: syntax error : missing ';' before '}' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 52 FRTester Error 20 error C2143: syntax error : missing ';' before '}' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 53 FRTester Error 21 error C2059: syntax error : ')' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 54 FRTester Error 22 error C2143: syntax error : missing ';' before '}' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 55 FRTester Error 23 error C2649: 'typename' : is not a 'class' c:\users\bnascimento\projects\fr\frtester\ThreadPool.h 58 FRTester

progschj commented 9 years ago

Looks to me like your version of VS2012 simply doesn't support support variadic templates?

bnascimento commented 9 years ago

http://stackoverflow.com/questions/19080108/visual-studio-2012-update-3-initializer-list-variadic-templates

yes you beat me to it.