tmighty
tmighty

Reputation: 11389

Invalid link specification

The compiler tells me that there are 3 errors in my code:

Linking specification incompatible with "SpeakInternal" (declare in line 13 of voice.cpp) (previously)

wstring: not declared identifier

Syntax error: Missing ")" before identifier "uText"

The code is:

__declspec(dllexport) void __cdecl SpeakInternal(wstring uText, wstring uPath);

I don't see what it wants from me.

Can somebody tell me what I'm doing wrong?

Thank you very much!

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

Upvotes: 0

Views: 63

Answers (1)

Eugene
Eugene

Reputation: 7178

You must #include <string> in voice.h, and also ether add using namespace std; there (which is considered bad style), or prepend all your wstring with std::.

Upvotes: 1

Related Questions