小编zyy*_*259的帖子

具有多个入口点的动态库选项

我找到了一个带有多个入口点和UMD的webpack 库选项的示例

这是示例中的webpack.config.js:

var path = require("path");
module.exports = {
    entry: {
        alpha: "./alpha",
        beta: "./beta"
    },
    output: {
        path: path.join(__dirname, "js"),
        filename: "MyLibrary.[name].js",
        library: ["MyLibrary", "[name]"],
        libraryTarget: "umd"
    }
}
Run Code Online (Sandbox Code Playgroud)

我的问题是如何配置filenamelibrary动态.我想要的是:

  • filename入境alphaa.js
  • filename入境betab.js
  • library入境alphaAlpha
  • library入境betaBeta.

所以我想知道我是否可以通过以下方式配置这些选项function:

var path = require("path");
module.exports = {
    entry: {
        alpha: "./alpha",
        beta: "./beta"
    },
    output: …
Run Code Online (Sandbox Code Playgroud)

webpack

13
推荐指数
2
解决办法
1915
查看次数

无法解析类型'std :: default_random_engine'

我想在头随机中使用default_random_engine和uniform_real_distribution生成一些随机双数.

我使用Eclipse for C/C++和MinGW来构建我的项目.

  • Eclipse版本:4.2.1
  • Eclipse CDT C/C++开发工具版本:8.1.1.201209170703
  • Eclipse CDT GCC交叉编译器支持版本:1.1.0.201209170703
  • MinGW版本:4.6.2(使用"gcc -v"检查)

当我在编辑器中键入std :: default_random_engine时,Eclipse会提示我"无法解析类型'std :: default_random_engine'".

我已经配置了我的项目以支持C++ 11功能

然后我写了一个列表初始化向量和一个范围来测试C++ 11的支持,代码工作正常.

    vector<int> ivec = {1, 2, 3};
    for (int i : ivec)
        cout << i << " ";
    cout << endl;
Run Code Online (Sandbox Code Playgroud)

"std :: default_random_engine"出了什么问题,我该怎么做才能解决这个问题?

c++ eclipse c++11

7
推荐指数
1
解决办法
7542
查看次数

C++ 11 正则表达式错误

只是来自的示例代码C++ Primer 5th Edition: 17.3.3. Using the Regular Expression Library

主要文件main.cpp

#include <iostream>
#include "regexcase.h"
using namespace std;

int main() {
    using_regex();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

头文件regexcase.h

#ifndef REGEXCASE_H_
#define REGEXCASE_H_

#include <regex>
#include <string>

void using_regex();
std::string parseCode(std::regex_constants::error_type etype);

#endif /* REGEXCASE_H_ */
Run Code Online (Sandbox Code Playgroud)

源文件regexcase.cpp

#include "regexcase.h"
#include <iostream>
using namespace std;

void using_regex() {
    // look for words that violate a well-known spelling rule of thumb, "i before e, except after c":
    // …
Run Code Online (Sandbox Code Playgroud)

c++ regex gcc libstdc++ c++11

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×2

c++11 ×2

eclipse ×1

gcc ×1

libstdc++ ×1

regex ×1

webpack ×1