joto / osmium

C++/Javascript framework for working with OSM files.
http://wiki.openstreetmap.org/wiki/Osmium
GNU General Public License v3.0
123 stars 31 forks source link

osmjs build errors #81

Closed hpeifer closed 11 years ago

hpeifer commented 11 years ago

I am trying to get osmium/osmjs going under MacOS X 10.7.5, aka Lion. Most tests and all examples work fine, but I get the below errors (and many more) when trying to build osmjs. Any idea about what to do? I am using v8 version 3.21.15, from MacPorts. -- Hermann

$ cd osmium/osmjs
$ make

(...)

In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:31:
In file included from ../include/osmium/javascript/wrapper/position.hpp:28:
../include/osmium/javascript/template.hpp:80:62: error: no type named 'Arguments' in namespace 'v8'; did you mean '::v8::internal::Arguments'?
            static v8::Handle<v8::Value> undefined(const v8::Arguments& /*args*/) {
                                                         ~~~~^~~~~~~~~
                                                             ::v8::internal::Arguments
/opt/local/include/v8.h:140:7: note: '::v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:31:
In file included from ../include/osmium/javascript/wrapper/position.hpp:28:
../include/osmium/javascript/template.hpp:99:91: error: no type named 'AccessorInfo' in namespace 'v8'
            static v8::Handle<v8::Value> accessor_getter(v8::Local<v8::String>, const v8::AccessorInfo& info) {
                                                                                      ~~~~^
../include/osmium/javascript/template.hpp:104:106: error: no type named 'AccessorInfo' in namespace 'v8'
            static v8::Handle<v8::Value> named_property_getter(v8::Local<v8::String> property, const v8::AccessorInfo& info) {
                                                                                                     ~~~~^
../include/osmium/javascript/template.hpp:109:92: error: no type named 'AccessorInfo' in namespace 'v8'
            static v8::Handle<v8::Value> indexed_property_getter(uint32_t index, const v8::AccessorInfo& info) {
                                                                                       ~~~~^
../include/osmium/javascript/template.hpp:114:72: error: no type named 'AccessorInfo' in namespace 'v8'
            static v8::Handle<v8::Array> property_enumerator(const v8::AccessorInfo& info) {
                                                                   ~~~~^
../include/osmium/javascript/template.hpp:118:78: error: no type named 'Arguments' in namespace 'v8'; did you mean '::v8::internal::Arguments'?
            template <class TWrapped, v8::Handle<v8::Value> (func)(const v8::Arguments&, TWrapped*)>
                                                                         ~~~~^~~~~~~~~
                                                                             ::v8::internal::Arguments
/opt/local/include/v8.h:140:7: note: '::v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:31:
In file included from ../include/osmium/javascript/wrapper/position.hpp:28:
../include/osmium/javascript/template.hpp:119:70: error: no type named 'Arguments' in namespace 'v8'; did you mean '::v8::internal::Arguments'?
            static v8::Handle<v8::Value> function_template(const v8::Arguments& args) {
                                                                 ~~~~^~~~~~~~~
                                                                     ::v8::internal::Arguments
/opt/local/include/v8.h:140:7: note: '::v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:31:
In file included from ../include/osmium/javascript/wrapper/position.hpp:28:
../include/osmium/javascript/template.hpp:59:61: error: member reference type 'v8::Persistent<v8::ObjectTemplate>' is not a pointer
                v8::Local<v8::Object> instance = js_template->NewInstance();
                                                 ~~~~~~~~~~~^
../include/osmium/javascript/template.hpp:66:83: error: 'New' is a private member of 'v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
                v8::Persistent<v8::Object> instance = v8::Persistent<v8::Object>::New(create_instance(wrapped));
                                                                                  ^
/opt/local/include/v8.h:733:23: note: declared private here
  V8_INLINE static T* New(Isolate* isolate, T* that);
                      ^
In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:31:
In file included from ../include/osmium/javascript/wrapper/position.hpp:28:
../include/osmium/javascript/template.hpp:128:65: error: 'New' is a private member of 'v8::Persistent<v8::ObjectTemplate, v8::NonCopyablePersistentTraits<v8::ObjectTemplate> >'
                js_template(v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New())) {
                                                                ^
/opt/local/include/v8.h:733:23: note: declared private here
  V8_INLINE static T* New(Isolate* isolate, T* that);
                      ^
joto commented 11 years ago

Looks like Google changed the V8 interface, but I can't find any changes document telling me what changed.

It works with V8 version 3.14, if you can, try with that.

hpeifer commented 11 years ago

Thanks for the hint. The oldest MacPorts v8 package I could find was 3.15.11. I tried using this version and now osmjs compiles without any errors. There are 16 warning though, see below. Maybe it would be worth mentioning in the README which v8 versions are suitable for compiling osmjs -- and which are not.

$ make

(...)

In file included from osmjs.cpp:28:
In file included from ../include/osmium.hpp:26:
In file included from ../include/osmium/input/pbf.hpp:33:
In file included from /Users/peifer/local/include/osmpbf/osmpbf.h:5:
In file included from /Users/peifer/local/include/osmpbf/fileformat.pb.h:9:
/opt/local/include/google/protobuf/stubs/common.h:723:29: warning: unused parameter 'file' [-Wunused-parameter]
T* CheckNotNull(const char *file, int line, const char *name, T* val) {
                            ^
/opt/local/include/google/protobuf/stubs/common.h:723:39: warning: unused parameter 'line' [-Wunused-parameter]
T* CheckNotNull(const char *file, int line, const char *name, T* val) {
                                      ^
In file included from osmjs.cpp:28:
In file included from ../include/osmium.hpp:26:
In file included from ../include/osmium/input/pbf.hpp:33:
In file included from /Users/peifer/local/include/osmpbf/osmpbf.h:5:
In file included from /Users/peifer/local/include/osmpbf/fileformat.pb.h:25:
/opt/local/include/google/protobuf/extension_set.h:797:59: warning: unused parameter 'field_type' [-Wunused-parameter]
  static inline MutableType Release(int number, FieldType field_type,
                                                          ^
In file included from osmjs.cpp:30:
In file included from ../include/osmium/javascript.hpp:27:
In file included from ../include/osmium/javascript/handler.hpp:28:
/opt/local/include/v8.h:2621:48: warning: unused parameter 'name' [-Wunused-parameter]
      GetNativeFunction(v8::Handle<v8::String> name) {
                                               ^
/opt/local/include/v8.h:3082:51: warning: unused parameter 'string' [-Wunused-parameter]
  virtual void VisitExternalString(Handle<String> string) {}
                                                  ^
/opt/local/include/v8.h:3092:56: warning: unused parameter 'value' [-Wunused-parameter]
  virtual void VisitPersistentHandle(Persistent<Value> value,
                                                       ^
/opt/local/include/v8.h:3093:47: warning: unused parameter 'class_id' [-Wunused-parameter]
                                     uint16_t class_id) {}
                                              ^
/opt/local/include/v8.h:4091:60: warning: unused parameter 'data' [-Wunused-parameter]
  virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) {
                                                           ^
/opt/local/include/v8.h:4091:70: warning: unused parameter 'count' [-Wunused-parameter]
  virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) {
                                                                     ^
/opt/local/include/v8.h:4270:51: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(void* o)) { return false; }
                                                  ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4271:54: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(Context* o)) { return true; }
                                                     ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4272:53: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(String* o)) { return true; }
                                                    ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4273:53: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(Object* o)) { return true; }
                                                    ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4274:54: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(Message* o)) { return true; }
                                                     ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4275:57: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(StackTrace* o)) { return true; }
                                                        ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
/opt/local/include/v8.h:4276:57: warning: unused parameter 'o' [-Wunused-parameter]
  V8_INLINE(static bool CanCastToHeapObject(StackFrame* o)) { return true; }
                                                        ^
/opt/local/include/v8.h:80:69: note: expanded from macro 'V8_INLINE'
#define V8_INLINE(declarator) inline __attribute__((always_inline)) declarator
                                                                    ^
16 warnings generated.
joto commented 11 years ago

I have added this info to the README.