Re: Wierd Problem-missing .lib files even after successful dll creation
veenuuu@gmail.com wrote:
i am very new to this App Wizard concept.
What is your problem with it? Point is, you make a mistake the wizard
wouldn't have made for you...
//opetest.h
#include<iostream.h>
#include<windows.h>
class __declspec(dllexport) oper
{
public:
oper(){ }
~oper(){ }
public:
int add(int x,int y);
int sub(int x,int y);
int mul(int x,int y);
};
Okay. This declares a class that will be exported from the _current_(!)
module. When you compile this as part of the DLL, this is correct, but when
using the DLL, i.e. when compiling this header as part of the main program,
you must declare this class as being imported(!), not exported.
Look at the generated projects of the wizard, it switches between import and
export via a macro.
//Cource file for .h file
[this one is okay]
// My main prg
#include "optest.h"
int main( )
{
cout<<"one"<<endl;
int m,n,c;
oper p;
[...]
One thing: does is suffice to just create a single oper object to show the
error? The point is that it is common courtesy to reduce examples to the
smallest possible amount of code. This also helps to isolate the error.
Application failed to initialise properly (0x0000007b)
Interesting, do you get that when you try to run the executable? I would
have expected the project to already fail to build. I have no idea how it
came to that error.
Uli