Jump to content

Variable declared as an 'inline' field in c++14


scsc

Recommended Posts

Tried to run an example using C++14/17 styles. But got these errors similar to this:

 error: ‘created’ declared as an ‘inline’ field
   inline static size_t                created{ 0u };

Doesn't 14 or 17 support this "inline" feature? Both "-std=c++14" and "-std=c++17" generated the same errors. 

Link to comment
Share on other sites

I think I had also already specified C++17 already:

g++ -c -g -Wall -std=c++17 -DSC_INCLUDE_FX -DSC_INCLUDE_DYNAMIC_PROCESSES -I. -I/opt/systemc/include

But still got that "inline" error. I am using g++ version 

g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609

looking at the g++ manual, there is no c++17 but c++1z. But even with "-std=c++1z", the errors still persist. What version of g++ are you using to support this feature?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...