# Setting up production environment

**URL:** <https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661>\
**Category:** The Garage\
**Created:** [October 7, 2015, 11:35am UTC](https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661 "2015-10-07T11:35:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sternenfisch](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sternenfisch](https://discourse.cataclysmdda.org/u/Sternenfisch)\
**Post date:** [October 7, 2015, 11:35am UTC](https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661/1 "2015-10-07T11:35:17Z")

</div>

Hi there,

I’m running a Windows 8 Professional on a 64 bit machine and want to compile from source with Code blocks.

All dependencies installed as per Wiki. However upon compile I get the error

In pthread.h endif without if.

I can’t modify or make copy of pthread.h

What am I doing wrong?

Don’t care about the tiles build just want a running compilation and executable.

Please help with your knowledge.

---

<div class="post-metadata">

**Author:** ![Midaychi](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Midaychi](https://discourse.cataclysmdda.org/u/Midaychi)\
**Post date:** [October 7, 2015, 1:38pm UTC](https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661/2 "2015-10-07T13:38:44Z")

</div>

I get something like this on linux 32bit too, compiling with gcc. I had to add -lpthread to the linker options to get it to work. Not sure if it’s the same problem but u can try.

I’m not sure how this would translate to codeblocks, but in the Makefile I had to add a space and then -lpthread to the end of line 131, so it looked like “LDFLAGS += $(PROFILE) -lpthread”

---

<div class="post-metadata">

**Author:** ![Sternenfisch](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sternenfisch](https://discourse.cataclysmdda.org/u/Sternenfisch)\
**Post date:** [October 7, 2015, 2:00pm UTC](https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661/3 "2015-10-07T14:00:20Z")

</div>

So I changed the Linker option.  
Problem persists.

And Inline 131 there is written: DEFINES += - DCROSS\_LINUX

The line you mentioned to add - lpthread to I did not find at all in the makefile.

When I try to edit the problematic pthread.h

It says:  
File c:\program files\codeblocks\MjnGW\pthread.h could not be saved.

Could that be the problem, cause I have installed and tried both ways to compile CDDA.

Is there another way to fix it?

---

<div class="post-metadata">

**Author:** ![IguanaMan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/iguanaman/32/1216_2.png) [@IguanaMan](https://discourse.cataclysmdda.org/u/IguanaMan)\
**Post date:** [October 8, 2015, 11:22am UTC](https://discourse.cataclysmdda.org/t/setting-up-production-environment/10661/4 "2015-10-08T11:22:04Z")

</div>

> <https://github.com/CleverRaven/Cataclysm-DDA/blob/master/COMPILING.md#rough-guide-to-building-with-only-msys2>

Just follow the instructions exactly. I’ve done this recently on a system similar to yours and it works fine.
