progschj / ThreadPool

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

Duplicate symbol #7

Closed iliocatallo closed 11 years ago

iliocatallo commented 11 years ago

Hi,

If I try to include ThreadPool.h in in different source files in my project, the linker starts complaining about duplicate symbols. I'm using XCode 4.6.1 (clang 4.2).

Thanks.

progschj commented 11 years ago

I assume all the nontemplate members need to be put in a cpp file for that to work. Alternatively we could think of an excuse to make ThreadPool a template itself :D (like having a scheduling policy parameter).

iliocatallo commented 11 years ago

So, if I got it right, it is sufficient to move all non-tempalate members in a hypothetical ThreadPool.cpp file. I'll try ASAP ;)

progschj commented 11 years ago

I fixed this on the develop branch by declaring the nontemplates inline.