C
cybose
Can someone help me write a HelloWorld dll using Microsoft's C++
compiler. It was straightforward doing it on Cygwin/g++, but it seems
to be an entirely different story on the MS C++ ?
In the case of using g++ ...
1.HelloWorld.h
~~~~~~~~~~~~
extern "C"
void printHelloWorld();
2.HelloWorld.cpp
~~~~~~~~~~~~~
#include <iostream>
extern "C"
void printHelloWorld() {
std::cout << "Hello World" << std::endl;
}
3.TestHW.cpp
~~~~~~~~~~~
#include "HelloWorld.h"
int main() {
printHelloWorld();
}
Once I compile and link 2. into a dll, and link that alongwith 3,
everything works as expected.
How do I mimic this using Microsoft C++ ?
Thanks
compiler. It was straightforward doing it on Cygwin/g++, but it seems
to be an entirely different story on the MS C++ ?
In the case of using g++ ...
1.HelloWorld.h
~~~~~~~~~~~~
extern "C"
void printHelloWorld();
2.HelloWorld.cpp
~~~~~~~~~~~~~
#include <iostream>
extern "C"
void printHelloWorld() {
std::cout << "Hello World" << std::endl;
}
3.TestHW.cpp
~~~~~~~~~~~
#include "HelloWorld.h"
int main() {
printHelloWorld();
}
Once I compile and link 2. into a dll, and link that alongwith 3,
everything works as expected.
How do I mimic this using Microsoft C++ ?
Thanks