草庐IT

reference_counted

全部标签

java - Kotlin Unresolved reference : println from gradle on the CLI

在kotlin函数返回崩溃之前放置println语句。堆栈跟踪:thufir@dur:~/NetBeansProjects/kotlin$thufir@dur:~/NetBeansProjects/kotlin$gradlecleanbuild--stacktracew:Classpathentrypointstoanon-existentlocation:e:/home/thufir/NetBeansProjects/kotlin/src/main/kotlin/example.kt:(14,5):Unresolvedreference:println>Task:compileKot

java - Kotlin Unresolved reference : println from gradle on the CLI

在kotlin函数返回崩溃之前放置println语句。堆栈跟踪:thufir@dur:~/NetBeansProjects/kotlin$thufir@dur:~/NetBeansProjects/kotlin$gradlecleanbuild--stacktracew:Classpathentrypointstoanon-existentlocation:e:/home/thufir/NetBeansProjects/kotlin/src/main/kotlin/example.kt:(14,5):Unresolvedreference:println>Task:compileKot

android - 由 java.lang.NullPointerException : Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference 引起

我有BitmapScalingHelper.java:publicclassBitmapScalingHelper{publicstaticBitmapdecodeResource(Resourcesres,intresId,intdstWidth,intdstHeight){Optionsoptions=newOptions();options.inJustDecodeBounds=true;BitmapFactory.decodeResource(res,resId,options);options.inJustDecodeBounds=false;options.inSample

C++ lambda : how to avoid slicing a reference if captured by value

我有一个方法,它采用一个参数,该参数是对基类的引用,我通过将方法实现包装在queue>中来排队调用方法体。问题是我希望按值捕获方法的参数,以便队列中的每个lambda都可以使用自己的拷贝执行。但如果我按值捕获,引用参数的lambda拷贝似乎将其切片,留下基类拷贝而不是引用中的实际派生类。如果我改为通过引用捕获参数,我确实会在lambda中获得实际的派生类,但obj可能会在方法调用之间超出范围,或者它的状态可能会发生变化。请注意,该方法应该是可重入的,但不是异步的,也不是并发的。这是我的意思的一个例子(省略队列):structBaseObj{virtual~BaseObj()=defau

c++ - 错误 X8000 : D3D11 Internal Compiler error : Invalid Bytecode: Invalid operand type for operand #1 of opcode #86 (counts are 1-based)

我和我的讲师/实验室助理都被难住了。出于某种原因,以下HLSL代码在输出窗口中返回:errorX8000:D3D11InternalCompilererror:InvalidBytecode:Invalidoperandtypeforoperand#1ofopcode#86(countsare1-based).这是HLSL中导致问题的函数://ProjectsaspherediameterlargeinscreenspacetocalculatedesiredtesselationfactorfloatSphereToScreenSpaceTessellation(float3p0,f

c++ - 对 `boost::log_mt_posix::basic_attribute_set<char>::~basic_attribute_set()' 的 undefined reference

新手问题...我是第一次试用Boost,因为我想试驾BoostLog图书馆。我构建了这个测试程序...#include#includeintfibonacci(intnum){inti;inta=1;intb=1;for(i=2;i编译数据:****BuildofconfigurationDebugforprojectLoggingCpp****makeallBuildingfile:../main.cppInvoking:GCCC++Compilerg++-O0-g3-Wall-c-fmessage-length=0-lpthread-MMD-MP-MF"main.d"-MT"mai

c++ - undefined reference 在 GCC 下使用 LTO 交叉编译静态库

我正在尝试使用GCC4.9.2为Windows(x86_64-w64-mingw32)交叉编译来自Linux(x86_64-pc-linux-gnu)的应用程序。当构建链接到静态库的目标并使用链接时优化时,对于目标使用的库中的所有符号,我从链接器收到undefinedreference错误。例如,从bar.cpp构建bar.aintbar(void){return42;}并与foo.cpp链接externintbar(void);intmain(int,char**){bar();}使用命令行x86_64-w64-mingw32-g++-flto-ofoo.o-cfoo.cppx86_

c++ - 为什么 std::count 和 std::find 没有优化为使用 memchr?

我正在阅读sehe'sanswer至thisquestion并且惊讶地看到sehe发现使用std::memchr的手写循环比使用std::count快3倍以上(看评论)。使用std::count的代码可以在编辑2中看到,但它基本上可以归结为:constautonum_lines=std::count(f,l,'\n');对比uintmax_tnum_lines=0;while(f&&f!=l)if((f=static_cast(memchr(f,'\n',l-f))))num_lines++,f++;我本来希望std::count版本至少和std::memchr版本一样快——原因与us

c++ - C++0x 中的完美转发是否会使 reference_wrapper 被弃用?

像往常一样,先写代码:#includeusingnamespacestd;usingnamespacestd::tr1;voidf(int&r){r++;}templatevoidg1(Ff,Pt){f(t);}templatevoidg2(Ff,P&&t){f(forward(t));}intmain(){inti=0;g1(f,ref(i));//oldway,uglywayg2(f,i);//newway,elegantway}在C++98中,我们没有一个很好的方法来通过模板函数来完善前向参数。因此,C++专家发明了ref和cref来实现这一目标。既然我们有了r值引用和完美转发,

c++ - 为什么我得到这个 "error: undefined reference to ` qt_version_tag'”?

我在Ubuntu16LTS机器上使用Qt5.7。我收到这个错误:(.qtversion[qt_version_tag]+0x0):-1:error:undefinedreferenceto`qt_version_tag'此错误仅在我使用SDL库时出现。 最佳答案 我知道这是一个旧线程,但您可以通过定义QT_NO_VERSION_TAGGING来避免它;也就是说,通过传递选项:-DQT_NO_VERSION_TAGGING到gcc。 关于c++-为什么我得到这个"error:undefin