Bill Hoffman 8f86407cfd Windows: Optionally generate DLL module definition files automatically
Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically
generate a module definition file from MS-compatible .obj files and give
it to the linker in order to export all symbols from the .dll part of a
SHARED library.
2015-07-06 11:11:02 -04:00

38 lines
500 B
C++

#include <stdio.h>
#include "hello.h"
#ifdef _MSC_VER
#include "windows.h"
#else
#define WINAPI
#endif
extern "C"
{
// test __cdecl stuff
int WINAPI foo();
// test regular C
int bar();
}
// test c++ functions
// forward declare hello and world
void hello();
void world();
int main()
{
// test static data (needs declspec to work)
Hello::Data = 120;
Hello h;
h.real();
hello();
printf(" ");
world();
printf("\n");
foo();
printf("\n");
bar();
printf("\n");
return 0;
}