Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: expected constructor, destructor, or type conversion before ‘<’ token #2

Closed
dliessi opened this issue Apr 21, 2014 · 15 comments

Comments

@dliessi
Copy link
Contributor

dliessi commented Apr 21, 2014

When building macos-alias from the Git repository with node-gyp rebuild I get the following error:

In file included from ../src/volume.cc:6:
../src/impl-apple.cc:28: error: expected constructor, destructor, or type conversion before ‘<’ token
make: *** [Release/obj.target/volume/src/volume.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/opt/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/davide/Programmazione/node-alias
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

I'm on Mac OS 10.6.

@LinusU
Copy link
Owner

LinusU commented Apr 21, 2014

Strange, it works for me with the exact same version of node and node-gyp. Could you please attach the output from node-gyp -v rebuild, maybe we are using different c compilers...

@dliessi
Copy link
Contributor Author

dliessi commented Apr 21, 2014

$ node-gyp -v rebuild
gyp info it worked if it ends with ok
gyp verb cli [ 'node', '/opt/local/bin/node-gyp', '-v', 'rebuild' ]
gyp info using node-gyp@0.13.0
gyp info using node@0.10.26 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /opt/local/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.6\n"
gyp verb get node dir no --target version specified, falling back to host node version: v0.10.26
gyp verb command install [ 'v0.10.26' ]
gyp verb install input version string "v0.10.26"
gyp verb install installing version: 0.10.26
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.10.26
gyp verb build dir attempting to create "build" dir: /Users/davide/Programmazione/node-alias/build
gyp verb build dir "build" dir needed to be created? /Users/davide/Programmazione/node-alias/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/davide/Programmazione/node-alias/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/davide/Programmazione/node-alias/config.gypi
gyp verb common.gypi checking for gypi file: /Users/davide/Programmazione/node-alias/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn python
gyp info spawn args [ '/opt/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/davide/Programmazione/node-alias/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/davide/.node-gyp/0.10.26/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/davide/.node-gyp/0.10.26',
gyp info spawn args   '-Dmodule_root_dir=/Users/davide/Programmazione/node-alias',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/davide/.node-gyp/0.10.26
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  g++ '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/davide/.node-gyp/0.10.26/src -I/Users/davide/.node-gyp/0.10.26/deps/uv/include -I/Users/davide/.node-gyp/0.10.26/deps/v8/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/volume/src/volume.o.d.raw  -c -o Release/obj.target/volume/src/volume.o ../src/volume.cc
In file included from ../src/volume.cc:6:
../src/impl-apple.cc:28: error: expected constructor, destructor, or type conversion before ‘<’ token
make: *** [Release/obj.target/volume/src/volume.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/opt/local/bin/node-gyp" "-v" "rebuild"
gyp ERR! cwd /Users/davide/Programmazione/node-alias
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

@LinusU
Copy link
Owner

LinusU commented Apr 22, 2014

Hmm, this is quite weird but could you try CC=c++ node-gyp -v rebuild. I think that g++ is the gnu c compiler and that c++ is the system compiler, which on OS X is clang++.

I'll try to run it with g++ on my laptop when I get home...

@dliessi
Copy link
Contributor Author

dliessi commented Apr 22, 2014

I think that g++ is the gnu c compiler and that c++ is the system compiler, which on OS X is clang++.

Clang is the default on later versions of OS X. On 10.6 (Snow Leopard) the default compiler is GNU:

$ which c++ g++ clang
/usr/bin/c++
/usr/bin/g++
/usr/bin/clang

$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ c++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ clang --version
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix

Anyway, I tried both CXX=c++ node-gyp -v rebuild and CXX=clang node-gyp -v rebuild (the CC variable didn't change the compiler) and I still got the same error.

Right now I'm installing clang-3.4 with MacPorts: I'll try with that compiler and let you know.

@dliessi
Copy link
Contributor Author

dliessi commented Apr 22, 2014

Got a different error this time.

$ CXX=clang++-mp-3.4 node-gyp -v rebuild
gyp info it worked if it ends with ok
gyp verb cli [ 'node', '/opt/local/bin/node-gyp', '-v', 'rebuild' ]
gyp info using node-gyp@0.13.0
gyp info using node@0.10.26 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /opt/local/bin/python
gyp verb check python version `python -c "import platform; print(platform.python_version());"` returned: "2.7.6\n"
gyp verb get node dir no --target version specified, falling back to host node version: v0.10.26
gyp verb command install [ 'v0.10.26' ]
gyp verb install input version string "v0.10.26"
gyp verb install installing version: 0.10.26
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 0.10.26
gyp verb build dir attempting to create "build" dir: /Users/davide/Programmazione/node-alias/build
gyp verb build dir "build" dir needed to be created? /Users/davide/Programmazione/node-alias/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/davide/Programmazione/node-alias/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/davide/Programmazione/node-alias/config.gypi
gyp verb common.gypi checking for gypi file: /Users/davide/Programmazione/node-alias/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn python
gyp info spawn args [ '/opt/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/davide/Programmazione/node-alias/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/davide/.node-gyp/0.10.26/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/davide/.node-gyp/0.10.26',
gyp info spawn args   '-Dmodule_root_dir=/Users/davide/Programmazione/node-alias',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/davide/.node-gyp/0.10.26
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  clang++-mp-3.4 '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/davide/.node-gyp/0.10.26/src -I/Users/davide/.node-gyp/0.10.26/deps/uv/include -I/Users/davide/.node-gyp/0.10.26/deps/v8/include  -Os -gdwarf-2 -mmacosx-version-min=10.5 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-rtti -fno-exceptions -fno-threadsafe-statics -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/volume/src/volume.o.d.raw  -c -o Release/obj.target/volume/src/volume.o ../src/volume.cc
In file included from ../src/volume.cc:6:
../src/impl-apple.cc:39:43: error: use of undeclared identifier
      'kCFURLVolumeNameKey'; did you mean 'kCFURLVolumeURLKey'?
  if(CFURLCopyResourcePropertyForKey(url, kCFURLVolumeNameKey, &out, &error)) {
                                          ^~~~~~~~~~~~~~~~~~~
                                          kCFURLVolumeURLKey
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:593:19: note: 
      'kCFURLVolumeURLKey' declared here
const CFStringRef kCFURLVolumeURLKey AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
                  ^
1 error generated.
make: *** [Release/obj.target/volume/src/volume.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Darwin 10.8.0
gyp ERR! command "node" "/opt/local/bin/node-gyp" "-v" "rebuild"
gyp ERR! cwd /Users/davide/Programmazione/node-alias
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 

@dliessi
Copy link
Contributor Author

dliessi commented Apr 22, 2014

@LinusU
Copy link
Owner

LinusU commented Apr 22, 2014

So as I see it, it's really two problems.

  1. Old compilers don't like Handle<Value> MethodGetVolumeName(...) ... which is really strange. I'm no expert on C++ thought, but it might be an easy fix.

  2. Old OS X dosen't have api we depend on. This one might be easy to fix, I think I remember some deprecated way which was more straight forward for just getting the volume name. We could use that in a conditional for the pre-processor.

For both of this I don't really have the time to fix it, sorry. I would however welcome a pull request. I'm closing this since very few users are affected.

Just since I'm curious, why are you using OS X 10.6?

@LinusU LinusU closed this as completed Apr 22, 2014
@LinusU
Copy link
Owner

LinusU commented Apr 22, 2014

Also, a big thank you for taking the time and investigating the problem! 🍻

@dliessi
Copy link
Contributor Author

dliessi commented Apr 22, 2014

  1. Old compilers don't like Handle<Value> MethodGetVolumeName(...) ... which is really strange. I'm no expert on C++ thought, but it might be an easy fix.

Neither am I, but this is not much of a problem: using a recent clang is acceptable for me.

  1. Old OS X dosen't have api we depend on. This one might be easy to fix, I think I remember some deprecated way which was more straight forward for just getting the volume name. We could use that in a conditional for the pre-processor.

Can you give me any hint on that deprecated way?
I'd like to use appdmg for a project and I'll happily try to fix this: any hint in the right direction would be appreciated.

Just since I'm curious, why are you using OS X 10.6?

At first I could not update to 10.7 because of compatibility problems with some software, then I waited for 10.8 just to find out that my laptop cannot run 10.8+, so I'm stuck at 10.6 until I buy a new machine.

@LinusU
Copy link
Owner

LinusU commented Apr 23, 2014

Can you give me any hint on that deprecated way?
I'd like to use appdmg for a project and I'll happily try to fix this: any hint in the right direction would be appreciated.

https://developer.apple.com/library/mac/documentation/Carbon/reference/File_Manager/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/c/func/FSGetVolumeInfo

FSGetVolumeInfo(), you're interested in volumeName.

At first I could not update to 10.7 because of compatibility problems with some software, then I waited for 10.8 just to find out that my laptop cannot run 10.8+, so I'm stuck at 10.6 until I buy a new machine.

That's too bad for you, and I sometimes curse my 2010 MacBook Air for being slow :)

Reopening this since you're willing to work on it, happy coding!

@LinusU LinusU reopened this Apr 23, 2014
@LinusU
Copy link
Owner

LinusU commented Apr 25, 2014

closed by eb5965e

@LinusU
Copy link
Owner

LinusU commented Aug 22, 2015

@dliessi

Hi Davide,

I just updated this repository to Nan 2.0 but the code for Mac OS 10.6 doesn't work for me. Neither did it before I upgraded thought so I'm not sure if that is the problem.

It might be that the FSGetCatalogInfo is removed in OS X 10.10.

Are you still using 10.6? Would you be able to test if the latest version is working for you?

@dliessi
Copy link
Contributor Author

dliessi commented Aug 23, 2015

@LinusU
Hi.
Yes, I'm still on 10.6.
I actually had noticed that with recent versions of Node.js node-alias wasn't working for me, but I had no time at that moment to investigate further.
I've just tried the latest version of node-alias with Node.js 0.10.36 and it seems to build and work correctly.
Right now I'm upgrading Node.js to 0.12.7: I'll let you know the results of the test.

@dliessi
Copy link
Contributor Author

dliessi commented Aug 23, 2015

With Node.js 0.12.7 and the latest version of node-alias I get the following:



  addon
dyld: lazy symbol binding failed: Symbol not found: _FSGetCatalogInfo
  Referenced from: /Users/davide/Programmazione/node-alias/build/Release/volume.node
  Expected in: flat namespace

dyld: Symbol not found: _FSGetCatalogInfo
  Referenced from: /Users/davide/Programmazione/node-alias/build/Release/volume.node
  Expected in: flat namespace

Trace/BPT trap

@LinusU
Copy link
Owner

LinusU commented Aug 23, 2015

Ah crap :(

That's the same error message that I'm getting. I have no idea why thought.

I'll open a new bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants