草庐IT

FUNCTION_NAME

全部标签

Name for argument of type [java.lang.String] not ... Ensure that the compiler uses the ‘-parameters’

更多信息:https://oldmoon.top/post/191简介使用最新版的Springboot3.2.1搭建开发环境进行开发,调用接口时出现奇怪的错。报错主要信息如下:Nameforargumentoftype[java.lang.String]notspecified,andparameternameinformationnotavailableviareflection.Ensurethatthecompilerusesthe‘-parameters’flag.官方说明中一直强调@PathVariable的使用,并没有提及@RequestParam,阅读官方文档@RequestPa

c++ - 使用 GetProcAddress : callback function fails with invalid parameter 从 C++ 调用 Delphi DLL

我有一个从C++调用的第3方DelphiDLL。不幸的是,我无法访问PascalDLL代码,也不是Pascal程序员。没有lib文件,所以我使用GetProcAddress调用许多DLL函数,成功地通过值、地址和引用传递参数。我还注册了一个回调函数,它会在预期时被调用。我的问题是在回调函数中,无法评估两个参数之一(地址0x000001)。这是PascalDLL函数声明typeHANDLE=Pointer;///handle(**ThisfunctionRegistersthecallbackfunctionOnACLNeeded*)functionRegisterCallback(h:

c++ - Visual Studio Name Mangling "YAPEAV"和 Mysql 连接器

将我的代码与MySQLConnectorC++1.1.0链接时出现Unresolvedexternalsymbol错误。这是错误消息:6>database.lib(db_manager.obj):errorLNK2019:unresolvedexternalsymbol"classsql::mysql::MySQL_Driver*__cdeclsql::mysql::get_driver_instance(void)"(?get_driver_instance@mysql@sql@@YAPAVMySQL_Driver@12@XZ)referencedinfunction"classsq

c++ - 窗体头文件中的 "error C2653: System is not a class or a namespace name",Visual C++

我之前关于同一项目的问题:one和two.没有必要阅读它们;只知道我正在尝试在VisualC++项目中使用nativeC++SDK。这比我最初想象的要棘手得多,但是这个网站关于ExtendinganativeC++projectwithmanagedcode已经帮助了我很多。按照最后一个链接的说明,我已将一个表单添加到我的nativeC++项目中,该项目已自动将项目转换为CLR项目。只有MainForm.cpp和Interface.cpp(允许nativeC++代码创建和显示MainForm的文件)使用/clr编译旗虽然;其他文件保持原样。我现在遇到的问题是,VisualStudio似

c++ - boost::function 与函数指针

我正在实现一个通用设置读取器。我的想法是我有一个应用程序,它的设置可以是bool值、整数和字符串。然后我有一个Config类,其中实现了此类设置的getter,配置类在构造函数中接受了一个客户,因此它知道它将读取该客户的设置。我在让它工作时遇到了麻烦,我想我误用了boost::function,将它与普通函数指针混淆了。在映射中,我希望有引用,而boost::function应该只在配置读取时绑定(bind),因为我已经为那里分配了一个Config实例给定的客户。问题是我不能在没有typedef的情况下使用函数指针,这会使模板工作复杂化,有什么更明智的解决方案吗?#include"Co

c++ - 米斯拉-C++ :2008[8-4-3] : return in all exit path in function

在测试我的代码(静态分析)以查看我是否尊重misrac++2008时,我收到以下错误Functiondoesnotreturnavalueonallpaths.函数看起来像int*Dosomething(stringv){int*retvalue=NULL;if(0==exists(v)){throw("error:valuedoesn'texist");}else{retvalue=dosomecomputations(v);}returnretvalue;}我真的需要抛出一个异常,因为调用者应该根据错误做一些事情。可能的错误列表可能很大,而且不仅仅是该代码示例中的值不存在。我该如何

c++ - 将 std::function 绑定(bind)到不同对象实例的相同函数

是否可以重新绑定(bind)std::function以指向相同的函数但具有不同的对象实例?如果我有一个对象,它有一个绑定(bind)到另一个函数的std::function,但是如果那个对象被复制到另一个实例,我想将std::function重新绑定(bind)到那个新实例而不是旧实例。#include"stdafx.h"#include#includeclassEventHandler{public:intNum;std::functionOnEvent;EventHandler(intinNum){Num=inNum;}EventHandler(constEventHandler

C++ 原子 : would function call act as memory barrier?

我正在阅读这篇文章MemoryOrderingatCompileTime从中说:Infact,themajorityoffunctioncallsactascompilerbarriers,whethertheycontaintheirowncompilerbarrierornot.Thisexcludesinlinefunctions,functionsdeclaredwiththepureattribute,andcaseswherelink-timecodegenerationisused.Otherthanthosecases,acalltoanexternalfunction

c++ - 出于对象替换的目的,对象的 "name"究竟是由什么构成的?

根据[basic.life]/8,If,afterthelifetimeofanobjecthasendedandbeforethestoragewhichtheobjectoccupiedisreusedorreleased,anewobjectiscreatedatthestoragelocationwhichtheoriginalobjectoccupied,apointerthatpointedtotheoriginalobject,areferencethatreferredtotheoriginalobject,orthenameoftheoriginalobjectwil

c++ - 错误 "lambda is not derived from ' std::function'

我正在尝试将lambda传递给通过可变参数模板定义的std::function,但似乎这在gcc上不起作用。有什么原因,为什么这段代码在gcc7.4.0上不起作用,但在VisualStudio2017上却能正常工作?有没有办法让它在gcc上也能工作,而无需先手动将其转换为std::function?#includetemplateintTestFunction(std::function){return0;}voidTest(){autofce=[](int/*n*/,double/*d*/){};//Thisdoesn'tworkwitherrornomatchingfunction