https://github.com/Kitware/CMake
Raw File
Tip revision: c5dcd31e92c0a09009a340e3fe23ced4f6190b64 authored by Brad King on 07 September 2016, 12:55:56 UTC
CMake 3.6.2
Tip revision: c5dcd31
testbundleutils2.cpp

#include "framework.h"
#include "shared.h"
#include "stdio.h"

#if defined(WIN32)
#include <windows.h>
#else
#include "dlfcn.h"
#endif

int main(int, char**)
{
  framework();
  shared();

#if defined(WIN32)
  HANDLE lib = LoadLibraryA("module2.dll");
  if (!lib) {
    printf("Failed to open module2\n");
  }
#else
  void* lib = dlopen("module2.so", RTLD_LAZY);
  if (!lib) {
    printf("Failed to open module2\n%s\n", dlerror());
  }
#endif

  return lib == 0 ? 1 : 0;
}
back to top