mod_dart icon indicating copy to clipboard operation
mod_dart copied to clipboard

compile errors

Open stutteringp0et opened this issue 12 years ago • 5 comments

I've forked your project and made some modifications to get it to compile, but I'm not familiar enough with Dart to figure these out. I know it's been several months since you've updated it, but I hope you'll consider giving it a refresh.

This is where it's failing after my very slight modifications.

src/mod_dart.c: In function 'bool IsolateCreate(const char_, const char_, void_, char__)': src/mod_dart.c:63:50: error: cannot convert 'Builtin::BuiltinLibraryId' to 'Dart_Handle {aka Dart_Handle}' for argument '1' to 'Dart_Handle* Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver)' src/mod_dart.c:64:45: error: cannot convert 'Builtin::BuiltinLibraryId' to 'Dart_Handle {aka Dart_Handle}' for argument '1' to 'Dart_Handle Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver)' src/mod_dart.c: In function 'void dart_child_init(apr_pool_t, server_rec_)': src/mod_dart.c:248:98: error: too few arguments to function 'bool Dart_Initialize(Dart_IsolateCreateCallback, Dart_IsolateInterruptCallback, Dart_IsolateShutdownCallback)' /home/michael/dart/dart-repo/dart/runtime/include/dart_api.h:631:18: note: declared here src/mod_dart.c: In function 'int dart_snapshots(apr_pool_t_, apr_pool_t_, apr_pool_t_, server_rec_)': src/mod_dart.c:347:96: error: too few arguments to function 'bool Dart_Initialize(Dart_IsolateCreateCallback, Dart_IsolateInterruptCallback, Dart_IsolateShutdownCallback)' /home/michael/dart/dart-repo/dart/runtime/include/dart_api.h:631:18: note: declared here apxs:Error: Command failed with rc=65536

stutteringp0et avatar Jul 19 '12 08:07 stutteringp0et

I bypassed the Dart_Initialize error by adding a third argument 'NULL' to the function, and now I get errors on these two lines in the IsolateCreate function:

Dart_SetNativeResolver(Builtin::kBuiltinLibrary); Dart_SetNativeResolver(Builtin::kIOLibrary);

src/mod_dart.c: In function 'bool IsolateCreate(const char_, const char_, void_, char__)': src/mod_dart.c:63:50: error: cannot convert 'Builtin::BuiltinLibraryId' to 'Dart_Handle {aka Dart_Handle}' for argument '1' to '_Dart_Handle* Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver)' src/mod_dart.c:64:45: error: cannot convert 'Builtin::BuiltinLibraryId' to 'Dart_Handle {aka Dart_Handle}' for argument '1' to 'Dart_Handle Dart_SetNativeResolver(Dart_Handle, Dart_NativeEntryResolver)' apxs:Error: Command failed with rc=65536

Again, the issue is - not enough arguments (I think).

Since Builtin:kBuiltinLibrary and Builtin:kIOLibrary aren't Dart_Handle types, what is the first argument supposed to be?

If I comment these lines, the module compiles - but fails to load with this error: mod_dart.so: undefined symbol: __cxa_pure_virtual

stutteringp0et avatar Aug 21 '12 06:08 stutteringp0et

Apologies for the late response, I think this should be fixed now. (Mostly in https://github.com/sam-mccall/mod_dart/commit/d1fe3fc9dd1be17f9ccac448dfa8529197316497). The Dart APIs and development environments are a moving target (just upgraded to Mac OS 10.8), and I've been quite busy with work.

I added a shutdown callback, and switched to the new API for setting native resolvers following the example that introduced the change: https://chromiumcodereview.appspot.com/10532123/diff/14001/runtime/bin/main.cc?context=10&column_width=80

There also seems to be a new dependency within dart on a web_gen module within dart, which took some fiddling to get right.

Let me know whether this works for you!

sam-mccall avatar Aug 22 '12 11:08 sam-mccall

After updating to the latest dart version available, and updating your package to this latest update - I'm still getting: undefined symbol: __cxa_pure_virtual

Searching that error gives not much insight into the problem...

I appreciate the update!

stutteringp0et avatar Aug 23 '12 18:08 stutteringp0et

the latest changes (switch to runtime directory) I'm getting the same issue.... mod_dart.so: undefined symbol: __cxa_pure_virtual

stutteringp0et avatar Aug 23 '12 22:08 stutteringp0et

As you mentioned, dart is a moving target (there's a pun in there somewhere). So maybe I should wait until it stabilizes instead of trying serverside right now.

stutteringp0et avatar Aug 23 '12 22:08 stutteringp0et