dart-console icon indicating copy to clipboard operation
dart-console copied to clipboard

Build fails: ‘Dart_NewString’ was not declared in this scope'

Open tmst opened this issue 7 years ago • 1 comments

~/work/dart-console> export DART_SDK=~/work/dart-sdk ~/work/dart-console> ./build.sh g++ -O2 -DDART_SHARED_LIB -I/home/tom/work/dart-sdk/include -rdynamic -fPIC -shared src/dart_sandbox.cc -o lib/libdart_sandbox.so In file included from src/dart_sandbox.cc:7:0: src/dart_util.h: In function ‘void _Throw(Dart_Handle, const char*)’: src/dart_util.h:38:53: error: ‘Dart_NewString’ was not declared in this scope Dart_Handle messageHandle = Dart_NewString(message); ^ src/dart_sandbox.cc: In function ‘void NewLibrary(Dart_NativeArguments)’: src/dart_sandbox.cc:18:89: error: too few arguments to function ‘_Dart_Handle* Dart_LoadLibrary(Dart_Handle, Dart_Handle, Dart_Handle, intptr_t, intptr_t)’ Dart_Handle lib = Dart_NewPersistentHandle(CheckDartError(Dart_LoadLibrary(url, source))); ^ src/dart_util.h:35:58: note: in definition of macro ‘CheckDartError’ #define CheckDartError(handle) _CheckDartError(_library, handle) ^ In file included from src/dart_util.h:10:0, from src/dart_sandbox.cc:7: /home/tom/work/dart-sdk/include/dart_api.h:2999:25: note: declared here DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, ^ In file included from src/dart_sandbox.cc:7:0: src/dart_sandbox.cc: In function ‘void Declare(Dart_NativeArguments)’: src/dart_sandbox.cc:26:58: error: too few arguments to function ‘_Dart_Handle* Dart_LoadSource(Dart_Handle, Dart_Handle, Dart_Handle, Dart_Handle, intptr_t, intptr_t)’ CheckDartError(Dart_LoadSource(libraryHandle, url, text)); ^ src/dart_util.h:35:58: note: in definition of macro ‘CheckDartError’ #define CheckDartError(handle) _CheckDartError(_library, handle) ^ In file included from src/dart_util.h:10:0, from src/dart_sandbox.cc:7: /home/tom/work/dart-sdk/include/dart_api.h:3058:25: note: declared here DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library, ^ In file included from src/dart_sandbox.cc:7:0: src/dart_sandbox.cc: In function ‘void Import(Dart_NativeArguments)’: src/dart_sandbox.cc:44:70: error: too few arguments to function ‘_Dart_Handle* Dart_LoadLibrary(Dart_Handle, Dart_Handle, Dart_Handle, intptr_t, intptr_t)’ importHandle = CheckDartError(Dart_LoadLibrary(importName, source)); ^ src/dart_util.h:35:58: note: in definition of macro ‘CheckDartError’ #define CheckDartError(handle) _CheckDartError(_library, handle) ^ In file included from src/dart_util.h:10:0, from src/dart_sandbox.cc:7: /home/tom/work/dart-sdk/include/dart_api.h:2999:25: note: declared here DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url, ^ In file included from src/dart_sandbox.cc:7:0: src/dart_sandbox.cc: In function ‘void InitEnvMap(Dart_NativeArguments)’: src/dart_sandbox.cc:54:70: error: ‘Dart_NewString’ was not declared in this scope CheckDartError(Dart_Invoke(libraryHandle, Dart_NewString("_seedEnv"), 1, &map)); ^ src/dart_util.h:35:58: note: in definition of macro ‘CheckDartError’ #define CheckDartError(handle) _CheckDartError(_library, handle) ^ src/dart_sandbox.cc: In function ‘_Dart_Handle* dart_sandbox_Init(Dart_Handle)’: src/dart_util.h:65:81: error: invalid conversion from ‘void (* ()(Dart_Handle, int))(Dart_NativeArguments) {aka void ( ()(_Dart_Handle, int))(_Dart_NativeArguments*)}’ to ‘Dart_NativeEntryResolver {aka void (* ()(_Dart_Handle, int, bool*))(_Dart_NativeArguments*)}’ [-fpermissive] Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName);
^ src/dart_sandbox.cc:58:1: note: in expansion of macro ‘DART_LIBRARY’ DART_LIBRARY(sandbox) ^ src/dart_util.h:65:81: error: too few arguments to function ‘_Dart_Handle* Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver, Dart_NativeEntrySymbol)’ Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName);
^ src/dart_sandbox.cc:58:1: note: in expansion of macro ‘DART_LIBRARY’ DART_LIBRARY(sandbox) ^ In file included from src/dart_util.h:10:0, from src/dart_sandbox.cc:7: /home/tom/work/dart-sdk/include/dart_api.h:2701:1: note: declared here Dart_SetNativeResolver(Dart_Handle library, ^ In file included from /home/tom/work/dart-sdk/include/dart_api.h:67:0, from src/dart_util.h:10, from src/dart_sandbox.cc:7: src/dart_sandbox.cc: In function ‘void (* ResolveName(Dart_Handle, int))(Dart_NativeArguments)’: src/dart_util.h:71:31: error: ‘Dart_IsString8’ was not declared in this scope assert(Dart_IsString8(name));
^ src/dart_sandbox.cc:58:1: note: in expansion of macro ‘DART_LIBRARY’ DART_LIBRARY(sandbox)

tmst avatar May 18 '17 20:05 tmst

Similar error in build.sh:

./build.sh g++ -O2 -DDART_SHARED_LIB -I/usr/local/opt/dart/libexec/include -rdynamic -fPIC -dynamiclib -undefined suppress -flat_namespace src/dart_sandbox.cc -o lib/libdart_sandbox.dylib In file included from src/dart_sandbox.cc:7: src/dart_util.h:38:31: error: use of undeclared identifier 'Dart_NewString' Dart_Handle messageHandle = Dart_NewString(message); ^ src/dart_util.h:39:55: error: use of undeclared identifier 'Dart_NewString' Dart_Handle exceptionClass = Dart_GetClass(library, Dart_NewString("Exception")); ^ src/dart_sandbox.cc:18:61: error: use of undeclared identifier 'Dart_LoadLibrary' Dart_Handle lib = Dart_NewPersistentHandle(CheckDartError(Dart_LoadLibrary(url, source))); ^ src/dart_sandbox.cc:26:18: error: use of undeclared identifier 'Dart_LoadSource' CheckDartError(Dart_LoadSource(libraryHandle, url, text)); ^ src/dart_sandbox.cc:44:35: error: use of undeclared identifier 'Dart_LoadLibrary' importHandle = CheckDartError(Dart_LoadLibrary(importName, source)); ^ src/dart_sandbox.cc:46:18: error: use of undeclared identifier 'Dart_LibraryImportLibrary' CheckDartError(Dart_LibraryImportLibrary(libraryHandle, importHandle, Dart_Null())); ^ src/dart_sandbox.cc:54:45: error: use of undeclared identifier 'Dart_NewString' CheckDartError(Dart_Invoke(libraryHandle, Dart_NewString("_seedEnv"), 1, &map)); ^ src/dart_sandbox.cc:58:1: error: no matching function for call to 'Dart_SetNativeResolver' DART_LIBRARY(sandbox) ^~~~~~~~~~~~~~~~~~~~~ src/dart_util.h:65:31: note: expanded from macro 'DART_LIBRARY' Dart_Handle result_code = Dart_SetNativeResolver(parent_library, ResolveName);
^~~~~~~~~~~~~~~~~~~~~~ /usr/local/opt/dart/libexec/include/dart_api.h:2772:1: note: candidate function not viable: requires 3 arguments, but 2 were provided Dart_SetNativeResolver(Dart_Handle library, ^ src/dart_sandbox.cc:58:1: error: use of undeclared identifier 'Dart_IsString8'; did you mean 'Dart_IsString'? DART_LIBRARY(sandbox) ^ src/dart_util.h:71:12: note: expanded from macro 'DART_LIBRARY' assert(Dart_IsString8(name));
^ /usr/local/opt/dart/libexec/include/dart_api.h:1433:18: note: 'Dart_IsString' declared here DART_EXPORT bool Dart_IsString(Dart_Handle object); ^ 9 errors generated.

ryanhz avatar Aug 22 '19 23:08 ryanhz