Re: Wierd Problem-missing .lib files even after successful dll creation
veenuuu@gmail.com wrote:
I have created a simple dll which compiled sucdcesfully.
But when i cheked for the lib files they were missing.
Just a suggestion, create a DLL project with the wizard and modify that,
that way you can immediately see where things went wrong.
#ifndef _OPTEST_H_
#define _OPTEST_H_
Identifiers beginning with an underscore and a capital are reserved, you
shouldn't use them.
#include <iostream.h>
This header is part of the old, pre-standard iostreams, if you have a book
teaching those you need to get a good book on C++ first.
#include <stdio.h>
#include <windows.h>
extern "C" __declspec(dllexport) int add( int x , int y);
extern "C" __declspec(dllexport) int sub( int x , int y );
extern "C" __declspec(dllexport) int mul( int x , int y );
//extern "C" __declspec(dllexport) int div( int x , int y );
extern "C" __declspec(dllexport) void get( int x , int y );
#endif
//optest.cpp -source file for optest.h
#include "optest.h"
extern "C" __declspec(dllexport) int add( int x , int y );
extern "C" __declspec(dllexport) int sub( int x , int y );
extern "C" __declspec(dllexport) int mul( int x , int y );
extern "C" __declspec(dllexport) void get( int x , int y );
Why repeat these declarations here? You have them in the header, which you
already included.
class oper
[...declaration and implementation snipped...]
Nothing in the rest of the code is exported.
Your problem is that you are declaring some functions to be exported but
never implement them. I really suggest you start with a wizard-generated
DLL.
Uli