0

I just got familiar with libuv and I tried to create really simple project in visual studio and compile it. I built the libuv project like it was written in the documentation. After the build was complete I added, in the linker the include files from libuv's files. Than I added the compiled lib - libuv.lib.

I wrote really small problem just for the purposes of compilation:

#pragma comment (lib, "ws2_32.lib")
#pragma comment(lib, "psapi.lib")
#pragma comment(lib, "Iphlpapi.lib")

#include "stdafx.h"
#include <uv.h>

uv_loop_t *loop;

int main() {

   loop = uv_default_loop();

   return 0;
}      

The problem is that the following error is always shown up:

LNK2019 unresolved external symbol __imp__GetUserProfileDirectoryW@12 referenced in function _uv__getpwuid_r    LibuvThirdTest  D:\LibuvTest\LibuvTest\libuv.lib(util.obj)

Thanks.

Gabriel kotev
  • 369
  • 3
  • 15

1 Answers1

3

These are all the libraries we link with on Windows, you probably need to add pragmas for all of them: advapi32, iphlpapi, psapi, shell32, user32, userenv, ws2_32.

(The list is taken from uv.gyp)

saghul
  • 1,990
  • 1
  • 13
  • 15