LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C++11 support for NI Linux

Solved!
Go to solution

Hello,

 

I'm using "C/C++ Development Tools for NI Linux Real-Time, Eclipse Edition 2014-2016" to import existing code onto my NI Linux system. I'm getting the following error,

 

error: #error This compiler supports neither __func__ nor __FUNCTION__

My first question is... does this compiler support C++11? I could not find any documentation to claim or deny support.

 

0 Kudos
Message 1 of 8
(4,231 Views)

After a little digging I learned that NI's cross compiler tools distribute GCC/G++ 4.7.2. According to (https://gcc.gnu.org/gcc-4.7/cxx0x_status.html) C++11 can be enabled using either -std=c++11 or -std=gnu++11 . 

 

My reason in asking is the __func__   symbol is not defined. According to the reference above it is if one of the listed flags is used. However, even when I use one of these flags __func__  is still not defined/supported.

 

Thoughts? 

0 Kudos
Message 2 of 8
(4,217 Views)

Does your question have anything to do with LabVIEW?  Because you posted in the LabVIEW forum.

0 Kudos
Message 3 of 8
(4,197 Views)

__func__ is defined in C99. Should work in gcc.

 

And I agree, it's not a LabVIEW topic.

0 Kudos
Message 4 of 8
(4,175 Views)

 

My apologies for the misplacement of the question. I guess since I am using the NI cross-compiler toolchain to run on the NI LabVIEW target I naturally turned to the NI LabVIEW forum. Would this fit better under the "REAL-TIME MEASUREMENT AND CONTROL" forum?

 

The cross compiler provided by NI does not have __func__ defined for some reason...

0 Kudos
Message 5 of 8
(4,161 Views)

Not sure how that SO post answers your question. It was the first hit I got when googling for your question. It only tells how __func__ works and how to use it. And that it's defined in C99...

 

And yes, the other forum might have been better (it might be less active, not sure). No biggy: your reasoning to post it here make sense. It's not the perfect place, but it's not totally OT.

0 Kudos
Message 7 of 8
(4,144 Views)

I was not able to compile due to the issue discussed on the SO posting. I had read in some other forums that __func__ support was newly added in the g++ compiler in 4.7.x but "it wasn't working" in the NI tools... Since I'm more of a LV/NI guy I naturally look to the NI community first... and, it turns out that I posed the wrong question. Thanks anyway.

0 Kudos
Message 8 of 8
(4,130 Views)