alibaba / alibaba/funcraft

我在云函数 node.js 10 运行 https://www.npmjs.com/package/fbx2gltf 这个库报如下错误

Open
#689 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
931
Forks
128
PR merge metrics
No merged PRs in 30d

Description

```
我在云函数 node.js 10 运行 https://www.npmjs.com/package/fbx2gltf 这个库报如下错误

{
"errorMessage": "Converter output:\n/code/node_modules/fbx2gltf/bin/Linux/FBX2glTF: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /code/node_modules/fbx2gltf/bin/Linux/FBX2glTF)\n",
"errorType": "Error",
"stackTrace": [
"/code/node_modules/fbx2gltf/bin/Linux/FBX2glTF: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /code/node_modules/fbx2gltf/bin/Linux/FBX2glTF)",
"",
"at child.on.code (/code/node_modules/fbx2gltf/index.js:72:18)",
"at emit (events.js:189:13)",
"at maybeClose (internal/child_process.js:970:16)",
"at stream.socket.on (internal/child_process.js:389:11)",
"at emit (events.js:189:13)",
"at _handle.close (net.js:597:12)"
]
}
```

我在网上查阅了下,FBX2glTF 这个库使用的是新的 C++ 语法,我看云函数 node 环境使用的是 debian 系统。系统默认 gcc 版本为 4.9.2,而 FBX2glTF 这个库需要 gcc 版本至少为 5.0.0。我把 FBX2glTF 这个库 clone 下来在 debian 环境下也是编译不成功的,需要手动升级系统 gcc 版本才能编译成功,我猜想 FBX2glTF 想要在 debian 系统默认环境下运行需要修改 FBX2glTF 的源码,修改源码的话后期维护与升级都是成本比较高的,我想问下除了修改源码还有其他方式可以让 C++ 版本比较高的库运行在云函数中吗?

以下为 debian 系统 gcc 版本:

```
gcc --version
>> gcc (Debian 4.9.2-10+deb8u2) 4.9.2

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXXGLIBCXX_3.4
>> GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_DEBUG_MESSAGE_LENGTH

刚好到GLIBCXX_3.4.20 缺失GLIBCXX_3.4.21
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting node_modules/fbx2gltf/index.js at the reported line 72 and the bundled bin/Linux/FBX2glTF executable in the Node.js 10 cloud-function environment. Reproduce the GLIBCXX_3.4.21 loading error and compare the runtime's available libstdc++ symbols. Done means the issue has a verified deployment path or a clearly documented compatibility limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, node.js
Domain
cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.