I'm still not completely sure about how to write correcly a DLL in Visual Studio.
file .h
#ifndef UPLOAD_H_
# define UPLOAD_H_
# ifdef UPLOAD_EXPORT
# define UPLOAD_API __declspec(dllimport)
# else
# define UPLOAD_API __declspec(dllexport)
# endif // UPLOAD_EXPORT
#include <Windows.h>
#include <WinInet.h>
extern "C" UPLOAD_API int uploadFTP(
const char *...,
const char *...,
const char *...,
const char *...,
const char *...,
const char *...);
#endif // UPLOAD_H_
file .cpp
#include "upload.h"
extern "C" UPLOAD_API int uploadFTP(
const char *...,
const char *...,
const char *...,
const char *...,
const char *...,
const char *...)
{
...
}
This actually works but on MSDN thay write on the .h file:
#ifdef MATHFUNCSDLL_EXPORTS
#define MATHFUNCSDLL_API __declspec(dllexport)
#else
#define MATHFUNCSDLL_API __declspec(dllimport)
#endif
That is actually the opposite of what I'm doing, and they do not specify MATHFUNCSDLL_API on the functions of .cpp file.
EDIT:
Solution -> UPLOAD_EXPORT was not correctly defined under Project Properties/C++/Preprocessor