Yocto ADT Eclipse Plugin C++11 (Autotools) configuration

显示  仅  | 搜索替代 

Yocto ADT Eclipse Plugin C++11 (Autotools) configuration

1,407 次查看
Contributor II

Hi everyone,


I am using an iMX6UL EVK with a custom, working, image generated with Yocto.

I would like to use Eclipse to develop C++ applications for this target, I then used :

bitbake my-image -c populate_sdk

bitbake meta-ide-support

This gave me an SDK and toolchain that I installed by executing the generated script.

I configured the Eclipse IDE (Mars.2) to use Yocto ADT Plugin, and configured it to use my SDK and  toolchain.

I created a new C++ application (Yocto Autotools Hello World Project), built and deployed the template without any error (It successfully ran on the target board).

Problem :

But the problem is that when I create a "more" complex application and have to use C++11, I can't compile anymore (The compiler is complaining about C++11 compatibility).

#error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

I got rid of this error by adding in Project Properties -> Autotools -> Configure -> Advanced :

CXXFLAGS="${CXXFLAGS} -std=gnu++11" CPPFLAGS="${CPPFLAGS} -std=gnu++11"

But then came other (ugly) errors:

undefined reference to `Audio::Audio(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

undefined reference to `Audio::~Audio()'

For reference this is my Audio class:


#include <iostream>

#include <string>

#include <cstdint>

#include <alsa/asoundlib.h>

#define SAMPLE_SIZE (sizeof(int))     // bytes per sample

typedef struct {

    int numSamples;

    short *pData;

} wavedata_t;

class Audio {


    Audio(std::string pcm_device = "default");

    virtual ~Audio();

    bool playbackFile(std::string path);


    snd_pcm_t *pcm_handle;

    bool configurePCM(std::string pcm_device, uint channels = 2, uint sampleRate = 44100, snd_pcm_format_t format = SND_PCM_FORMAT_S16_LE, snd_pcm_access_t access = SND_PCM_ACCESS_RW_INTERLEAVED);

    bool closePCM();

    // Helpers

    bool loadWavFile(std::string path, wavedata_t *pWaveStruct);



#include "Audio.h"

Audio::Audio(std::string pcm_device) {



Audio::~Audio() {



bool Audio::playbackFile(std::string path) {



bool Audio::configurePCM(std::string pcm_device, uint channels, uint sampleRate, snd_pcm_format_t format, snd_pcm_access_t access) {



bool Audio::closePCM() {



// Read in the file to dynamically allocated memory.

// !! Client code must free memory in wavedata_t !!

bool Audio::loadWavFile(std::string path, wavedata_t *pWaveStruct)




Question :

How should I configure Eclipse to successfully compile C++11 applications using Autotools via Yocto ADT Plugin ?

Thanks in advance. :smileyhappy:

Arnaud (France)

标签 (2)
0 项奖励
2 回复数

680 次查看
NXP Employee
NXP Employee


  According to https://www.kernel.org/doc/

C99 standard (current version of the C programming language) is supported.

So, it is good idea to use it with Linux apps.

Have a great day,

Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 项奖励

680 次查看
Contributor II

Thank you for your reply,

But what if I must use C++11 ? What should I do to make it work ?

Thank you


0 项奖励