![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
大前端
ydsungan
这个作者很懒,什么都没留下…
展开
-
emcc -v出错?记一次及其艰难的emscripten的安装(webassembly)
官方文档地址:戳我官方文档给出的安装步骤:./emsdk install latest./emsdk activate latessource ./emsdk_env.sh这三步足以折磨人了!【最后:source ./emsdk_env.sh】配置环境应该不是永久的,只要切换新窗口就不行,每次打开一个窗口需要重新执行这一行命令!【我的环境】centos 7【虚拟机】首先克隆:git clone https://github.com/emscripten-core/emsdk.git克隆出原创 2021-08-06 17:40:33 · 1645 阅读 · 1 评论 -
error: ‘dynamic_cast’ not permitted with -fno-rtti
在使用nan方式的nodejs的c++扩展时,使用node-gyp编译c++源码时,报错error: ‘dynamic_cast’ not permitted with -fno-rtti是因为在c++源码中使用了dynamic_cast类型强转而报错,这个dynamic_cast需要有RTTI的支持,所以在binding.gyp的配置文件中加上:'cflags_cc!': [ '-fno-rtti' ] 就可以了。...原创 2021-08-02 13:58:53 · 850 阅读 · 0 评论 -
Nodejs用Nan的方式C++扩展并调用C++动态链接库
0.说明nodejs调用c++扩展有多种方式,这里使用Nan方式1.环境centos 7;nodejs v12.22node-gyp2.安装nan如下图所示,项目目录名为nan-test,首先在该项目目录下安装nan,npm install --save nan,安装成功后在项目目录下出现一个node_modules,里面有一个nan目录3.制作一个测试用的动态库如上图shared目录所示,calculate.hdouble add(double a, double b);doubl原创 2021-08-02 11:59:10 · 939 阅读 · 0 评论 -
NODEJS中的exports和module.exports
1 exports用法function func1(){ return "world";}exports.hellos = func1; //exports.后面才是向外面暴露的名字, //在外面需要使用hellos调用函数,func1是无效的exports.name = "mary";exports.age = "19";exports.hellos2 = function(){ //匿名函数 console.log("hello");}require("原创 2021-08-01 15:12:23 · 147 阅读 · 0 评论 -
centos 7 : node-gyp: command not found
全局安装后:npm install node-gyp -g找不到node-gyp建立软连接ln -s /usr/local/node/bin/node-gyp /usr/local/bin/node-gyp原创 2021-07-30 09:54:28 · 1366 阅读 · 0 评论 -
CSS:Flex实现并列式布局
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>ydsungan</title> <style> .container { /*容器设置为flex布局*/ display: flex; flex-wrap: wrap;/*可原创 2020-08-10 09:57:46 · 794 阅读 · 0 评论 -
ES6中的Class类
ES5和ES6分别怎么声明一个类ES5中声明一个类let Animal = function (type) { this.type = type}Animal.prototype.eat = function () { console.log("Animal吃")}//eat方法挂载在prototype上,如果直接挂载在Animal类上,那么就成了静态方法://Anim...原创 2020-02-01 22:11:01 · 74 阅读 · 0 评论 -
ES6中的数组的遍历,转换,生成,查找
1、ES5中数组的3中遍历方法forEach, forEach不支持break和continueconst arr = [1,2,3,4,5]arr.forEach(function (item) { //forEach遍历语法很简洁,但是break,continue失效了 console.log(item)})everyconst arr = [1,2,3,4,5...原创 2020-02-01 19:49:47 · 969 阅读 · 0 评论 -
ES6中的let和var的比较
全局变量在1.js中定义的var a = 10 在2.js中仍可使用a.var a = 123b = 1234其中a在当作全局变量使用,而b在当作window的属性在使用。全局变量不能被删除,但是属性是可以删除的。用window.b访问和直接用b访问效果一样,用var定义的全局变量和不用var定义的变量是不同的!函数作用域:functionfunction test (...原创 2020-02-01 17:11:03 · 116 阅读 · 0 评论 -
css网页布局,一列布局,俩列布局,三列布局,混合布局
css一列布局<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>一列布局</title> <style type="text/css"> *{padding: 0;margin: ...原创 2020-02-01 14:54:42 · 265 阅读 · 0 评论