Hi,
I am using dev c++ 4.9.9.2 and I am new to DLLs. I am tryig to create a DLL which I am not creating thru the "DLL project" in dev cpp.
Here are my three files:
//dlltest.h
#ifndef _DLLTEST_H
#define _DLLTEST_H
#ifdef BUILD_DLL
#define EXPORT _declspec(dllexport)
#else
#define EXPORT _declspec(dllimport)
#endif
EXPORT void Hello();
#endif //end of _DLLTEST_H
//dlltest.cpp
#include "dlltest.h"
#include<iostream>
using namespace std;
EXPORT void Hello(){
cout<<"This is DLL test";
}
//hello.cpp
#include "dlltest.h"
int main(){
Hello();
}
I now compile dlltest.cpp by:
g++ -c dlltest.cpp -DBUILD_DLL
I get errors related to the EXPORT keyword in "dlltest.h"
What corrections are required in the 3 files (if any)
And how do I create DLLs ? (are there any compiler options/switches I need to modify/correct?)