x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[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 !

Product Version: Not Selected
Tags:
more ▼

asked Mar 23 '15 at 02:08 PM in C++ Programming

avatar image

Ismuur
118 11 13 18

avatar image Blue Ninja Apr 01 '15 at 09:07 AM

Hey !

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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

more ▼

answered Apr 01 '15 at 12:51 PM

avatar image

BrɑκеPɑd STAFF
1.4k 33 22 78

avatar image Ismuur Apr 01 '15 at 02:46 PM

Thanks, it compile now :)

I did'nt get that there was another CriticalSection...

avatar image etbh Apr 29 '15 at 12:14 AM

The funny part is that... it's the same, right?

avatar image BrɑκеPɑd STAFF Apr 29 '15 at 07:46 AM

Heh :)

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question