jjzjj

cross-reference

全部标签

c++ - 摩西中对 `gzopen' 的 undefined reference

我目前正在尝试安装moses脚本,它是机器翻译工具moses的一部分,但不断出现错误:/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:349:undefinedreferenceto`gzopen'/home/moses/scripts/training/lexical-reordering/reordering_classes.cpp:353:undefinedreferenceto`gzwrite'/home/moses/scripts/training/lexical-reorderin

c++ - "undefined reference"(适用于 linux,但不适用于 Windows 上的 cygwin)

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:gcclinkererrorsonfedora:undefinedreference由于我在使用VC++时遇到了问题(函数重载不会发生在gcc上,因为我的项目合作伙伴正在Linux上编程),我在cygwin上切换到gcc,但我无法让程序运行这里也是(他能够毫无问题地编译相同的代码)我正在尝试编译$gcc-ID:/Programme/Boost_Library/boost_1_51ABI_new.cpp-oABI然后我得到大量这样的错误:/tmp/ccO4eSA2.o:ABI_new.cpp:(.text+0x

c++ - g++ 链接问题 : In function `_start' : (. text+0x20): undefined reference to `main'

我收到对主要错误的undefinedreference-即使我已经定义了主要,并且(AFAICT),我已经正确链接了它。这是我的代码和我使用的命令://################################################//proj1.h#ifndef__SCRATCH_PROJ1_H#define__SCRATCH_PROJ1_HintaddOne(inti);#endif/*__SCRATCH_PROJ1_H*///################################################//proj1.cpp#include"pr

c++ - 错误 "undefined reference to omp_get_wtime"

我找不到要在Windows下的GCC(4.8)中链接的库(Vista)。我尝试了-fopenmp-llibgomp-lgomp编译器指令,但没有任何效果。我已经有了带POSIX的GCC(所以如果启用C++11,std::thread可以正常工作)。问题似乎是搜索正确的库并没有提供有用的结果(甚至在GCC/MinGW文档中搜索)。所以基本上我无法得到thisanswer工作(答案声称适用于大多数编译器,但它没有提供有关如何使其工作的额外信息,因此我无法验证它是否真的工作)。最好现在提供额外的信息以使其在大多数系统上运行...... 最佳答案

c++ - 从 C++ 调用 Fortran 子例程,链接时 undefined reference

我有一个Fortran子例程,我想从C++程序中调用它。它需要一长串浮点参数并使用iso_c_binding内部模块:subroutineparasolve(......)bind(c,name='c_parasolve')use,intrinsic::iso_c_bindingimplicitnone....根据我所读的内容,我明白我需要使用C++的“extern”命令来定义外部函数,然后再调用它。我尝试了两种方法。第一个:extern"C"voidc_parasolve(....);在编译时返回“expectedunqualified-idbeforestringconstant”

c++ - 对 `boost::iostreams::mapped_file_source::mapped_file_source()' 的 undefined reference

我正在测试boost的内存映射文件,但是一旦我声明了一个boost::iostreams::mapped_file,就像在这个程序中一样:#include//definesff_pipelineandff_Pipe#include#include#include#include#include#include#include#include"MapReduceJob.hpp"usingnamespaceff;intmain(intargc,char*argv[]){boost::iostreams::mapped_filemf;}使用这个makefile:#FastflowandBoo

c++ - 使用自己的库的 cmake undefined reference

我有以下目录结构:-project-helper-build-include-h_a.h-h_b.h-src-h_a-h_a.cpp-CMakeLists.txt-h_b-h_b.cpp-CMakeLists.txt-CMakeLists.txt-proj_c-build-src-main.cpp-CMakeLists.txt在helper项目中生成了两个库:libh_a.a和libh_b.a。libh_a.a用于构建libh_b.a。这些文件如下:helper/src/CMakeLists.txt:cmake_minimum_required(VERSION2.6)project(h

c++ - 目标文件 "Version References"来自哪里?

目前我所在的目录中有一个文件libshared-object.so(为通用起见更改了名称)。当我运行时$objdump-plibshared-object.so我收到以下输出:libshared-object.so:fileformatelf64-x86-64ProgramHeader:LOADoff0x0000000000000000vaddr0x0000000000000000paddr0x0000000000000000align2**21filesz0x00000000000828eememsz0x00000000000828eeflagsr-xLOADoff0x0000000

c++ - 对专用模板成员的 undefined reference

我有一个由带有静态成员函数的模板模板类参数化的类:templateclassF>structA{staticintfoo();};此类没有默认定义foo,并且必须专用于不同的类型。我还有另一个类,由带有嵌套模板类的模板模板类参数化:templateclassF>structB{templatestructC{};};我要C专业A对于任何模板模板类F专门A已经:templateclassF>structA::templateC>{staticintfoo();};templateclassF>intA::templateC>::foo(){returnA::foo()/2;}所以,如果我

c++ - g++ 链接器错误:获取 std::hash 的 undefined reference 错误

我在我的代码中使用了TR1实现的unordered_map,链接器给出了我什至无法破译的奇怪错误:BPCFG.o:Infunction`std::__detail::_Hash_code_base,std::_Select1st>,eqDottedRule,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,false>::_M_hash_code(DottedRuleconst&)const':BPCFG.cpp:(.text._ZNKSt8__detail15_Hash_co