JMVTI:Could not find agent library

Ed.*_*ard 0 java jvm jvmti

I wrote an agent for Java which does nothing just exports two methods, just to check if it loaded on JVM start or not. Built it with mingw-w64 4.8.4 (using JetBrains CLion). Windows 7 x64.

JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved){
  return JNI_OK;
}

JNIEXPORT void JNICALL
Agent_OnUnload(JavaVM *vm){}
Run Code Online (Sandbox Code Playgroud)

Got an error running

java -agentlib:"C:\JMVAgent\agent.dll"

Error occurred during initialization of VM
Could not find agent library libSampleAgent.dll on the library path, 
with error: Can't find dependent libraries
Run Code Online (Sandbox Code Playgroud)

Also I placed agent.dll into c:\windows\System32 and run java w/o agent full path with the same result.

DependencyWalker shows no dependency error 在此处输入图片说明

Please help to find what I'm doing wrong

apa*_*gin 5

如果要指定代理库的完整路径,请使用-agentpath代替-agentlib

此处解释差异。