cameron314 / concurrentqueue

A fast multi-producer, multi-consumer lock-free concurrent queue for C++11
Other
9.53k stars 1.66k forks source link

Fix errors in Linux compilation #295

Closed Tiline closed 2 years ago

Tiline commented 2 years ago

Sorry, I encountered the following error when trying to compile the project under Linux:

[build]# make
In file included from ../c_api/blockingconcurrentqueue.cpp:1:0:
../c_api/concurrentqueue.h:25:1: error: ‘MOODYCAMEL_EXPORT’ does not name a type
 MOODYCAMEL_EXPORT int moodycamel_cq_create(MoodycamelCQHandle* handle);
 ...

When I view that macros are undefined, they can only be defined under Windows

I'm not sure if I need to judge other platforms???

cameron314 commented 2 years ago

When I view that macros are undefined, they can only be defined under Windows

Where do you see this? In the original code, the #ifdef _WIN32 is matched with an #else #define MOODYCAMEL_EXPORT.

Judging from the line number in your error message, it seems likely you're using an older version of the library which had this bug (fixed about a year ago: https://github.com/cameron314/concurrentqueue/commit/e6fec438e8639221d43dae4b2ddf133e20580fdd).