草庐IT

user-env-compile

全部标签

c++ - MSVC : what compiler switches affect the size of structs?

我有两个单独编译的DLL,一个是从VisualStudio2008编译的,一个是从matlab编译的mex文件。两个DLL都包含一个头文件。当我在一个DLL中采用sizeof()结构时,它返回48,而在另一个DLL中它返回64。我检查了/Zp开关,在两个编译中它都设置为/Zp8。还有哪些其他编译器开关可能会影响结构的大小?该结构是一个简单的POCO,没有继承,也没有虚函数。编辑结构看起来像这样:classLIBSPECSGeometry{public:std::vectorm_i;uintN;uintn_im,n_s;};在调试中,sizeof()在两种情况下都返回56,在发行版中,在

C++ 模板 : How to conditionally compile different code based on data type?

这里有一个小例子来说明我的问题的本质:#includeusingnamespacestd;typedefcharachar_t;templateclassSTRING{public:T*memory;intsize;intcapacity;public:STRING(){size=0;capacity=128;memory=(T*)malloc(capacity*sizeof(T));}constSTRING&operator=(T*buf){if(typeid(T)==typeid(char))strcpy(memory,buf);elsewcscpy(memory,buf);ret

C++ 单例用法 : compiler complains about private constructor

我知道有一百万个关于单例的问题和答案,但我似乎无法找到解决方案。所以冒着反对票的风险,这是我的问题:我想使用AndreiAlexandrescu的现代C++设计中的单例实现:标题:classSingleton{staticSingleton&Instance();private:Singleton(){};Singleton(constSingleton&){};Singleton&operator=(constSingleton&){};~Singleton(){};};实现:#include"s.hh"Singleton&Singleton::Instance(){staticSi

常用浏览器user-agent

一、windows环境1、Chrome:Mozilla/5.0(WindowsNT10.0;Win64;x64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/111.0.0.0Safari/537.362、360极速模式Mozilla/5.0(WindowsNT10.0;WOW64)AppleWebKit/537.36(KHTML,likeGecko)Chrome/108.0.5359.95Safari/537.36QIHU360SE3、360兼容模式Mozilla/5.0(WindowsNT10.0;WOW64;Trident/7.0;rv:11.0)l

c++ - Visual Studio 2017 : _mm_load_ps often compiled to movups

我正在查看为我的代码生成的程序集(使用VisualStudio2017)并注意到_mm_load_ps经常(总是?)编译为movups。我使用_mm_load_ps的数据定义如下:structalignas(16)Vector{floatv[4];}//oftenembeddedinotherstructslikethisstructAABB{Vectormin;Vectormax;boolintersection(/*parameters*/)const;}现在,当我使用这个构造时,会发生以下情况://thiscode__mm128bb_min=_mm_load_ps(min.v);

改变 Windows 用户文件夹默认路径 C:/Users

改变Windows用户文件夹默认路径C:/UsersWindows默认的总用户文件夹总是会在系统盘下,如果你的系统盘为C盘,则为:C:\Users,许多默认文件夹也都会放在这里:文档、桌面、下载、图片、视频等文件夹都默认在这里,这些文件夹倒是可以改变位置AppData文件夹默认在用户根目录下,存储了大部分软件的数据、配置,无法被改变位置.config/.ssh/.config/scoop等配置目录也在用户根目录下,无法改变位置许多软件的默认数据位置系统盘符:\Users\用户名\AppData里面一般有三个文件夹,分别是Local/LocalLow/Roaming,简单地来说,都是用来存放软件

c++ - Gtest : test compiling error

我正在尝试测试我用googletest编写的电机控制库,但我没有编译测试代码。测试位于名为test.cpp的文件中,如下所示:#include#include"../motor.hpp"TEST(constructorTest,contructorDefault){}我将测试主函数放在另一个名为main.cpp的文件中。#include#include"../motor.hpp"intmain(intargc,char*argv[]){::testing::InitGoogleTest(&argc,argv);RUN_ALL_TESTS();}为了编译,我执行了以下行:g++main.

c++ - Boost Gzip 过滤器 : compile failes

我正在尝试从BoostGzip过滤器页面编译示例:#include#include#include#include#includeintmain(){usingnamespacestd;ifstreamfile("hello.gz",ios_base::in|ios_base::binary);filtering_streambufin;in.push(gzip_decompressor());in.push(file);boost::iostreams::copy(in,cout);}遗憾的是我的g++返回错误:gzlib.cpp:Infunction‘intmain()’:gzli

urllib3 v2.0 only supports OpenSSL 1.1.1+,currently the ‘ssl‘ module is compiled with ‘OenSSL 1.1.0‘

urllib3v2.0onlysupportsOpenSSL1.1.1+,currentlythe‘ssl’moduleiscompiledwith‘OenSSL1.1.0’27mar2018环境是windows7,重新安装了OpenSSL1.1.1还是会报错;还是改urllib3的版本,不要2.0了pipinstallurllib3==1.26.15这样问题就解决了;参考原文:https://blog.csdn.net/qq_42873925/article/details/131112721

改变hive的端口8020到9000。(SemanticException Unable to determine if hdfs://node1:8020/user/hive/warehouse)

文章目录问题:SemanticExceptionUnabletodetermineifhdfs://node1:8020/user/hive/warehouse/t_scoreisencrypted:org.apache.hadoop.hive.ql.metadata.HiveException:java.net.ConnectException:CallFromnode1/192.168.88.151tonode1:8020failedonconnectionexception:java.net.ConnectException:拒绝连接;Formoredetailssee:http://w