Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Type 'pthread_cond_t' could not be resolved(Settings GCC (ARM-Linux) in Eclipse Mars for 'C project)
Type 'pthread_cond_t' could not be resolved [message #1726718] Tue, 15 March 2016 21:30
dh 29 is currently offline dh 29Friend
Messages: 1
Registered: March 2016
Junior Member
I am experimenting with cross compiling for ARM-Linux under Windows using Eclipse-Mars. My set-up is as follows:

    Win10 x64
    Eclipse Mars.2 Release (4.5.2)
    GNU Toolchain for RaspberryPi (SysGCC)
    Target platform: RaspberryPi2 running Raspian
    Source project in 'C (not C++) using Linux Threads (pthreads)

I have knocked up a small 'C project using 'pthreads' which compiles under Eclipse and runs successfully on the Pi.

My problem is that Eclipse shows a number of errors in its Problems TAB to do with Linux's threads:

    Type 'pthread_cond_t' could not be resolved
    Type 'pthread_mutex_t' could not be resolved
    Type 'pthread_t' could not be resolved

My 'C source code includes a reference to #include <pthread.h>.

pthread.h lives in directory /SysGCC/Raspberry/arm-linux-gnueabihf/sysroot/usr/include and is referenced in my Eclipse Project Explorer Includes as shown:

index.php/fa/25318/0/

Cross GCC Compiler settings are to use g++ with -std=c++11 -O0 -g3 -Wall -c -fmessage-length=0.

Cross G++ Compiler settings to use g++ with -std=c++11 -O0 -g3 -Wall -c -fmessage-length=0.

In other words both are the same.

If I rename my source files from foo.c to foo.cpp and recompile, then the Eclipse errors disappear! This implies that Eclipse's C++ settings are correct, but its 'C settings are not??

If I manually add a specific reference to pthread.h in Eclipse's C/C++ Build -> Settings -> Cross GCC Compiler ->Includes then the errors disappear:

index.php/fa/25319/0/

Why do I need to explicitly reference pthread.h within Eclipse's C/C++ Build -> Settings -> Cross GCC Compiler ->Includes in order to keep Eclipse happy?
Previous Topic:useing random in Eclipse
Next Topic:"Open element" function's weird behavior
Goto Forum:
  


Current Time: Tue Mar 19 07:13:20 GMT 2024

Powered by FUDForum. Page generated in 0.01995 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top