Command does not name a type

  • Command does not name a type
  • vBulletin Message

Forum Rule: Always post complete source code & details to reproduce any issue!

vBulletin Message

Sorry. The administrator has banned your IP address. To contact the administrator click here

All times are GMT. The time now is 02:42 PM.

Powered by vBulletin® Version 4.2.2
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
Web Hosting

Hi! Thank you for the fast reply!

You were right, I didn`t have that document and I didnt know that the newest SdFat Lib from the Arduino Library Manager wouldn´t work.

I could succefully compile and upload through the Arduino IDE.

I hooked up an SD Card reader to the pins in the decription on Github and set the CS pin accordingly. I also set the wifi settings to AP.
Because I dont have the TFT and neither the nunchuk and just want to try the browser interface, sd card and serial pass through I commented the following:

  • tftInit()
  • initButtons()
  • nunchuk_init()

out of the setup() routine.

Unfortunatly, the ESP32 is rebooting over and over.

Is it possible to test the grbl_controller without tft and nunchuk or would that be impossible?

Is there a away over a define maybe to turn off those features which I (and maybe others) are not using?

In general I really like the idea of your project!!! Thank you for the help

This is what I get out of the terminal:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8

using config.h param for WiFi
Wifi config will be executed
Guru Meditation Error: Core  1 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x00000000  PS      : 0x00060630  A0      : 0x800d7921  A1      : 0x3ffb1f70  
A2      : 0x3ffc1edd  A3      : 0x3ffc33c4  A4      : 0x3ffc3a40  A5      : 0x00000000  
A6      : 0x400d2b4c  A7      : 0x0101a8c0  A8      : 0x800d50fa  A9      : 0x3ffc180c  
A10     : 0x00000000  A11     : 0x3f402019  A12     : 0x3ffc33c4  A13     : 0x3ffc33a1  
A14     : 0x3ffb1f4c  A15     : 0x3ffc3c28  SAR     : 0x0000000a  EXCCAUSE: 0x00000014  
EXCVADDR: 0x00000000  LBEG    : 0x400e20b4  LEND    : 0x400e2116  LCOUNT  : 0x00000000  

Backtrace: 0x00000000:0x3ffb1f70 0x400d791e:0x3ffb1f90 0x400e4205:0x3ffb1fb0 0x4008939d:0x3ffb1fd0

Rebooting...

After updating to Mojave 10.14.4 and Xcode 10.2, I fail to compile GCC 8.3.0. The error message is

In file included from /usr/include/sys/sysctl.h:83,
                 from ../../gcc-8.3.0/gcc/config/darwin-driver.c:30:
/usr/include/sys/ucred.h:94:2: error: ‘_Atomic’ does not name a type
  _Atomic u_long          cr_ref;  /* reference count */
  ^~~~~~~

I have not found any clue how this can be fixed. The header in question is

struct ucred {
    LIST_ENTRY(ucred)       cr_link; /* never modify this without KAUTH_CRED_HASH_LOCK */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__)
    _Atomic u_long          cr_ref;  /* reference count */
#elif defined(__cplusplus) && __cplusplus >= 201103L
    _Atomic u_long          cr_ref;  /* reference count */   // <--- this line
#else
    volatile u_long         cr_ref;  /* reference count */
#endif

Any ideas are highly appreciated!

asked Mar 28, 2019 at 10:56

Command does not name a type

5

I encountered the same problem myself. The error is actually reported by g++, a C++ compiler. On MacOS 10.14.4, the header file <sys/ucred.h> uses the _Atomic keyword for C++, although it is only defined in the C standard. (I assume that Apple's compiler clang++ defines this keyword as extension to the C++ standard.)

The proper fix is to tell gcc to "fixinclude" the header file <sys/ucred.h>. This patch does this. This is a patch that needs to be applied to the source code of GCC 8.3.0 before building it.

answered Mar 28, 2019 at 23:03

1

You need to use a C11 compatible compiler in order to have support for the _Atomic keyword.

Ensure that you are compiling with a recent, modern compiler, and that STDC_NO_ATOMICS is not defined.

It might be easier for you to use HomeBrew in order to compile it without having to configure anything yourself. After installing HomeBrew, you can install gcc with:

brew install gcc

answered Mar 28, 2019 at 12:43

jksoegaardjksoegaard

68.6k3 gold badges103 silver badges174 bronze badges

3

I had the same issue and I found a solution here.

macOS Mojave changed the location of the system headers, this broke the GCC 8 build process. In order to build GCC install the required header files in the old location:

The solution is to install the package found in the following directory.

/Library/Developer/CommandLineTools/Packages/

answered Apr 5, 2019 at 22:41

Command does not name a type

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .

Does not name a type in c++?

The "error does not name a type" in C/C++ is defined as the when user declares outside of the function or does not include it properly in the main file this error will through.

How do you name a type in C++?

C++ code. Use CamelCase for all names. Start types (such as classes, structs, and typedefs) with a capital letter, other names (functions, variables) with a lowercase letter.

How do I fix redefinition error in C++?

Include a few #ifndef name #define name #endif preprocessor that should solve your problem. The issue is it going from the header to the function then back to the header so it is redefining the class with all the preprocessor(#include) multiple times.

What does cout does not name a type mean?

You're missing your main. The code is outside of a function and is considered by the compiler to be either a declaration of variables, class, structs or other such commands.