mkostoevr Незнайка 26 / 11 / 2 Регистрация: 14.10.2016 Сообщений: 373 Записей в блоге: 2 |
||||||||
1 |
||||||||
23.06.2017, 11:11. Показов 4427. Ответов 9 Метки нет (Все метки)
Здрасте! Короче, такое дело, я решил уменьшить размер своей программы таким образом: выделить все функции, которые в ней используются и подключить только те заголовки, в которых эти функции объявлены. Этот код:
Я заменил вот этим:
В результате MinGW выдал пот такой лист ошибок: C:/TDM-GCC-64/x86_64-w64-mingw32/include/minwinbase.h:14:5: error: ‘DWORD’ does not name a type В кратце говоря, он жалуется, что ему непонятны некоторые типы. Это можно как-нибудь исправить? Просто программа для своей функциональности уж слишком много весит, не хотелось бы всю коллекцию заголовков <Windows.h> в неё включать. Заранее спасибо!
__________________
0 |
Ушел с форума 16454 / 7418 / 1186 Регистрация: 02.05.2013 Сообщений: 11,617 Записей в блоге: 1 |
|
23.06.2017, 11:18 |
2 |
Решение
я решил уменьшить размер своей программы таким образом: выделить все функции, которые в ней используются и подключить только те заголовки, в которых эти функции объявлены. Включение заголовка <Windows.h> на размер программы не влияет. Никак.
1 |
Незнайка 26 / 11 / 2 Регистрация: 14.10.2016 Сообщений: 373 Записей в блоге: 2 |
|
23.06.2017, 11:20 [ТС] |
3 |
Убежденный, но Windows.h ссылается на другие заголовки, а, как мне сказали, заголовочные файлы компилятся вместе с программой в любом случае, даже если функции из них не были использованы. Разве не так?
0 |
Ушел с форума 16454 / 7418 / 1186 Регистрация: 02.05.2013 Сообщений: 11,617 Записей в блоге: 1 |
|
23.06.2017, 11:23 |
4 |
Объявления типов, функций, интерфейсов и т.п. сами по себе ни во что не компилятся, пока Ну и во-вторых, подключая содержимое Windows.h избирательно, в обход стандартных путей,
0 |
Незнайка 26 / 11 / 2 Регистрация: 14.10.2016 Сообщений: 373 Записей в блоге: 2 |
|
23.06.2017, 11:27 [ТС] |
5 |
Убежденный, понятно… Но теперь двойне странно, почему программа на MinGW весит в 4 раза больше аналогичной на Visual Studio…
0 |
Software Developer 315 / 229 / 113 Регистрация: 03.05.2017 Сообщений: 1,306 |
|
23.06.2017, 11:30 |
6 |
mkostoevr, попробуйте использовать strip.exe входящую в состав MinGW
0 |
Незнайка 26 / 11 / 2 Регистрация: 14.10.2016 Сообщений: 373 Записей в блоге: 2 |
|
23.06.2017, 11:33 [ТС] |
7 |
decrement, программа с самого начла компилится с параметром -s, так что никаких символов в ней нет изначально, strip, скорее всего, не поможет.
0 |
Ушел с форума 16454 / 7418 / 1186 Регистрация: 02.05.2013 Сообщений: 11,617 Записей в блоге: 1 |
|
23.06.2017, 11:50 |
8 |
Но теперь двойне странно, почему программа на MinGW весит в 4 раза больше аналогичной на Visual Studio… Не вижу ничего странного. Вот было бы действительно странно, если бы MinGW или MS C/C++ Compiler
1 |
183 / 181 / 66 Регистрация: 15.02.2015 Сообщений: 515 |
|
23.06.2017, 14:54 |
9 |
почему программа на MinGW весит в 4 раза больше аналогичной на Visual Studio… Хоть компиляторы и разные, а такая разница в размере скорее всего из-за того, что по умолчанию MSVC++ компилирует с флагом /md (Multithreded Dll), и программа динамически линкуется с рантайм библиотекой. Exe’шник становится легче, но, как я упомянул, есть зависимость от библиотеки Visual Studio конкретной версии.
0 |
Незнайка 26 / 11 / 2 Регистрация: 14.10.2016 Сообщений: 373 Записей в блоге: 2 |
|
23.06.2017, 15:25 [ТС] |
10 |
Operok, в том то и прикол, что эту функцию я отключил в настройках проекта.
0 |
Just running npm install -g fibers
on Node 12.0.0 is enough to trigger the issue.
Build errors
make: Entering directory '/home/nweiz/.nvm/versions/node/v12.0.0/lib/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
../src/fibers.cc:68:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<String> NewLatin1String(Isolate* isolate, const char* string) {
^~~~~~
rand_r
../src/fibers.cc:72:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<String> NewLatin1Symbol(Isolate* isolate, const char* string) {
^~~~~~
rand_r
../src/fibers.cc:94:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Object> NewInstance(Isolate* isolate, Local<Function> fn, int argc, Local<Value> argv[]) {
^~~~~~
rand_r
../src/fibers.cc:104:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Number> ToNumber(Local<Value> value) {
^~~~~~
rand_r
../src/fibers.cc:114:50: error: ‘Handle’ has not been declared
Local<Value> GetStackTrace(TryCatch* try_catch, Handle<Context> context) {
^~~~~~
../src/fibers.cc:114:56: error: expected ‘,’ or ‘...’ before ‘<’ token
Local<Value> GetStackTrace(TryCatch* try_catch, Handle<Context> context) {
^
../src/fibers.cc: In function ‘v8::Local<v8::Value> uni::GetStackTrace(uni::TryCatch*, int)’:
../src/fibers.cc:115:32: error: ‘context’ was not declared in this scope
return try_catch->StackTrace(context).ToLocalChecked();
^~~~~~~
../src/fibers.cc:115:32: note: suggested alternative: ‘ucontext’
return try_catch->StackTrace(context).ToLocalChecked();
^~~~~~~
ucontext
../src/fibers.cc: At global scope:
../src/fibers.cc:127:39: error: ‘Handle’ has not been declared
void fixStackLimit(Isolate* isolate, Handle<Context> context) {
^~~~~~
../src/fibers.cc:127:45: error: expected ‘,’ or ‘...’ before ‘<’ token
void fixStackLimit(Isolate* isolate, Handle<Context> context) {
^
../src/fibers.cc: In function ‘void uni::fixStackLimit(v8::Isolate*, int)’:
../src/fibers.cc:128:19: error: ‘context’ was not declared in this scope
Script::Compile(context, uni::NewLatin1String(isolate, "void 0;")).ToLocalChecked();
^~~~~~~
../src/fibers.cc:128:19: note: suggested alternative: ‘ucontext’
Script::Compile(context, uni::NewLatin1String(isolate, "void 0;")).ToLocalChecked();
^~~~~~~
ucontext
../src/fibers.cc:128:33: error: ‘NewLatin1String’ is not a member of ‘uni’
Script::Compile(context, uni::NewLatin1String(isolate, "void 0;")).ToLocalChecked();
^~~~~~~~~~~~~~~
../src/fibers.cc: At global scope:
../src/fibers.cc:149:58: error: ‘Handle’ has not been declared
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~~
../src/fibers.cc:149:64: error: expected ‘,’ or ‘...’ before ‘<’ token
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^
../src/fibers.cc: In function ‘void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)’:
../src/fibers.cc:150:29: error: ‘handle’ was not declared in this scope
persistent.Reset(isolate, handle);
^~~~~~
../src/fibers.cc:150:29: note: suggested alternative: ‘rand_r’
persistent.Reset(isolate, handle);
^~~~~~
rand_r
../src/fibers.cc: At global scope:
../src/fibers.cc:162:26: error: variable or field ‘SetInternalPointer’ declared void
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~~~~
../src/fibers.cc:162:26: error: ‘Handle’ was not declared in this scope
../src/fibers.cc:162:26: note: suggested alternative: ‘rand_r’
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~~~~
rand_r
../src/fibers.cc:162:34: error: expected primary-expression before ‘>’ token
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^
../src/fibers.cc:162:36: error: ‘handle’ was not declared in this scope
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~~~~
../src/fibers.cc:162:36: note: suggested alternative: ‘rand_r’
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~~~~
rand_r
../src/fibers.cc:162:44: error: expected primary-expression before ‘int’
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~
../src/fibers.cc:162:55: error: expected primary-expression before ‘void’
void SetInternalPointer(Handle<T> handle, int index, void* val) {
^~~~
../src/fibers.cc:166:27: error: ‘Handle’ was not declared in this scope
void* GetInternalPointer(Handle<T> handle, int index) {
^~~~~~
../src/fibers.cc:166:27: note: suggested alternative: ‘rand_r’
void* GetInternalPointer(Handle<T> handle, int index) {
^~~~~~
rand_r
../src/fibers.cc:166:35: error: expected primary-expression before ‘>’ token
void* GetInternalPointer(Handle<T> handle, int index) {
^
../src/fibers.cc:166:37: error: ‘handle’ was not declared in this scope
void* GetInternalPointer(Handle<T> handle, int index) {
^~~~~~
../src/fibers.cc:166:37: note: suggested alternative: ‘rand_r’
void* GetInternalPointer(Handle<T> handle, int index) {
^~~~~~
rand_r
../src/fibers.cc:166:45: error: expected primary-expression before ‘int’
void* GetInternalPointer(Handle<T> handle, int index) {
^~~
../src/fibers.cc:166:54: error: expression list treated as compound expression in initializer [-fpermissive]
void* GetInternalPointer(Handle<T> handle, int index) {
^
../src/fibers.cc:166:56: error: expected ‘;’ before ‘{’ token
void* GetInternalPointer(Handle<T> handle, int index) {
^
../src/fibers.cc:171:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<T> Deref(Isolate* isolate, Persistent<T>& handle) {
^~~~~~
rand_r
../src/fibers.cc:176:14: error: variable or field ‘Return’ declared void
void Return(Handle<T> handle, const Arguments& args) {
^~~~~~
../src/fibers.cc:176:14: error: ‘Handle’ was not declared in this scope
../src/fibers.cc:176:14: note: suggested alternative: ‘rand_r’
void Return(Handle<T> handle, const Arguments& args) {
^~~~~~
rand_r
../src/fibers.cc:176:22: error: expected primary-expression before ‘>’ token
void Return(Handle<T> handle, const Arguments& args) {
^
../src/fibers.cc:176:24: error: ‘handle’ was not declared in this scope
void Return(Handle<T> handle, const Arguments& args) {
^~~~~~
../src/fibers.cc:176:24: note: suggested alternative: ‘rand_r’
void Return(Handle<T> handle, const Arguments& args) {
^~~~~~
rand_r
../src/fibers.cc:176:32: error: expected primary-expression before ‘const’
void Return(Handle<T> handle, const Arguments& args) {
^~~~~
../src/fibers.cc:180:14: error: variable or field ‘Return’ declared void
void Return(Handle<T> handle, GetterCallbackInfo info) {
^~~~~~
../src/fibers.cc:180:14: error: ‘Handle’ was not declared in this scope
../src/fibers.cc:180:14: note: suggested alternative: ‘rand_r’
void Return(Handle<T> handle, GetterCallbackInfo info) {
^~~~~~
rand_r
../src/fibers.cc:180:22: error: expected primary-expression before ‘>’ token
void Return(Handle<T> handle, GetterCallbackInfo info) {
^
../src/fibers.cc:180:24: error: ‘handle’ was not declared in this scope
void Return(Handle<T> handle, GetterCallbackInfo info) {
^~~~~~
../src/fibers.cc:180:24: note: suggested alternative: ‘rand_r’
void Return(Handle<T> handle, GetterCallbackInfo info) {
^~~~~~
rand_r
../src/fibers.cc:180:51: error: expected primary-expression before ‘info’
void Return(Handle<T> handle, GetterCallbackInfo info) {
^~~~
../src/fibers.cc:188:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Value> ThrowException(Isolate* isolate, Handle<Value> exception) {
^~~~~~
rand_r
../src/fibers.cc:192:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Context> GetCurrentContext(Isolate* isolate) {
^~~~~~
rand_r
../src/fibers.cc:196:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Primitive> Undefined(Isolate* isolate) {
^~~~~~
rand_r
../src/fibers.cc:200:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Boolean> NewBoolean(Isolate* isolate, bool value) {
^~~~~~
rand_r
../src/fibers.cc:204:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Number> NewNumber(Isolate* isolate, double value) {
^~~~~~
rand_r
../src/fibers.cc:208:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<FunctionTemplate> NewFunctionTemplate(
^~~~~~
rand_r
../src/fibers.cc:218:2: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Signature> NewSignature(
^~~~~~
rand_r
../src/fibers.cc:408:17: error: expected ‘;’ at end of member declaration
static Fiber& Unwrap(Handle<Object> handle) {
^~~~~~
../src/fibers.cc:408:30: error: expected ‘)’ before ‘<’ token
static Fiber& Unwrap(Handle<Object> handle) {
^
../src/fibers.cc:414:15: error: expected ‘)’ before ‘<’ token
Fiber(Handle<Object> handle, Handle<Function> cb, Handle<Context> v8_context) :
^
../src/fibers.cc:680:3: error: ‘Handle’ does not name a type; did you mean ‘rand_r’?
Handle<Value> ReturnYielded() {
^~~~~~
rand_r
../src/fibers.cc:842:20: error: ‘Handle’ has not been declared
static void Init(Handle<Object> target) {
^~~~~~
../src/fibers.cc:842:26: error: expected ‘,’ or ‘...’ before ‘<’ token
static void Init(Handle<Object> target) {
^
In file included from ../src/fibers.cc:3:0:
../src/fibers.cc: In static member function ‘static void Fiber::WeakCallback(void*)’:
../src/fibers.cc:458:23: error: ‘class v8::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
assert(that.handle.IsNearDeath());
^
../src/fibers.cc: In static member function ‘static void Fiber::DestroyOrphans()’:
../src/fibers.cc:495:22: error: ‘Deref’ is not a member of ‘uni’
auto stack(uni::Deref(that.isolate, fatal_stack));
^~~~~
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::New(const Arguments&)’:
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:517:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects 1 argument");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:517:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects 1 argument");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:517:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects 1 argument");
^~~~~
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:519:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects a function");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:519:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects a function");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:519:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "Fiber expects a function");
^~~~~
../src/fibers.cc:521:5: error: ‘Handle’ was not declared in this scope
Handle<Value> argv[1] = { args[0] };
^~~~~~
../src/fibers.cc:521:5: note: suggested alternative: ‘handle’
Handle<Value> argv[1] = { args[0] };
^~~~~~
handle
../src/fibers.cc:521:17: error: expected primary-expression before ‘>’ token
Handle<Value> argv[1] = { args[0] };
^
../src/fibers.cc:521:19: error: ‘argv’ was not declared in this scope
Handle<Value> argv[1] = { args[0] };
^~~~
../src/fibers.cc:521:19: note: suggested alternative: ‘args’
Handle<Value> argv[1] = { args[0] };
^~~~
args
../src/fibers.cc:522:29: error: ‘NewInstance’ is not a member of ‘uni’
return uni::Return(uni::NewInstance(Isolate::GetCurrent(), uni::Deref(Isolate::GetCurrent(), tmpl)->GetFunction(), 1, argv), args);
^~~~~~~~~~~
../src/fibers.cc:522:69: error: ‘Deref’ is not a member of ‘uni’
return uni::Return(uni::NewInstance(Isolate::GetCurrent(), uni::Deref(Isolate::GetCurrent(), tmpl)->GetFunction(), 1, argv), args);
^~~~~
../src/fibers.cc:522:134: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::NewInstance(Isolate::GetCurrent(), uni::Deref(Isolate::GetCurrent(), tmpl)->GetFunction(), 1, argv), args);
^
../src/fibers.cc:525:4: error: ‘Handle’ was not declared in this scope
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^~~~~~
../src/fibers.cc:525:4: note: suggested alternative: ‘handle’
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^~~~~~
handle
../src/fibers.cc:525:19: error: expected primary-expression before ‘>’ token
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^
../src/fibers.cc:525:21: error: ‘fn’ was not declared in this scope
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^~
../src/fibers.cc:525:41: error: expected primary-expression before ‘>’ token
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^
../src/fibers.cc:525:44: error: ‘::Cast’ has not been declared
Handle<Function> fn = Handle<Function>::Cast(args[0]);
^~~~
../src/fibers.cc:526:36: error: ‘GetCurrentContext’ is not a member of ‘uni’
new Fiber(args.This(), fn, uni::GetCurrentContext(Isolate::GetCurrent()));
^~~~~~~~~~~~~~~~~
../src/fibers.cc:527:40: error: no matching function for call to ‘Return(v8::Local<v8::Object>, const Arguments&)’
return uni::Return(args.This(), args);
^
../src/fibers.cc:184:7: note: candidate: template<class T> void uni::Return(v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, uni::GetterCallbackInfo)
void Return(Persistent<T>& handle, GetterCallbackInfo info) {
^~~~~~
../src/fibers.cc:184:7: note: template argument deduction/substitution failed:
../src/fibers.cc:527:40: note: ‘v8::Local<v8::Object>’ is not derived from ‘v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >’
return uni::Return(args.This(), args);
^
../src/fibers.cc:527:40: error: return-statement with a value, in function returning 'void' [-fpermissive]
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::Run(const Arguments&)’:
../src/fibers.cc:535:38: error: no match for call to ‘(Fiber) (v8::Local<v8::Object>)’
Fiber& that = Unwrap(args.Holder());
^
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:541:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is already running");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:541:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is already running");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:541:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is already running");
^~~~~
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:543:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "run() excepts 1 or no arguments");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:543:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "run() excepts 1 or no arguments");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:543:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "run() excepts 1 or no arguments");
^~~~~
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:554:6: note: in expansion of macro ‘THROW’
THROW(Exception::RangeError, "Out of memory");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:554:6: note: in expansion of macro ‘THROW’
THROW(Exception::RangeError, "Out of memory");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:554:6: note: in expansion of macro ‘THROW’
THROW(Exception::RangeError, "Out of memory");
^~~~~
../src/fibers.cc:564:52: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Local<v8::Value>)’
uni::Reset(that.isolate, that.yielded, args[0]);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:564:51: note: cannot convert ‘(& args)->v8::FunctionCallbackInfo<v8::Value>::operator[](0)’ (type ‘v8::Local<v8::Value>’) to type ‘int’
uni::Reset(that.isolate, that.yielded, args[0]);
~~~~~~^
../src/fibers.cc:566:57: error: ‘Undefined’ is not a member of ‘uni’
uni::Reset<Value>(that.isolate, that.yielded, uni::Undefined(that.isolate));
^~~~~~~~~
../src/fibers.cc:566:57: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
Local<Primitive> Undefined(Isolate* isolate) {
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
../src/fibers.cc:570:28: error: ‘class Fiber’ has no member named ‘ReturnYielded’
return uni::Return(that.ReturnYielded(), args);
^~~~~~~~~~~~~
../src/fibers.cc:570:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(that.ReturnYielded(), args);
^
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::ThrowInto(const Arguments&)’:
../src/fibers.cc:577:38: error: no match for call to ‘(Fiber) (v8::Local<v8::Object>)’
Fiber& that = Unwrap(args.Holder());
^
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:580:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:580:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:580:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:582:56: error: ‘Undefined’ is not a member of ‘uni’
uni::Reset<Value>(that.isolate, that.yielded, uni::Undefined(that.isolate));
^~~~~~~~~
../src/fibers.cc:582:56: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
Local<Primitive> Undefined(Isolate* isolate) {
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
../src/fibers.cc:584:51: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Local<v8::Value>)’
uni::Reset(that.isolate, that.yielded, args[0]);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:584:50: note: cannot convert ‘(& args)->v8::FunctionCallbackInfo<v8::Value>::operator[](0)’ (type ‘v8::Local<v8::Value>’) to type ‘int’
uni::Reset(that.isolate, that.yielded, args[0]);
~~~~~~^
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:586:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "throwInto() expects 1 or no arguments");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:586:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "throwInto() expects 1 or no arguments");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:586:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "throwInto() expects 1 or no arguments");
^~~~~
../src/fibers.cc:590:28: error: ‘class Fiber’ has no member named ‘ReturnYielded’
return uni::Return(that.ReturnYielded(), args);
^~~~~~~~~~~~~
../src/fibers.cc:590:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(that.ReturnYielded(), args);
^
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::Reset(const Arguments&)’:
../src/fibers.cc:598:38: error: no match for call to ‘(Fiber) (v8::Local<v8::Object>)’
Fiber& that = Unwrap(args.Holder());
^
../src/fibers.cc:601:29: error: ‘Undefined’ is not a member of ‘uni’
return uni::Return(uni::Undefined(that.isolate), args);
^~~~~~~~~
../src/fibers.cc:601:29: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
Local<Primitive> Undefined(Isolate* isolate) {
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
../src/fibers.cc:601:58: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::Undefined(that.isolate), args);
^
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:603:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:603:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:603:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "This Fiber is not yielding");
^~~~~
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:605:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "reset() expects no arguments");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:605:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "reset() expects no arguments");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:605:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "reset() expects no arguments");
^~~~~
../src/fibers.cc:613:4: error: ‘Handle’ was not declared in this scope
Handle<Value> val = uni::Deref(that.isolate, that.yielded);
^~~~~~
../src/fibers.cc:613:4: note: suggested alternative: ‘handle’
Handle<Value> val = uni::Deref(that.isolate, that.yielded);
^~~~~~
handle
../src/fibers.cc:613:16: error: expected primary-expression before ‘>’ token
Handle<Value> val = uni::Deref(that.isolate, that.yielded);
^
../src/fibers.cc:613:18: error: ‘val’ was not declared in this scope
Handle<Value> val = uni::Deref(that.isolate, that.yielded);
^~~
../src/fibers.cc:613:29: error: ‘Deref’ is not a member of ‘uni’
Handle<Value> val = uni::Deref(that.isolate, that.yielded);
^~~~~
../src/fibers.cc:616:29: error: ‘ThrowException’ is not a member of ‘uni’
return uni::Return(uni::ThrowException(that.isolate, val), args);
^~~~~~~~~~~~~~
../src/fibers.cc:616:68: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::ThrowException(that.isolate, val), args);
^
../src/fibers.cc:618:33: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(val, args);
^
../src/fibers.cc: In member function ‘void Fiber::UnwindStack()’:
../src/fibers.cc:635:4: error: ‘Handle’ was not declared in this scope
Handle<Value> zombie_exception = Exception::Error(uni::NewLatin1String(isolate, "This Fiber is a zombie"));
^~~~~~
../src/fibers.cc:635:4: note: suggested alternative: ‘handle’
Handle<Value> zombie_exception = Exception::Error(uni::NewLatin1String(isolate, "This Fiber is a zombie"));
^~~~~~
handle
../src/fibers.cc:635:16: error: expected primary-expression before ‘>’ token
Handle<Value> zombie_exception = Exception::Error(uni::NewLatin1String(isolate, "This Fiber is a zombie"));
^
../src/fibers.cc:635:59: error: ‘NewLatin1String’ is not a member of ‘uni’
Handle<Value> zombie_exception = Exception::Error(uni::NewLatin1String(isolate, "This Fiber is a zombie"));
^~~~~~~~~~~~~~~
../src/fibers.cc:636:64: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Persistent<v8::Value>&)’
uni::Reset(isolate, this->zombie_exception, zombie_exception);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:636:48: note: cannot convert ‘((Fiber*)this)->Fiber::zombie_exception’ (type ‘v8::Persistent<v8::Value>’) to type ‘int’
uni::Reset(isolate, this->zombie_exception, zombie_exception);
^~~~~~~~~~~~~~~~
../src/fibers.cc:637:49: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Persistent<v8::Value>&)’
uni::Reset(isolate, yielded, zombie_exception);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:637:33: note: cannot convert ‘((Fiber*)this)->Fiber::zombie_exception’ (type ‘v8::Persistent<v8::Value>’) to type ‘int’
uni::Reset(isolate, yielded, zombie_exception);
^~~~~~~~~~~~~~~~
../src/fibers.cc:650:46: error: ‘Undefined’ is not a member of ‘uni’
uni::Reset<Value>(isolate, yielded, uni::Undefined(isolate));
^~~~~~~~~
../src/fibers.cc:650:46: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
Local<Primitive> Undefined(Isolate* isolate) {
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:10838:18: note: ‘v8::Undefined’
../src/fibers.cc: In static member function ‘static void Fiber::RunFiber(void**)’:
../src/fibers.cc:712:5: error: ‘Handle’ was not declared in this scope
Handle<Context> v8_context = uni::Deref(that.isolate, that.v8_context);
^~~~~~
../src/fibers.cc:712:5: note: suggested alternative: ‘handle’
Handle<Context> v8_context = uni::Deref(that.isolate, that.v8_context);
^~~~~~
handle
../src/fibers.cc:712:19: error: expected primary-expression before ‘>’ token
Handle<Context> v8_context = uni::Deref(that.isolate, that.v8_context);
^
../src/fibers.cc:712:21: error: invalid use of member ‘Fiber::v8_context’ in static member function
Handle<Context> v8_context = uni::Deref(that.isolate, that.v8_context);
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:712:39: error: ‘Deref’ is not a member of ‘uni’
Handle<Context> v8_context = uni::Deref(that.isolate, that.v8_context);
^~~~~
../src/fibers.cc:713:5: error: invalid use of member ‘Fiber::v8_context’ in static member function
v8_context->Enter();
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:715:38: error: invalid use of member ‘Fiber::v8_context’ in static member function
uni::fixStackLimit(that.isolate, v8_context);
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:717:17: error: expected primary-expression before ‘>’ token
Handle<Value> yielded;
^
../src/fibers.cc:717:19: error: invalid use of member ‘Fiber::yielded’ in static member function
Handle<Value> yielded;
^~~~~~~
../src/fibers.cc:399:21: note: declared here
Persistent<Value> yielded;
^~~~~~~
../src/fibers.cc:719:18: error: expected primary-expression before ‘>’ token
Handle<Value> argv[1] = { (*args)[0] };
^
../src/fibers.cc:719:20: error: ‘argv’ was not declared in this scope
Handle<Value> argv[1] = { (*args)[0] };
^~~~
../src/fibers.cc:719:20: note: suggested alternative: ‘args’
Handle<Value> argv[1] = { (*args)[0] };
^~~~
args
../src/fibers.cc:720:6: error: invalid use of member ‘Fiber::yielded’ in static member function
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 1, argv);
^~~~~~~
../src/fibers.cc:399:21: note: declared here
Persistent<Value> yielded;
^~~~~~~
../src/fibers.cc:720:21: error: ‘Deref’ is not a member of ‘uni’
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 1, argv);
^~~~~
../src/fibers.cc:720:56: error: invalid use of member ‘Fiber::v8_context’ in static member function
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 1, argv);
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:722:6: error: invalid use of member ‘Fiber::yielded’ in static member function
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 0, NULL);
^~~~~~~
../src/fibers.cc:399:21: note: declared here
Persistent<Value> yielded;
^~~~~~~
../src/fibers.cc:722:21: error: ‘Deref’ is not a member of ‘uni’
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 0, NULL);
^~~~~
../src/fibers.cc:722:56: error: invalid use of member ‘Fiber::v8_context’ in static member function
yielded = uni::Deref(that.isolate, that.cb)->Call(v8_context->Global(), 0, NULL);
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:726:66: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Local<v8::Value>)’
uni::Reset(that.isolate, that.yielded, try_catch.Exception());
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:726:64: note: cannot convert ‘try_catch.uni::TryCatch::<anonymous>.v8::TryCatch::Exception()’ (type ‘v8::Local<v8::Value>’) to type ‘int’
uni::Reset(that.isolate, that.yielded, try_catch.Exception());
~~~~~~~~~~~~~~~~~~~^~
../src/fibers.cc:728:50: error: ‘Deref’ is not a member of ‘uni’
if (that.zombie && !that.resetting && !uni::Deref(that.isolate, that.yielded)->StrictEquals(uni::Deref(that.isolate, that.zombie_exception))) {
^~~~~
../src/fibers.cc:728:103: error: ‘Deref’ is not a member of ‘uni’
if (that.zombie && !that.resetting && !uni::Deref(that.isolate, that.yielded)->StrictEquals(uni::Deref(that.isolate, that.zombie_exception))) {
^~~~~
../src/fibers.cc:730:76: error: invalid use of member ‘Fiber::v8_context’ in static member function
uni::Reset(that.isolate, fatal_stack, uni::GetStackTrace(&try_catch, v8_context));
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc:733:45: error: invalid use of member ‘Fiber::yielded’ in static member function
uni::Reset(that.isolate, that.yielded, yielded);
^~~~~~~
../src/fibers.cc:399:21: note: declared here
Persistent<Value> yielded;
^~~~~~~
../src/fibers.cc:748:5: error: invalid use of member ‘Fiber::v8_context’ in static member function
v8_context->Exit();
^~~~~~~~~~
../src/fibers.cc:397:23: note: declared here
Persistent<Context> v8_context;
^~~~~~~~~~
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::Yield_(const Arguments&)’:
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:763:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "yield() called with no fiber running");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:763:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "yield() called with no fiber running");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:763:5: note: in expansion of macro ‘THROW’
THROW(Exception::Error, "yield() called with no fiber running");
^~~~~
../src/fibers.cc:769:29: error: ‘ThrowException’ is not a member of ‘uni’
return uni::Return(uni::ThrowException(that.isolate, uni::Deref(that.isolate, that.zombie_exception)), args);
^~~~~~~~~~~~~~
../src/fibers.cc:769:63: error: ‘Deref’ is not a member of ‘uni’
return uni::Return(uni::ThrowException(that.isolate, uni::Deref(that.isolate, that.zombie_exception)), args);
^~~~~
../src/fibers.cc:769:112: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::ThrowException(that.isolate, uni::Deref(that.isolate, that.zombie_exception)), args);
^
../src/fibers.cc:771:74: error: no matching function for call to ‘Reset<v8::Value>(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Local<v8::Primitive>)’
uni::Reset<Value>(that.isolate, that.yielded, Undefined(that.isolate));
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:771:60: note: cannot convert ‘v8::Undefined(that.Fiber::isolate)’ (type ‘v8::Local<v8::Primitive>’) to type ‘int’
uni::Reset<Value>(that.isolate, that.yielded, Undefined(that.isolate));
~~~~~~~~~^~~~~~~~~~~~~~
../src/fibers.cc:773:51: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::Value>&, v8::Local<v8::Value>)’
uni::Reset(that.isolate, that.yielded, args[0]);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:773:50: note: cannot convert ‘(& args)->v8::FunctionCallbackInfo<v8::Value>::operator[](0)’ (type ‘v8::Local<v8::Value>’) to type ‘int’
uni::Reset(that.isolate, that.yielded, args[0]);
~~~~~~^
../src/fibers.cc:10:45: error: ‘ThrowException’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:775:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "yield() expects 1 or no arguments");
^~~~~
../src/fibers.cc:10:90: error: ‘NewLatin1String’ is not a member of ‘uni’
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:775:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "yield() expects 1 or no arguments");
^~~~~
../src/fibers.cc:10:139: error: return-statement with a value, in function returning 'void' [-fpermissive]
#define THROW(x, m) return uni::Return(uni::ThrowException(Isolate::GetCurrent(), x(uni::NewLatin1String(Isolate::GetCurrent(), m))), args)
^
../src/fibers.cc:775:5: note: in expansion of macro ‘THROW’
THROW(Exception::TypeError, "yield() expects 1 or no arguments");
^~~~~
../src/fibers.cc:798:28: error: ‘class Fiber’ has no member named ‘ReturnYielded’
return uni::Return(that.ReturnYielded(), args);
^~~~~~~~~~~~~
../src/fibers.cc:798:49: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(that.ReturnYielded(), args);
^
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::GetStarted(v8::Local<v8::String>, const GetterCallbackInfo&)’:
../src/fibers.cc:806:29: error: ‘Undefined’ is not a member of ‘uni’
return uni::Return(uni::Undefined(Isolate::GetCurrent()), info);
^~~~~~~~~
../src/fibers.cc:806:29: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:301:27: note: ‘v8::Undefined’
friend Local<Primitive> Undefined(Isolate* isolate);
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:301:27: note: ‘v8::Undefined’
../src/fibers.cc:806:67: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::Undefined(Isolate::GetCurrent()), info);
^
../src/fibers.cc:808:36: error: no match for call to ‘(Fiber) (v8::Local<v8::Object>)’
Fiber& that = Unwrap(info.This());
^
../src/fibers.cc:809:28: error: ‘NewBoolean’ is not a member of ‘uni’
return uni::Return(uni::NewBoolean(that.isolate, that.started), info);
^~~~~~~~~~
../src/fibers.cc:809:72: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::NewBoolean(that.isolate, that.started), info);
^
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::GetCurrent(v8::Local<v8::String>, const GetterCallbackInfo&)’:
../src/fibers.cc:816:29: error: ‘Undefined’ is not a member of ‘uni’
return uni::Return(uni::Undefined(Isolate::GetCurrent()), info);
^~~~~~~~~
../src/fibers.cc:816:29: note: suggested alternatives:
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:301:27: note: ‘v8::Undefined’
friend Local<Primitive> Undefined(Isolate* isolate);
^~~~~~~~~
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:301:27: note: ‘v8::Undefined’
../src/fibers.cc:816:67: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::Undefined(Isolate::GetCurrent()), info);
^
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::GetPoolSize(v8::Local<v8::String>, const GetterCallbackInfo&)’:
../src/fibers.cc:824:28: error: ‘NewNumber’ is not a member of ‘uni’
return uni::Return(uni::NewNumber(Isolate::GetCurrent(), Coroutine::pool_size), info);
^~~~~~~~~
../src/fibers.cc:824:88: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::NewNumber(Isolate::GetCurrent(), Coroutine::pool_size), info);
^
../src/fibers.cc: In static member function ‘static void Fiber::SetPoolSize(v8::Local<v8::String>, v8::Local<v8::Value>, const SetterCallbackInfo&)’:
../src/fibers.cc:828:32: error: ‘ToNumber’ is not a member of ‘uni’
Coroutine::pool_size = uni::ToNumber(value)->Value();
^~~~~~~~
../src/fibers.cc: In static member function ‘static uni::FunctionType Fiber::GetFibersCreated(v8::Local<v8::String>, const GetterCallbackInfo&)’:
../src/fibers.cc:835:28: error: ‘NewNumber’ is not a member of ‘uni’
return uni::Return(uni::NewNumber(Isolate::GetCurrent(), Coroutine::coroutines_created()), info);
^~~~~~~~~
../src/fibers.cc:835:99: error: return-statement with a value, in function returning 'void' [-fpermissive]
return uni::Return(uni::NewNumber(Isolate::GetCurrent(), Coroutine::coroutines_created()), info);
^
../src/fibers.cc: In static member function ‘static void Fiber::Init(int)’:
../src/fibers.cc:853:4: error: ‘Handle’ was not declared in this scope
Handle<FunctionTemplate> tmpl = uni::NewFunctionTemplate(isolate, New);
^~~~~~
../src/fibers.cc:853:4: note: suggested alternative: ‘handle’
Handle<FunctionTemplate> tmpl = uni::NewFunctionTemplate(isolate, New);
^~~~~~
handle
../src/fibers.cc:853:27: error: expected primary-expression before ‘>’ token
Handle<FunctionTemplate> tmpl = uni::NewFunctionTemplate(isolate, New);
^
../src/fibers.cc:853:41: error: ‘NewFunctionTemplate’ is not a member of ‘uni’
Handle<FunctionTemplate> tmpl = uni::NewFunctionTemplate(isolate, New);
^~~~~~~~~~~~~~~~~~~
../src/fibers.cc:853:41: note: suggested alternative: ‘FunctionType’
Handle<FunctionTemplate> tmpl = uni::NewFunctionTemplate(isolate, New);
^~~~~~~~~~~~~~~~~~~
FunctionType
../src/fibers.cc:854:41: error: no matching function for call to ‘Reset(v8::Isolate*&, v8::Persistent<v8::FunctionTemplate>&, v8::Persistent<v8::FunctionTemplate>&)’
uni::Reset(isolate, Fiber::tmpl, tmpl);
^
../src/fibers.cc:149:7: note: candidate: template<class T> void uni::Reset(v8::Isolate*, v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, int)
void Reset(Isolate* isolate, Persistent<T>& persistent, Handle<T> handle) {
^~~~~
../src/fibers.cc:149:7: note: template argument deduction/substitution failed:
../src/fibers.cc:854:41: note: cannot convert ‘Fiber::tmpl’ (type ‘v8::Persistent<v8::FunctionTemplate>’) to type ‘int’
uni::Reset(isolate, Fiber::tmpl, tmpl);
^
../src/fibers.cc:855:8: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
tmpl->SetClassName(uni::NewLatin1Symbol(isolate, "Fiber"));
^~
../src/fibers.cc:855:28: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
tmpl->SetClassName(uni::NewLatin1Symbol(isolate, "Fiber"));
^~~~~~~~~~~~~~~
../src/fibers.cc:859:20: error: expected primary-expression before ‘>’ token
Handle<Signature> sig = uni::NewSignature(isolate, tmpl);
^
../src/fibers.cc:859:22: error: ‘sig’ was not declared in this scope
Handle<Signature> sig = uni::NewSignature(isolate, tmpl);
^~~
../src/fibers.cc:859:22: note: suggested alternative: ‘sig_t’
Handle<Signature> sig = uni::NewSignature(isolate, tmpl);
^~~
sig_t
../src/fibers.cc:859:33: error: ‘NewSignature’ is not a member of ‘uni’
Handle<Signature> sig = uni::NewSignature(isolate, tmpl);
^~~~~~~~~~~~
../src/fibers.cc:860:8: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
tmpl->InstanceTemplate()->SetInternalFieldCount(1);
^~
../src/fibers.cc:863:25: error: expected primary-expression before ‘>’ token
Handle<ObjectTemplate> proto = tmpl->PrototypeTemplate();
^
../src/fibers.cc:863:27: error: ‘proto’ was not declared in this scope
Handle<ObjectTemplate> proto = tmpl->PrototypeTemplate();
^~~~~
../src/fibers.cc:863:39: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
Handle<ObjectTemplate> proto = tmpl->PrototypeTemplate();
^~
../src/fibers.cc:864:20: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
proto->Set(uni::NewLatin1Symbol(isolate, "reset"),
^~~~~~~~~~~~~~~
../src/fibers.cc:865:10: error: ‘NewFunctionTemplate’ is not a member of ‘uni’
uni::NewFunctionTemplate(isolate, Reset, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
../src/fibers.cc:865:10: note: suggested alternative: ‘FunctionType’
uni::NewFunctionTemplate(isolate, Reset, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
FunctionType
../src/fibers.cc:865:58: error: expected primary-expression before ‘>’ token
uni::NewFunctionTemplate(isolate, Reset, Handle<Value>(), sig));
^
../src/fibers.cc:865:60: error: expected primary-expression before ‘)’ token
uni::NewFunctionTemplate(isolate, Reset, Handle<Value>(), sig));
^
../src/fibers.cc:866:20: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
proto->Set(uni::NewLatin1Symbol(isolate, "run"),
^~~~~~~~~~~~~~~
../src/fibers.cc:867:10: error: ‘NewFunctionTemplate’ is not a member of ‘uni’
uni::NewFunctionTemplate(isolate, Run, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
../src/fibers.cc:867:10: note: suggested alternative: ‘FunctionType’
uni::NewFunctionTemplate(isolate, Run, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
FunctionType
../src/fibers.cc:867:56: error: expected primary-expression before ‘>’ token
uni::NewFunctionTemplate(isolate, Run, Handle<Value>(), sig));
^
../src/fibers.cc:867:58: error: expected primary-expression before ‘)’ token
uni::NewFunctionTemplate(isolate, Run, Handle<Value>(), sig));
^
../src/fibers.cc:868:20: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
proto->Set(uni::NewLatin1Symbol(isolate, "throwInto"),
^~~~~~~~~~~~~~~
../src/fibers.cc:869:10: error: ‘NewFunctionTemplate’ is not a member of ‘uni’
uni::NewFunctionTemplate(isolate, ThrowInto, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
../src/fibers.cc:869:10: note: suggested alternative: ‘FunctionType’
uni::NewFunctionTemplate(isolate, ThrowInto, Handle<Value>(), sig));
^~~~~~~~~~~~~~~~~~~
FunctionType
../src/fibers.cc:869:62: error: expected primary-expression before ‘>’ token
uni::NewFunctionTemplate(isolate, ThrowInto, Handle<Value>(), sig));
^
../src/fibers.cc:869:64: error: expected primary-expression before ‘)’ token
uni::NewFunctionTemplate(isolate, ThrowInto, Handle<Value>(), sig));
^
../src/fibers.cc:870:28: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
proto->SetAccessor(uni::NewLatin1Symbol(isolate, "started"), GetStarted);
^~~~~~~~~~~~~~~
../src/fibers.cc:873:19: error: expected primary-expression before ‘>’ token
Handle<Function> yield = uni::NewFunctionTemplate(isolate, Yield_)->GetFunction();
^
../src/fibers.cc:873:21: error: ‘yield’ was not declared in this scope
Handle<Function> yield = uni::NewFunctionTemplate(isolate, Yield_)->GetFunction();
^~~~~
../src/fibers.cc:873:21: note: suggested alternative: ‘Yield_’
Handle<Function> yield = uni::NewFunctionTemplate(isolate, Yield_)->GetFunction();
^~~~~
Yield_
../src/fibers.cc:873:34: error: ‘NewFunctionTemplate’ is not a member of ‘uni’
Handle<Function> yield = uni::NewFunctionTemplate(isolate, Yield_)->GetFunction();
^~~~~~~~~~~~~~~~~~~
../src/fibers.cc:873:34: note: suggested alternative: ‘FunctionType’
Handle<Function> yield = uni::NewFunctionTemplate(isolate, Yield_)->GetFunction();
^~~~~~~~~~~~~~~~~~~
FunctionType
../src/fibers.cc:874:17: error: expected primary-expression before ‘>’ token
Handle<String> sym_yield = uni::NewLatin1Symbol(isolate, "yield");
^
../src/fibers.cc:874:19: error: ‘sym_yield’ was not declared in this scope
Handle<String> sym_yield = uni::NewLatin1Symbol(isolate, "yield");
^~~~~~~~~
../src/fibers.cc:874:19: note: suggested alternative: ‘sched_yield’
Handle<String> sym_yield = uni::NewLatin1Symbol(isolate, "yield");
^~~~~~~~~
sched_yield
../src/fibers.cc:874:36: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
Handle<String> sym_yield = uni::NewLatin1Symbol(isolate, "yield");
^~~~~~~~~~~~~~~
../src/fibers.cc:875:4: error: ‘target’ was not declared in this scope
target->Set(sym_yield, yield);
^~~~~~
../src/fibers.cc:875:4: note: suggested alternative: ‘started’
target->Set(sym_yield, yield);
^~~~~~
started
../src/fibers.cc:878:19: error: expected primary-expression before ‘>’ token
Handle<Function> fn = tmpl->GetFunction();
^
../src/fibers.cc:878:21: error: ‘fn’ was not declared in this scope
Handle<Function> fn = tmpl->GetFunction();
^~
../src/fibers.cc:878:30: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent<v8::FunctionTemplate>’
Handle<Function> fn = tmpl->GetFunction();
^~
../src/fibers.cc:880:39: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
uni::SetAccessor(isolate, fn, uni::NewLatin1Symbol(isolate, "current"), GetCurrent);
^~~~~~~~~~~~~~~
../src/fibers.cc:881:39: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
uni::SetAccessor(isolate, fn, uni::NewLatin1Symbol(isolate, "poolSize"), GetPoolSize, SetPoolSize);
^~~~~~~~~~~~~~~
../src/fibers.cc:882:39: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
uni::SetAccessor(isolate, fn, uni::NewLatin1Symbol(isolate, "fibersCreated"), GetFibersCreated);
^~~~~~~~~~~~~~~
../src/fibers.cc:885:21: error: ‘NewLatin1Symbol’ is not a member of ‘uni’
target->Set(uni::NewLatin1Symbol(isolate, "Fiber"), fn);
^~~~~~~~~~~~~~~
../src/fibers.cc: At global scope:
../src/fibers.cc:901:11: error: variable or field ‘init’ declared void
void init(Handle<Object> target) {
^~~~~~
../src/fibers.cc:901:11: error: ‘Handle’ was not declared in this scope
../src/fibers.cc:901:11: note: suggested alternative: ‘rand_r’
void init(Handle<Object> target) {
^~~~~~
rand_r
../src/fibers.cc:901:24: error: expected primary-expression before ‘>’ token
void init(Handle<Object> target) {
^
../src/fibers.cc:901:26: error: ‘target’ was not declared in this scope
void init(Handle<Object> target) {
^~~~~~
../src/fibers.cc:901:26: note: suggested alternative: ‘tzset’
void init(Handle<Object> target) {
^~~~~~
tzset
In file included from ../src/coroutine.h:1:0,
from ../src/fibers.cc:1:
../src/fibers.cc:916:21: error: ‘init’ was not declared in this scope
NODE_MODULE(fibers, init)
^
/home/nweiz/.node-gyp/12.0.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/fibers.cc:916:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(fibers, init)
^~~~~~~~~~~
../src/fibers.cc:916:21: note: suggested alternative: ‘int’
NODE_MODULE(fibers, init)
^
/home/nweiz/.node-gyp/12.0.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc),
^~~~~~~
../src/fibers.cc:916:1: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(fibers, init)
^~~~~~~~~~~
../src/fibers.cc: In instantiation of ‘void uni::Return(v8::Persistent<T, v8::NonCopyablePersistentTraits<T> >&, uni::GetterCallbackInfo) [with T = v8::Object; uni::GetterCallbackI
nfo = v8::PropertyCallbackInfo<v8::Value>]’:
../src/fibers.cc:814:45: required from here
../src/fibers.cc:185:3: warning: ‘void v8::ReturnValue<T>::Set(const v8::Persistent<S>&) [with S = v8::Object; T = v8::Value]’ is deprecated: Use Global<> instead [-Wdeprecated-dec
larations]
info.GetReturnValue().Set(handle);
^~~~
In file included from /home/nweiz/.node-gyp/12.0.0/include/node/node.h:63:0,
from ../src/coroutine.h:1,
from ../src/fibers.cc:1:
/home/nweiz/.node-gyp/12.0.0/include/node/v8.h:9990:6: note: declared here
void ReturnValue<T>::Set(const Persistent<S>& handle) {
^~~~~~~~~~~~~~
fibers.target.mk:116: recipe for target 'Release/obj.target/fibers/src/fibers.o' failed
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
make: Leaving directory '/home/nweiz/.nvm/versions/node/v12.0.0/lib/node_modules/fibers/build'
1) 4.9.9.2 on Windows XP
2)
include <iostream>
include <shellapi.h>
int main()
{
std::cout << «Hello, world!n»;
}
3)
Compiler: Default compiler
Building Makefile: «C:Dev-CppMakefile.win»
Executing make…
make.exe -f «C:Dev-CppMakefile.win» all
g++.exe -c Untitled1.cpp -o Untitled1.o -I»C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include» -I»C:/Dev-Cpp/include/c++/3.4.2/backward» -I»C:/Dev-Cpp/include/c++/3.4.2/mingw32″ -I»C:/Dev-Cpp/include/c++/3.4.2″ -I»C:/Dev-Cpp/include»
In file included from Untitled1.cpp:2:
C:/Dev-Cpp/include/shellapi.h:127: error: WORD' does not name a type
WORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:128: error:
In file included from Untitled1.cpp:2:
C:/Dev-Cpp/include/shellapi.h:131: error: `DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:132: error: HWND' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:133: error:
C:/Dev-Cpp/include/shellapi.h:134: error: UINT' does not name a type
RECT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:135: error:
C:/Dev-Cpp/include/shellapi.h:136: error: LPARAM' does not name a type
,’ or
C:/Dev-Cpp/include/shellapi.h:138: error: expected constructor, destructor, or type conversion before '(' token
C:/Dev-Cpp/include/shellapi.h:138: error: expected;' before '(' token
DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:141: error:
C:/Dev-Cpp/include/shellapi.h:142: error: HWND' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:143: error:
C:/Dev-Cpp/include/shellapi.h:144: error: UINT' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:145: error:
C:/Dev-Cpp/include/shellapi.h:146: error: HICON' does not name a type
CHAR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:159: error:
C:/Dev-Cpp/include/shellapi.h:167: error: DWORD' does not name a type
HWND’ does not name a type
C:/Dev-Cpp/include/shellapi.h:168: error:
C:/Dev-Cpp/include/shellapi.h:169: error: UINT' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:170: error:
C:/Dev-Cpp/include/shellapi.h:171: error: UINT' does not name a type
HICON’ does not name a type
C:/Dev-Cpp/include/shellapi.h:172: error:
C:/Dev-Cpp/include/shellapi.h:185: error: WCHAR' does not name a type
DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:193: error:
C:/Dev-Cpp/include/shellapi.h:194: error: ULONG' does not name a type
HWND’ does not name a type
C:/Dev-Cpp/include/shellapi.h:195: error:
C:/Dev-Cpp/include/shellapi.h:196: error: LPCSTR' does not name a type
LPCSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:197: error:
C:/Dev-Cpp/include/shellapi.h:198: error: LPCSTR' does not name a type
LPCSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:199: error:
C:/Dev-Cpp/include/shellapi.h:201: error: HINSTANCE' does not name a type
PVOID’ does not name a type
C:/Dev-Cpp/include/shellapi.h:202: error:
C:/Dev-Cpp/include/shellapi.h:203: error: LPCSTR' does not name a type
HKEY’ does not name a type
C:/Dev-Cpp/include/shellapi.h:204: error:
C:/Dev-Cpp/include/shellapi.h:205: error: DWORD' does not name a type
HANDLE’ does not name a type
C:/Dev-Cpp/include/shellapi.h:206: error:
C:/Dev-Cpp/include/shellapi.h:207: error: HANDLE' does not name a type
DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:210: error:
C:/Dev-Cpp/include/shellapi.h:211: error: ULONG' does not name a type
HWND’ does not name a type
C:/Dev-Cpp/include/shellapi.h:212: error:
C:/Dev-Cpp/include/shellapi.h:213: error: LPCWSTR' does not name a type
LPCWSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:214: error:
C:/Dev-Cpp/include/shellapi.h:215: error: LPCWSTR' does not name a type
LPCWSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:216: error:
C:/Dev-Cpp/include/shellapi.h:218: error: HINSTANCE' does not name a type
PVOID’ does not name a type
C:/Dev-Cpp/include/shellapi.h:219: error:
C:/Dev-Cpp/include/shellapi.h:220: error: LPCWSTR' does not name a type
HKEY’ does not name a type
C:/Dev-Cpp/include/shellapi.h:221: error:
C:/Dev-Cpp/include/shellapi.h:222: error: DWORD' does not name a type
HANDLE’ does not name a type
C:/Dev-Cpp/include/shellapi.h:223: error:
C:/Dev-Cpp/include/shellapi.h:224: error: HANDLE' does not name a type
HWND’ does not name a type
C:/Dev-Cpp/include/shellapi.h:227: error:
C:/Dev-Cpp/include/shellapi.h:228: error: UINT' does not name a type
LPCSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:229: error:
C:/Dev-Cpp/include/shellapi.h:230: error: LPCSTR' does not name a type
FILEOP_FLAGS’ does not name a type
C:/Dev-Cpp/include/shellapi.h:231: error:
C:/Dev-Cpp/include/shellapi.h:232: error: BOOL' does not name a type
PVOID’ does not name a type
C:/Dev-Cpp/include/shellapi.h:233: error:
C:/Dev-Cpp/include/shellapi.h:234: error: LPCSTR' does not name a type
HWND’ does not name a type
C:/Dev-Cpp/include/shellapi.h:237: error:
C:/Dev-Cpp/include/shellapi.h:238: error: `UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:239: error: LPCWSTR' does not name a type
LPCWSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:240: error:
C:/Dev-Cpp/include/shellapi.h:241: error: FILEOP_FLAGS' does not name a type
BOOL’ does not name a type
C:/Dev-Cpp/include/shellapi.h:242: error:
C:/Dev-Cpp/include/shellapi.h:243: error: PVOID' does not name a type
LPCWSTR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:244: error:
C:/Dev-Cpp/include/shellapi.h:247: error: HICON' does not name a type
DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:249: error:
C:/Dev-Cpp/include/shellapi.h:250: error: CHAR' does not name a type
CHAR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:251: error:
C:/Dev-Cpp/include/shellapi.h:254: error: HICON' does not name a type
DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:256: error:
C:/Dev-Cpp/include/shellapi.h:257: error: WCHAR' does not name a type
WCHAR’ does not name a type
C:/Dev-Cpp/include/shellapi.h:258: error:
C:/Dev-Cpp/include/shellapi.h:261: error: DWORD' does not name a type
,’ or
In file included from Untitled1.cpp:2:
C:/Dev-Cpp/include/shellapi.h:267: error: expected constructor, destructor, or type conversion before '*' token
C:/Dev-Cpp/include/shellapi.h:267: error: expected;' before '*' token
WINAPI’ does not name a type
C:/Dev-Cpp/include/shellapi.h:268: error:
C:/Dev-Cpp/include/shellapi.h:269: error: WINAPI' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:270: error:
C:/Dev-Cpp/include/shellapi.h:271: error: UINT' does not name a type
BOOL’ does not name a type
C:/Dev-Cpp/include/shellapi.h:272: error:
C:/Dev-Cpp/include/shellapi.h:273: error: HICON' does not name a type
HICON’ does not name a type
C:/Dev-Cpp/include/shellapi.h:274: error:
C:/Dev-Cpp/include/shellapi.h:275: error: HICON' does not name a type
HICON’ does not name a type
C:/Dev-Cpp/include/shellapi.h:276: error:
C:/Dev-Cpp/include/shellapi.h:277: error: HICON' does not name a type
UINT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:278: error:
C:/Dev-Cpp/include/shellapi.h:279: error: UINT' does not name a type
HINSTANCE’ does not name a type
C:/Dev-Cpp/include/shellapi.h:280: error:
C:/Dev-Cpp/include/shellapi.h:281: error: `HINSTANCE’ does not name a type
C:/Dev-Cpp/include/shellapi.h:282: error: UINT' does not name a type
BOOL’ does not name a type
C:/Dev-Cpp/include/shellapi.h:283: error:
C:/Dev-Cpp/include/shellapi.h:284: error: BOOL' does not name a type
WINAPI’ does not name a type
C:/Dev-Cpp/include/shellapi.h:285: error:
C:/Dev-Cpp/include/shellapi.h:286: error: WINAPI' does not name a type
HINSTANCE’ does not name a type
C:/Dev-Cpp/include/shellapi.h:287: error:
C:/Dev-Cpp/include/shellapi.h:288: error: HINSTANCE' does not name a type
BOOL’ does not name a type
C:/Dev-Cpp/include/shellapi.h:289: error:
C:/Dev-Cpp/include/shellapi.h:290: error: BOOL' does not name a type
WINAPI’ does not name a type
C:/Dev-Cpp/include/shellapi.h:291: error:
C:/Dev-Cpp/include/shellapi.h:292: error: WINAPI' does not name a type
WINAPI’ does not name a type
C:/Dev-Cpp/include/shellapi.h:293: error:
C:/Dev-Cpp/include/shellapi.h:294: error: `DWORD’ does not name a type
C:/Dev-Cpp/include/shellapi.h:295: error: DWORD' does not name a type
HRESULT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:296: error:
C:/Dev-Cpp/include/shellapi.h:297: error: HRESULT' does not name a type
HRESULT’ does not name a type
C:/Dev-Cpp/include/shellapi.h:298: error:
C:/Dev-Cpp/include/shellapi.h:299: error: `HRESULT’ does not name a type
make.exe: *** [Untitled1.o] Error 1
Execution terminated
When the compiler compiles the class User
and gets to the MyMessageBox
line, MyMessageBox
has not yet been defined. The compiler has no idea MyMessageBox
exists, so cannot understand the meaning of your class member.
You need to make sure MyMessageBox
is defined before you use it as a member. This is solved by reversing the definition order. However, you have a cyclic dependency: if you move MyMessageBox
above User
, then in the definition of MyMessageBox
the name User
won’t be defined!
What you can do is forward declare User
; that is, declare it but don’t define it. During compilation, a type that is declared but not defined is called an incomplete type.
Consider the simpler example:
struct foo; // foo is *declared* to be a struct, but that struct is not yet defined
struct bar
{
// this is okay, it's just a pointer;
// we can point to something without knowing how that something is defined
foo* fp;
// likewise, we can form a reference to it
void some_func(foo& fr);
// but this would be an error, as before, because it requires a definition
/* foo fooMember; */
};
struct foo // okay, now define foo!
{
int fooInt;
double fooDouble;
};
void bar::some_func(foo& fr)
{
// now that foo is defined, we can read that reference:
fr.fooInt = 111605;
fr.foDouble = 123.456;
}
By forward declaring User
, MyMessageBox
can still form a pointer or reference to it:
class User; // let the compiler know such a class will be defined
class MyMessageBox
{
public:
// this is ok, no definitions needed yet for User (or Message)
void sendMessage(Message *msg, User *recvr);
Message receiveMessage();
vector<Message>* dataMessageList;
};
class User
{
public:
// also ok, since it's now defined
MyMessageBox dataMsgBox;
};
You cannot do this the other way around: as mentioned, a class member needs to have a definition. (The reason is that the compiler needs to know how much memory User
takes up, and to know that it needs to know the size of its members.) If you were to say:
class MyMessageBox;
class User
{
public:
// size not available! it's an incomplete type
MyMessageBox dataMsgBox;
};
It wouldn’t work, since it doesn’t know the size yet.
On a side note, this function:
void sendMessage(Message *msg, User *recvr);
Probably shouldn’t take either of those by pointer. You can’t send a message without a message, nor can you send a message without a user to send it to. And both of those situations are expressible by passing null as an argument to either parameter (null is a perfectly valid pointer value!)
Rather, use a reference (possibly const):
void sendMessage(const Message& msg, User& recvr);
The Arduino software is an open-source and easy to use platform which configures the Arduino board into functioning in a certain way. An Arduino code is written in C++ but with additional functions and methods. An Arduino is a hardware and software platform widely used in electronics.
In this article, we will see a few quick fixes for the error ‘does not name a type‘ or the ‘no such file or directory‘ error.
Also read: How to stop an Arduino program?
What does the error mean?
In almost every coding language known to man, every variable has a specific data type. In general, there are multiple data types like int indicating integer, float for decimal values, char and String for alphabets and sentences, boolean for true or false and many more. In Arduino, there are 16 data types commonly used.
- void: Used in function declarations, and indicates that the function will not return anything.
- boolean: It is a true or false value.
- char: Stores a character value in one byte of the memory.
- Unsigned char: Unsigned data type which encodes numbers between 0 and 255 and occupies one byte of the memory.
- byte: It is an 8-bit unsigned number holding a value between 0 and 255.
- int: It is a primary data type which stores a 16-bit integer value. It can store negative values.
- Unsigned int: Unsigned integer that stores only positive integer values in the 2 byte memory.
- long: It is a 32-bit memory for storing numbers, both positive and negative.
- Unsigned long: Unsigned long variables store only positive numbers in the 32-bit memory storage.
- short: It is a 16-bit data type storing positive and negative numbers.
- float: It is a decimal value having a 32-bit memory.
- double: It is a double floating number having either 32 or 64 bit memory depending on the board.
- word: Based on the type of board, it stores either 16-bit or 32-bit unsigned number.
- array: It is a collection of variables which is accessible using index numbers.
- String-char array: Converts the string into an array of characters.
- String-object: Class which can be used to manipulate, concatenate and perform other operations on strings and arrays.
The error ‘does not name a type‘ or the ‘no such file or directory‘ are errors that occur during the compilation process. They generally indicate missing data types or wrongly used data types. It may also indicate missing directories or libraries.
Also read: Arduino UNO vs Arduino Mega.
Here are two ways to fix the error.
Check data type
Every user-defined function and variable initialised or declared in the code should have a corresponding data type. The data type of the variable or function should also coincide with the value being stored or returned.
Consider a small example sample code below.
Here the function MQRead is of the type float. The variables i and mq_pin are integer type, while rs is float type. In the for loop, i is given the value 0, an integer value. The analogRead function always reads an integer value, which is being assigned to the mq_pin variable. Since the value or type for rs, the float type suffices for any value assigned to it as a result of the calculation. The user-defined function MQRead is of type float, which means that the return type for it is float, which is achieved by returning the value of rs for the function.
The error occurs if any of these data types don’t stand to the data being stored in the variables. Always check and recheck the data type for every variable, function and return type.
Library folder
In many cases, you may use libraries that are not standard or included in Arduino. But Arduino is flexible with the import of new libraries, making it easy to use all functions from any library. Follow the path below to check the currently available libraries in your Arduino software.
My Documents -> Arduino -> Libraries
Consider the snippet of code below. There are four library folders that are included for the code to work. But these aren’t a part of the standard library of Arduino.
There are two ways to import a library to the Arduino.
Method 1
Step 1: Click on Sketch on the top left panel of the window. Go to the include Library option and select Manage Libraries.
Keyboard Shortcut: Ctrl+Shift+I.
Step 2: Search or select from the options available and click on Install.
Note that a few Libraries may not be available if your software isn’t updated with the latest version.
All the libraries you are planning to use may not be easily found under the Manage Libraries section. In such cases, we use Method 2 for importing the libraries.
Method 2
Step 1: Download a zip file for the library from GitHub or any other reliable source present online.
Step 2: Click on Sketch on the top left panel of the window. Go to the include Library option and select Add ZIP Library.
Step 3: Set the file type to be ZIP files and folders.
Step 4: Go to the download location of the zip file and select it. Click on Open.
The library is successfully added to the Arduino software now.
Also read: NodeMCU vs Arduino vs Raspberry Pi.
Error 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.
TABLE OF CONTENTS
- Why this error occurs?
- How to resolve:
- Solution 1:
- Solution 2:
- Solution 3:
- Conclusion
Why this error occurs?
File: sample.h
#ifndef SAMPLE_H__<br />#define SAMPLE_H__
namespace Sampletest {
class CP_M_ReferenceCounted<br />{<br />};
}
#endif
<br />File : test.cpp
#include "sample.h"
typedef CP_M_ReferenceCounted FxRC;
<br />int main(int argc, char **argv)<br />{
<p>return 0;<br />}
If you run the above code you will get the error «…error: CP_M_ReferenceCounted does not name a type»
How to resolve :
To overcome this error follow this two methods of solutions
Solution 1:
To avoid this error, we have to add the «using namespace Sampletest» at the start of the program in C++.
To avoid this error, we have to add the «using namespace Sampletest» at the start of the program in C++.
<p>File : test.cpp</p>
<p><code>#include "sample.h"</p>
<p>//Add the following to your code</p>
<p>using namespace Sampletest</p>
<p>typedef CP_M_ReferenceCounted FxRC;</p>
<p><br />int main(int argc, char **argv)<br />{</p>
<p>return 0;<br />}</code></p>
Solution 2:
To avoid this kind of error we need to add the header «#include sample.h» at the starting of the program in C++.
Same Problem while declaring outside of the function
These kinds of errors are also acquired while printing outside of any function.
A statement which isn’t declaration in C++ need to be printed inside of the function
File test.cpp
<p>#include <iostream><br />#include <cstring><br />using namespace std;</p>
<p>struct Node{<br />char *name;<br />int age;<br />Node(char *nc = "", int ax = 0){<br />name = new char[strlen(nc) + 1];<br />strcpy(name, n);<br />age = ax;<br />}<br />};</p>
<p>Node node1("Roger", 20), node2(node1);<br />cout << node1.name << ' ' << node1.age << ' ' << node2.name << ' ' << node2.age;<br />strcpy(node2.name, "Wendy");<br />node2.name = 30;<br />cout << node1.name << ' ' << node1.age << ' ' << node2.name << ' ' << node2.age;</p>
<p> </p>
<p><b>Output :</b></p>
<p>error: ‘node2’ does not name a type</p>
<br/>
Solution 3:
To avoid these types of errors you need to add everything inside the function,
because a statement that isn’t a declaration in C++ needs to be inside the function
<p><code>int main() {<br />Node node1("Roger", 20), node2(node1);<br />cout << node1.name << ' ' << node1.age << ' ' << node2.name << ' ' << node2.age;<br />strcpy(node2.name, "Wendy");<br />node2.name = 30;<br />cout << node1.name << ' ' << node1.age << ' ' << node2.name << ' ' << node2.age;<br />}</code></p>
Conclusion:
In this article, we have seen why the undefined error occurs in C/C++ and discussed how to resolve these errors in various methods.