链接规范无效
Invalid link specification
编译器告诉我我的代码中有 3 个错误:
Linking specification incompatible with "SpeakInternal" (declare in line 13 of voice.cpp) (previously)
wstring: not declared identifier
Syntax error: Missing ")" before identifier "uText"
代码为:
__declspec(dllexport) void __cdecl SpeakInternal(wstring uText, wstring uPath);
我看不出它想从我这里得到什么。
有人可以告诉我我做错了什么吗?
谢谢!
语音:
extern "C"
{
__declspec(dllexport) void __cdecl DoCompile();
__declspec(dllexport) void __cdecl SpeakInternal(wstring uText, wstring uPath);
};
语音.cpp:
// voice.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "voice.h"
#include "app.h"
void DoCompile()
{
CApp nApp;
nApp.DoCompile();
}
void SpeakInternal(wstring uText, wstring uPath)
{
CApp nApp;
//nApp.SpeakThis()
}
你必须在voice.h
中#include <string>
,并且在那里添加using namespace std;
(这被认为是不好的风格(,或者在你所有的wstring
前面加上std::
。
相关文章:
- Openssl 1.1.1d无效使用不完整的类型"struct dsa_st"
- 无法访问嵌套类.类的使用无效
- 如果用户输入无效,如何使用字符串变量-C++重复输入命令
- 如何解决错误:SCIP C++中的 SCIP 阶段无效 <10>
- 在没有参数列表的情况下使用模板名称"Event"无效,模板问题
- FFMPEG配置文件级别id大小无效
- 错误:从"int"到枚举c++的转换无效
- 如何修复此错误:className::className的无效使用
- 为什么将值返回函数传递给重载=运算符对运算符函数有效,而对其他运算符无效
- C++-模板嵌套类的引用初始化无效
- 错误:无效的预处理指令 #i 的意思是 #if?
- 多维数组 C++ 中数组下标的类型"int[int]"无效
- 在 C++ 中使用正则表达式错误时出现问题 括号表达式中的范围无效
- C++ PTHREADS - 无效转换无效*(*)()到无效*(*)(无效*)
- 错误:无效使用无效
- 具有无效*和无效**的灵活功能调用
- 无效 ** 等同于无效 * 返回
- 传递无效以无效与 PInvoke 一起无效
- 无效和无效与内部
- 在向量中无效使用无效表达错误