Skip to content

Build failing on windows #2083

@shivam201312

Description

@shivam201312

Hi.. i am trying to run clang code in nodejs. I am using node.gyp module for that. i have code that is running fine on Linux and MacOS but when i am compiling it on windows it is throwing an error.
Steps i have followed

  1. Clang library
  2. Build .so file of the Clang library
  3. Include that .so file in c program (file.cc)
  4. Using node-gyp convert c program (file.cc) into .node file

Details of MacOS :

Apples-MBP-3:~ Apple$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Apples-MBP-3:~ Apple$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Details for Ubuntu :

shivam@zz:~$ gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 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.

shivam@zz:~$ g++ --version
g++ (Ubuntu 5.5.0-12ubuntu1~16.04) 5.5.0 20171010
Copyright (C) 2015 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.

Details for Windows :

gcc (tdm64-1) 5.1.0
Copyright (C) 2015 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:\Users\zz\Downloads\storj_windows>g++ --version
g++ (tdm64-1) 5.1.0
Copyright (C) 2015 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.

Tried
i have tried different compiler but doesn't work for me .

Error i am getting

bf58-e80b-19d1-6a91-2

Binding.gyp file i am using while building

{
  'targets': [
    {
      'target_name': 'file',
      'sources': [ './file.cc'],
      "include_dirs":["./"],
      "libraries":["<(module_root_dir)/clang.so"],
      "ldflags": ["-Wl,-rpath,'$$ORIGIN'"],
      "cflags_cc": ["-fexceptions","-fPIC","-Wno-unknown-pragmas"]
    }
  ]
}

Question:

  1. How can i resolve above error ?
  2. Is this issue related to different compiler ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions