草庐IT

computer-architecture

全部标签

C++:使用 "Undefined symbols for architecture x86_64"时出现 "std"错误

我是一名新的C++程序员,我正在尝试运行一个简单的我已经创建了一个文件“test.cpp”,我正在使用gcc在命令行上对其进行编译。命令是“gcctest.cpp-otest”。然后我运行“./test”。(是的,这个过程听起来很基本。)文件如下:#includeintmain(){printf("HelloWorld!");std::cout当我包含包含std的行时,gcc返回以下长错误:Undefinedsymbolsforarchitecturex86_64:"std::__1::locale::use_facet(std::__1::locale::id&)const",ref

c++ - OpenCL:是否可以使用模板化对象作为 Boost::compute 的内核参数?

我的内核函数签名如下:templatevoidkernel(constType1arg1,constType2arg2,Field*results){//Sisknownatcompiletime//Fieldmightbefloatordouble//Type1isanobjectholdingdataandalsomethods//Type2isanobjectholdingdataandalsomethods//Thecomputationstarthere}我知道可以使用c++特性的一个子集来使用extension编写内核到AMD的OpenCL实现,但生成的代码仅限于在AMD卡

c++ - 为所有 iOS 架构编译 c++ 文件

我有一些cpp文件,我想编译它们以便在模拟器和iPhone上运行。我想做的是:g++-cfile1.cppfile2.cpp-std=c++11arrcslibabc.a*.o这可以很好地编译,但只适用于x86_64架构......显然......有什么简单的方法可以编辑这两行命令,以便为所有架构编译一个库(x86_64i386armv7armv7sarm64)?还是我应该构建一些大型脚本来拥有该库?如果是这样?有现成的脚本吗?我也尝试过使用-arch来运行它:g++-cfile1.cppfile2.cpp-std=c++11-archarmv7-archx86_64但这些是我遇到的一

【macOS-OpenCV报错】ld: warning:ignoring file found architecture ‘x86_64‘, required architecture ‘arm64

如果之前用的mac是英特尔intel芯片的,然后换了macM1或M2芯片的。在使用OpenCV时会报错ld:warning:ignoringfile'/usr/local/Cellar/opencv/4.7.0_7/lib/libopencv_gapi.4.7.0.dylib':foundarchitecture'x86_64',requiredarchitecture'arm64'ld:warning:ignoringfile'/usr/local/Cellar/opencv/4.7.0_7/lib/libopencv_bgsegm.4.7.0.dylib':foundarchitectur

c++ - 模板构建错误 : Undefined symbols for architecture x86_64:

我正在尝试使用一个模板类,当我在LWS中将它编译到一个文件中时,它起作用了:(链接失效)~http://liveworkspace.org/code/a9c412a7e683439dfa35a9363749369d~但是当我尝试编译它由3个文件组成时,stack.h第4到21行stack.cpp第24到48行main.cpp第49行到结束当我尝试编译这3个文件时,我得到了Undefinedsymbolsforarchitecturex86_64:"Stack2,std::allocator>>::push(Node**,std::basic_string,std::allocator>

C++: Cloud computing library: 有这样一个库,我不需要写太多网络的东西吗?

我希望我的服务器应用程序能够发送数据以供各种客户端处理,然后将处理后的数据返回给服务器。理想情况下,我会有一些像some_process=send_to_client_for_calculating(connection,data)这样的调用我只需要能够向客户端发送一堆数据,告诉客户端要做什么(最好在同一条消息中,这可以用数组[command,data]来完成),然后返回数据...我正在分解神经网络的各个部分(非常大),然后再将它们组装起来。如果我需要更清楚一点,请告诉我怎么做。 最佳答案 我很震惊没有人把它扔出去......boo

c++ - Boost.Compute 比普通 CPU 慢?

我刚开始玩Boost.Compute,想看看它能给我们带来多少速度,我写了一个简单的程序:#include#include#include#include#include#include#include#include#include#include#include#includenamespacecompute=boost::compute;intmain(){//generaterandomdataonthehoststd::vectorhost_vector(16000);std::generate(host_vector.begin(),host_vector.end(),ra

【论文笔记】Neural Architecture Search with Reinforcement Learning

NeuralArchitectureSearchwithReinforcementLearningBackgroundarvix原文神经网络在诸多任务中表现较好,但是设计/调参过程复制。本文提出一种使用RNN生成模型架构,并且使用强化学习来训练RNN,使其生成的模型在验证集上的准确率最大论文工作提出了NeuralArchitectureSearch,一种基于梯度的方法神经网络的结构structure和连通性connectivity可以用可变长字符串来表示,因此(1)希望使用循环神经网络RNN(controller)来生成这个网络结构(2)在数据集上训练生成的子网络childnetwork,获得

c++ - 为什么 sizeof(ptrdiff_t) == sizeof(uintptr_t)

我看到几篇关于size_t与uintptr_t/ptrdiff_t的帖子(例如size_tvs.uintptr_t),但没有关于这些新的c99ptr大小类型的相对大小的帖子。示例机器:vanillaubuntu14ltsx64,gcc4.8:printf("%zu,%zu,%zu\n",sizeof(uintptr_t),sizeof(intptr_t),sizeof(ptrdiff_t));打印:“8,8,8”这对我来说没有意义,因为我希望必须签名的diff类型需要比unsignedptr本身更多的位。考虑:NULL-(2^64-1)/*largestptr,64bitsof1's.

c++ - .mm 转换导致 Undefined symbols for architecture i386 错误

我最近将一个c++文件导入到我想使用的obj项目中。在我想使用它的类中,我将文件名从MyClass.m更改为MyClass.mm。这样做会给我20个左右的错误。这些错误到底是什么意思,我如何将MyClass更改为objective-c++类以促进我想使用的新c++类,而不会出现这些错误?Undefinedsymbolsforarchitecturei386:"setAudioInputIsStereo(audiosourceobj*,bool)",referencedfrom:-[EngineextractMp3Audio:withChannelId:withPadId:]inEngi