# 我使用了Drawings和Kernel静态库（静态配置mddbg）。虽然构建成功，但运行main.exe时出现以下输出：ERROR: Null Ptr

 1. [FAQ](/cn/faq)
2. »
3.

### 请注意示例每个main.cpp文件中TOOLKIT\_IN\_DLL宏定义的内容。静态配置下需要模块初始化：

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">#ifndef TOOLKIT_IN_DLL</span>
```

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">INIT_IFC_STATIC_MODULES_NO_GEOM;</span>
```

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">#endif</span>
```

以及

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">#ifndef TOOLKIT_IN_DLL</span>
```

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">ODRX_INIT_STATIC_MODULE_MAP();</span>
```

```
<span lang="EN-US" style="background-color:white;box-sizing:border-box;color:rgb(33, 37, 41);font-family:Consolas;font-size:10pt;">#endif</span>
```

因此在md配置中，每个模块都应预先初始化，这样我们的运行时链接器才能正常工作。您的问题似乎与此初始化有关。
