我正在尝试在Fedora中安装带有-fPIC支持的GHC.我已经抓住了一个源tarball,因为它似乎没有二进制文件.
在Build.mk中,我已将快速构建类型更改为
ifeq "$(BuildFlavour)" "quick"
SRC_HC_OPTS = -H64m -O0 -fasm -fPIC
GhcStage1HcOpts = -O -fasm -fPIC
GhcStage2HcOpts = -O0 -fasm -fPIC
GhcLibHcOpts = -O -fasm -fPIC
SplitObjs = NO
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS = NO
BUILD_DOCBOOK_PDF = NO
endif
Run Code Online (Sandbox Code Playgroud)
不幸的是,在编译时我仍然得到ld错误
ghc -fglasgow-exts --make -shared -oHs2lib.a /tmp/Hs2lib924498/Hs2lib.hs dllmain.o -static -fno-warn-deprecated-flags -O2 -package ghc -package Hs2lib -i/home/phyx/Documents/Haskell/Hs2lib -optl-Wl,-s -funfolding-use-threshold=16 -optc-O3 -optc-ffast-math
Linking a.out ...
/usr/bin/ld: /tmp/Hs2lib924498/Hs2lib.o: relocation R_X86_64_32 against `ghczmprim_GHCziUnit_Z0T_closure' can not be used when making a shared object; …Run Code Online (Sandbox Code Playgroud) 嗨我使用gcc 4.7创建了一个带有noexcept移动构造函数的类Foo,并将向量保留大小设置为2,这样在添加第3项时就必须重新分配大小.在执行此操作时,它似乎正在调用复制构造函数而不是移动构造函数.我在这里错过了什么吗?
#include <vector>
#include <iostream>
class Foo
{
public:
Foo(int x) : data_(x)
{
std::cout << " constructing " << std::endl;
}
~Foo()
{
std::cout << " destructing " << std::endl;
}
Foo& operator=(const Foo&) = default;
Foo& operator=(Foo&&) = default;
Foo(Foo&& other) noexcept : data_(std::move(other.data_))
{
std::cout << " Move constructing " << std::endl;
}
Foo(const Foo& other) noexcept : data_(other.data_)
{
std::cout << " Copy constructing " << std::endl;
}
private:
int data_;
};
int main ( …Run Code Online (Sandbox Code Playgroud) 我目前正在使用printCoefmat打印矩阵,并希望对数字应用一些格式.
当数字的指数大于3时,我想强制科学记数法.我无法弄清楚它是如何scipen工作的,有谁知道我怎么能做到这一点?
我想知道是否有人知道将使用标准visual studio 2010安装项目创建的安装项目转换为WIX项目是多么容易.
此安装项目还具有自定义操作dll.我读到了关于热火但我不确定它的作用.