# Can't compile tiles, undefined variables :S

**URL:** <https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639>\
**Category:** The Toolbox\
**Created:** [November 26, 2018, 10:37pm UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639 "2018-11-26T22:37:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lscruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lscruz/32/3774_2.png) [@lscruz](https://discourse.cataclysmdda.org/u/lscruz)\
**Post date:** [November 26, 2018, 10:37pm UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/1 "2018-11-26T22:37:04Z")

</div>

Hi people! don’t know if this is the correct category lol  
when compiling lastest experimental in Linux i get the following warning:

```auto
 src/sdltiles.cpp: In function ‘curses_drawwindow’:
src/mapdata.h:254:0: error: ‘connect_group’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
             return ( connect_group != TERCONN_NONE ) && ( connect_group == test_connect_group );
 ^
src/cata_tiles.cpp:2224:9: note: ‘connect_group’ was declared here
     int connect_group;
         ^
lto1: all warnings being treated as errors

```

connect\_group used is actually declared in mapdata.h:248 and yeah… it MAY BE uninitialized.  
I could just initialize it to TERCONN\_NONE which seems default but wanted some input on it… or some way to disable warnings :P.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [November 27, 2018, 12:00am UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/2 "2018-11-27T00:00:02Z")

</div>

Initializing it is the way to go, but it’s strange that it’s not erroring in mainline, we definitely have -Wall -Werror set. I wonder if this is occurring with LTO only, I don’t think we’re using it in official builds.

As for disabling warnings, I believe you can set a variable to inject the appropriate -Wno-whatever-warning flag, but I don’t recall what it is offhand. There’s a big block of comments at the top of the Makefile outlining configuration options.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [November 27, 2018, 7:33am UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/3 "2018-11-27T07:33:08Z")

</div>

What’s your `make` command line?

---

<div class="post-metadata">

**Author:** ![lscruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lscruz/32/3774_2.png) [@lscruz](https://discourse.cataclysmdda.org/u/lscruz)\
**Post date:** [November 27, 2018, 6:33pm UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/4 "2018-11-27T18:33:21Z")

</div>

Strange indeed, tried without LTO with same results.  
I use: make -j4 CCACHE=1 TILES=1 LTO=1 SOUND=1 LUA=1 RELEASE=1 LOCALIZE=0

---

<div class="post-metadata">

**Author:** ![Treah](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/treah/32/194_2.png) [@Treah](https://discourse.cataclysmdda.org/u/Treah)\
**Post date:** [November 28, 2018, 4:56pm UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/5 "2018-11-28T16:56:09Z")

</div>

Try building with this command line  
be sure to perform a make clean before you start.  
`make TILES=1 SOUND=1 RELEASE=1 LOCALIZE=0`

I was able to successfully compile mainline just fine with these switches.

---

<div class="post-metadata">

**Author:** ![lscruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lscruz/32/3774_2.png) [@lscruz](https://discourse.cataclysmdda.org/u/lscruz)\
**Post date:** [November 28, 2018, 8:34pm UTC](https://discourse.cataclysmdda.org/t/cant-compile-tiles-undefined-variables-s/17639/6 "2018-11-28T20:34:01Z")

</div>

Thanks! that worked great, added lua also without problem.
