Неверная спецификация ссылки - PullRequest
0 голосов
/ 19 октября 2019

Компилятор сообщает мне, что в моем коде есть 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);

Я не понимаю, чего он хочет от меня.

Может кто-нибудь сказать мне, что я делаю не так?

Большое спасибо!

voice.h:

extern "C"
{
    __declspec(dllexport) void __cdecl DoCompile();
    __declspec(dllexport) void __cdecl SpeakInternal(wstring uText, wstring uPath);
};

voice.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()
}

1 Ответ

1 голос
/ 19 октября 2019

Вы должны #include <string> в voice.h, а также эфир добавить туда using namespace std; (что считается плохим стилем) или добавить все ваши wstring с std::.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...