You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The errors relating to "was not declared in this scope" are library-specific errors. To fix this, go into the `./CN0357/AD5270/AD5270.h` header file and remove the constructor's default arguments. Line 91 of the `AD5270.h` header file now looks like this:
Building project CN0357-helloworld (K64F, GCC_ARM)
238
-
Scan: .
239
-
Scan: mbed
240
-
Scan: env
241
-
Scan: FEATURE_LWIP
242
-
Scan: FEATURE_STORAGE
243
-
Compile [ 2.5%]: main.cpp
244
-
[Error] AD7790.h@114,51: 'SPI_CS' was not declared in this scope
245
-
[Error] AD7790.h@114,74: 'SPI_MOSI' was not declared in this scope
246
-
[Error] AD7790.h@114,99: 'SPI_MISO' was not declared in this scope
247
-
[Error] AD7790.h@114,123: 'SPI_SCK' was not declared in this scope
248
-
[Error] CN0357.h@77,73: 'SPI_MOSI' was not declared in this scope
249
-
[Error] CN0357.h@77,98: 'SPI_MISO' was not declared in this scope
250
-
[Error] CN0357.h@77,122: 'SPI_SCK' was not declared in this scope
251
-
[Error] main.cpp@111,12: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 3, which is not yet defined
252
-
[Error] main.cpp@111,0: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 4, which is not yet defined
253
-
[Error] main.cpp@111,0: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 5, which is not yet defined
254
-
[ERROR] In file included from ./CN0357/CN0357.h:52:0,
255
-
from ./main.cpp:48:
256
-
./CN0357/AD7790/AD7790.h:114:51: error: 'SPI_CS' was not declared in this scope
./main.cpp:111:12: error: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 3, which is not yet defined
280
-
CN0357 cn0357;
281
-
^~~~~~
282
-
./main.cpp:111:12: error: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 4, which is not yet defined
283
-
./main.cpp:111:12: error: call to 'CN0357::CN0357(PinName, PinName, PinName, PinName, PinName)' uses the default argument for parameter 5, which is not yet defined
284
-
285
-
[mbed] ERROR: "/usr/local/opt/python/bin/python2.7" returned error code 1.
Notice that the `./CN0357/AD7790/AD7790.h` and `./CN0357/CN0357.h` header files also have similar "was not declared in this scope" errors. You need to remove the constructor's default arguments again in both files.
291
-
292
-
Line 114 of the `AD7790.h` header file now looks like this:
These errors are now due to the CN0357 variable in `main.cpp` no longer having sufficient arguments. Go into `main.cpp`, and modify the initialization of the `CN0357 cn0357;` variable on line 111 to include the K64F's pin names. Line 111 now looks like this:
Although the program or library now compiles successfully, runtime errors may still be present. Please visit the [compile-time errors tutorial](compile-time-errors.html#runtime-errors-and-lights-of-the-dead) for further debugging tips about common errors.
0 commit comments