--- a/src/dftbp/common/envcheck.c
+++ b/src/dftbp/common/envcheck.c
@@ -4,9 +4,9 @@
 /*                                                                                                */
 /*  See the LICENSE file for terms of usage and distribution.                                     */
 /*------------------------------------------------------------------------------------------------*/
-
+#ifndef _WIN32
 #include <sys/resource.h>
-
+#endif
 /**
  * Queries current stacksize.
  *
@@ -15,10 +15,13 @@
  * \param[out] ierr Error status.
  */
 void get_stacksize_c(int *cstack, int *ierr) {
-
+#ifdef _WIN32
+  *ierr = 0;
+  *cstack = 0;
+#else
   struct rlimit rlim;
   *ierr = getrlimit(RLIMIT_STACK, &rlim);
 
   *cstack = rlim.rlim_cur;
-
+#endif
 }
--- a/src/dftbp/common/memman.F90
+++ b/src/dftbp/common/memman.F90
@@ -44,12 +44,20 @@
 
   !> Bound to 'posix_memalign' to allocate aligned memory
   interface
+  #:if _SYSTEM_ == 'Windows'
+    function AlignedMalloc(size, alignment) result(ptr) bind(C, name="_aligned_malloc")
+      import c_ptr, c_size_t
+      type(c_ptr) :: ptr
+      integer(c_size_t), intent(in), value :: alignment, size
+    end function
+  #:else
     function posixMemalign(ptr, alignment, size) result(error) bind(C, name="posix_memalign")
       import c_ptr, c_size_t, c_int
       type(c_ptr), intent(inout) :: ptr
       integer(c_size_t), intent(in), value :: alignment, size
       integer(c_int) :: error
     end function
+  #:endif
   end interface
 
 
@@ -105,9 +113,14 @@
 
       this%alignment = alignment
     end if
-
+    #:if _SYSTEM_ == 'Windows'
+    this%memoryPointer_ = AlignedMalloc(int(size * dp_size, kind=c_size_t),&
+          & int(this%alignment, kind=c_size_t))
+    if ( .NOT. C_ASSOCIATED(this%memoryPointer_) ) then
+    #:else
     if (posixMemalign(this%memoryPointer_, int(this%alignment, kind=c_size_t),&
           & int(size * dp_size, kind=c_size_t)) /= 0) then
+    #:endif
       call error("Error during allocation of aligned array")
     end if
 
--- a/utils/export/dftbplus.pc.in
+++ b/utils/export/dftbplus.pc.in
@@ -1,3 +1,5 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+
 Name: DFTB+
 Description: Library interface to DFTB+, a fast and efficient atomistic quantum mechanical simulation tool
 Version: @PROJECT_VERSION@
