Page 1 of 1

ESP-IDF make error after fresh install on Linux: "pthread_t does not name a type"

Posted: Mon Oct 09, 2017 4:23 am
by meowsqueak
I'm replicating my development environment on a Linux host running 64-bit Ubuntu 14.04.5 (up-to-date packages). I'm not able to upgrade this OS unfortunately.

I've installed the xtensa toolchain (5.2.0, crosstool-ng-1.22.0-73-ge28a011, 64-bit) and ESP-IDF (v2.1 branch) as per https://esp-idf.readthedocs.io/en/lates ... setup.html

When I try to make any of my existing projects, or even the ESP-IDF example projects (like hello_world), I get this error when typing 'make' after a 'make menuconfig':

Code: Select all

CXX cxx_guards.o
In file included from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/xtensa-esp32-elf/bits/gthr.h:148:0,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/ext/atomicity.h:35,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.h:39,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/string:52,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/random:40,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algo.h:66,
                 from /home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/algorithm:62,
                 from /home/user/esp32/esp-idf/components/cxx/./cxx_guards.cpp:20:
/home/user/esp32/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/xtensa-esp32-elf/bits/gthr-default.h:47:9: error: 'pthread_t' does not name a type
 typedef pthread_t __gthread_t;
         ^
There are many, many more pthread related errors following that one.

I have libpthread-stubs0-dev:amd64 0.3-4 installed.

I haven't been able to find any similar reports on this forum, the GitHub repo's issues list, or via Google.

The only suspicious thing I've seen is this message that appears first:

Code: Select all

WARNING: Toolchain version is not supported: crosstool-NG crosstool-ng-1.22.0-73-ge28a011
Expected to see version: crosstool-NG crosstool-ng-1.22.0-61-gab8375a
Please check ESP-IDF setup instructions and update the toolchain, or proceed at your own risk.
However I got the toolchain from the location linked in the Linux Setup docs.

I've tried both the ESP-IDF branch "release/v2.1" and the tag "v2.1" with the same result (btw it's not clear to me which of these is actually "version 2.1"). And I do remember to update submodules recursively.

Note: I've done this procedure on both Mac and Windows machines recently without this issue, so I'm reasonably familiar with how it works on those systems, but it seems in this case it's encountering some sort of fatal problem, the cause of which isn't clear to me.

Re: ESP-IDF make error after fresh install on Linux: "pthread_t does not name a type"

Posted: Mon Oct 09, 2017 4:44 am
by ESP_igrr
If you are working with v2.1 release of ESP-IDF (which is v2.1 tag, not release/v2.1 branch), you should follow the instructions under http://esp-idf.readthedocs.io/en/v2.1/ rather than http://esp-idf.readthedocs.io/en/latest/. These instructions will contain the right toolchain download URL (for crosstool-ng-1.22.0-61-gab8375a version).

New toolchain version, crosstool-ng-1.22.0-73-ge28a011, can only be used with the recent master branch (and the upcoming release v3.0).

Re: ESP-IDF make error after fresh install on Linux: "pthread_t does not name a type"

Posted: Mon Oct 09, 2017 4:52 am
by meowsqueak
Ah, thank you for the very fast response. That was exactly the problem. I hadn't realised that "latest" and "2.1" were significantly different, but it makes perfect sense now you mention it.