c++ - Visual Studio 2015 中的外部“C”显式类型错误,DLL 测试代码
问题描述
我正在尝试编译一组非常基本的代码来测试在 R 中使用 VS15 C++ 制作的 DLL 的功能。我遵循了本教程:https ://erpcoder.blog/2016/06/15/how-to-develop- ac-dll-for-r-in-visual-studio-2015/
stdafx.h:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern “C” __declspec(dllexport) void __cdecl foo(double *in, double *out);
DLL_Test.cpp:
#include "stdafx.h"
void foo(double *in, double *out)
{
double value = in[0] * 2;
out[0] = value;
}
VS15 给了我与 stdafx.h 相对应的以下错误:
explicit type is missing ('int' assumed)
expected a ';'
非常感谢任何见解。
干杯!
解决方案
推荐阅读
- python - 创建一个没有开发依赖的 requirements.txt
- ios - didBegin 未检测到两个 SKSpriteNode 之间的接触
- bazel - 如何在客户端检索 bazel 远程缓存指标
- css - 仅当标题到达特定列时,如何修复列(使用 CSS 网格)?
- f# - 使用自定义类型从当前正在构建的程序集中检索委托类型
- c# - C# SQL 记录从表到列表
- vagrant - 当我尝试在 WSL2 上使用警告时,Vagrant 给了我一些问题:连接被拒绝。重试
- rxjs - Rxjs 订阅在带有 Angular 10.1.1 和 rxjs 6.6.3 的 IE 11 中不起作用
- android - Android:E/InputDispatcher:窗口句柄拖动没有注册的输入通道
- reactjs - 为什么在这种情况下不调用此函数