[Compilation] Cannot use FPThreadsCriticalSection

Hi everyone,

I am trying to use threads and mutex in my project. To do that, I use FRunnableThread and FPThreadsCriticalSection. I have no problem with the implementation of FRunnableThread, but as soon as I tryed to use FPThreadsCriticalSection, I got compilation errors.

The first one was that VS didn’t find “pthread.h”, so I have install a Windows implementation of it, and then VS find it. But now, I have another issue : the linker doesn’t seems to find the library…

I am getting this error :

error LNK2019: unresolved external symbol __imp_pthread_mutexattr_init referenced in function “public: __cdecl FPThreadsCriticalSection::FPThreadsCriticalSection(void)” (??0FPThreadsCriticalSection@@QEAA@XZ)

I have add the library to the LIB variable, but it doesn’t change anything.

Is anyone have an idea of what is going on ?

Thanks !

Hey !

I also have the same problem, still searching why…
I hope that someone can give us some informations about that.

Hey - you probably want to be using FCriticalSection, rather than the pthread implementation?

Thanks, it compile now :slight_smile:

I did’nt get that there was another CriticalSection…

The funny part is that… it’s the same, right?

Heh :slight_smile:

Only if PLATFORM_USE_PTHREADS is true, which it won’t on Windows. In that case FCriticalSection is defined in WindowsPlatformProcess.h.

1 Like