https://github.com/Kitware/CMake
Raw File
Tip revision: adf5f253ec029aec4ee7aadb95c6f908030fb98b authored by Brad King on 04 November 2016, 12:30:22 UTC
CMake 3.7.0-rc3
Tip revision: adf5f25
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