I have a problem when i try to use function from my dll
I did everything as it says here: https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=vs-2019
But when i'm trying to run the test app, i get the following error messages:
Here is my whole code:
test.cpp:
#include "pch.h"
#include <iostream>
#include "SP_DLL.h"
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
int main()
{
symbol_count();
}
dlltest.h:
#pragma once
#include <iostream>
using namespace std;
extern "C" _declspec(dllexport) bool symbol_count();
dlltest.cpp:
#include "pch.h"
#include "SP_DLL.h"
bool symbol_count()
{
char str[100];
char symbol;
size_t count = 0;
cout << "Enter string: ";
cin >> str;
cout << endl << "Enter symbol to count: ";
cin >> symbol;
for each (auto el in str)
if (el = symbol) count++;
return true;
}
If it helps: when i'm trying to run empty symbol_count() (func have only code {return true;} and dll have no includes) there is the only one .dll not found.