i have create a win32 console project, then dll project and empty project.
Can anyone give me an explanation how to create a dll from native C++(class/Member function)?
Code:
#ifndef STOPWATCH
#define STOPWATCH
#include <string>
#include <ctime>
class stopwatch
{
private:
std::clock_t elapsed;
public:
stopwatch();
~stopwatch();
};
/*
Do not put definition in header file to avoid
multiple definition through include directive
in object files
*/
void myInitialize();
#endif
Well, finally you have to decide, LIB or DLL is your target.
Then you create a project of corresponding type, include your class there and build.
What step causes a confusion to you?
Sorry to you, i have included the #include "StopWatch.h" header file but now the problem is
Error 1 fatal error C1083: Cannot open include file: 'StopWatch.h': No such file or directory
I didn't not include the StopWatch header file to that project.
Any hints ?
A hint: learn C/C++ compiler basics, #include directive in particular.
From MSDN:
Quoted form
This form instructs the preprocessor to look for include files in the same directory of the file that contains the #include statement, and then in the directories of any files that include (#include) that file. The preprocessor then searches along the path specified by the /I compiler option, then along paths specified by the INCLUDE environment variable.
I try this #include <StopWatch.h> too but still compiler cannot find the file.
Yeah, shooting into the dark is a funny game.
From MSDN:
Angle-bracket form
This form instructs the preprocessor to search for include files first along the path specified by the /I compiler option, then, when compiling from the command line, along the path specified by the INCLUDE environment variable.
Please help me.
I wonder, did you really give a try to read the link I provided? I mean, read and think over?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.