# Windows build fails with missing symbol \_\_imp\_CommandLineToArgvW

**URL:** <https://discourse.libsdl.org/t/windows-build-fails-with-missing-symbol-imp-commandlinetoargvw/27256>\
**Category:** SDL Development\
**Created:** [February 20, 2020, 4:45pm UTC](https://discourse.libsdl.org/t/windows-build-fails-with-missing-symbol-imp-commandlinetoargvw/27256 "2020-02-20T16:45:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dechjo](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/ba8739/32.png) [@dechjo](https://discourse.libsdl.org/u/dechjo)\
**Post date:** [February 20, 2020, 4:45pm UTC](https://discourse.libsdl.org/t/windows-build-fails-with-missing-symbol-imp-commandlinetoargvw/27256/1 "2020-02-20T16:45:43Z")

</div>

According to [docs](https://wiki.libsdl.org/Installation), “On Windows, SDL does not depend on a C runtime at all, not even for malloc(). This means it’s possible to build SDL with almost any Windows compiler and have it work with a program built with any other”. And according to [this answer](https://stackoverflow.com/a/39872932/1249690), it worked in 2016. But now, with latest buildbot artifacts `sdl-visualstudio-4934.zip` I get:

```auto
src> clang++ -std=c++11 hello.cpp -Isdl2\include -Lsdl2\lib\win64 -lsdl2main -lsdl2 -Xlinker /subsystem:console
sdl2main.lib(SDL_windows_main.obj) : error LNK2019: unresolved external symbol __imp_CommandLineToArgvW referenced in function main_getcmdline                                                                    
a.exe : fatal error LNK1120: 1 unresolved externals                                                                                                                                          
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)

```

Could you suggest a fix please?

---

<div class="post-metadata">

**Author:** ![cgutman](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/c/94ad74/32.png) [@cgutman](https://discourse.libsdl.org/u/cgutman)\
**Post date:** [February 21, 2020, 12:39am UTC](https://discourse.libsdl.org/t/windows-build-fails-with-missing-symbol-imp-commandlinetoargvw/27256/2 "2020-02-21T00:39:20Z")

</div>

sdl2main requires you to link to Shell32 since [https://hg.libsdl.org/SDL/rev/a1917148d38a](https://hg.libsdl.org/SDL/rev/a1917148d38a)

---

<div class="post-metadata">

**Author:** ![Maciek](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/maciek/32/4040_2.png) [@Maciek](https://discourse.libsdl.org/u/Maciek)\
**Post date:** [April 7, 2020, 7:44pm UTC](https://discourse.libsdl.org/t/windows-build-fails-with-missing-symbol-imp-commandlinetoargvw/27256/3 "2020-04-07T19:44:05Z")

</div>

Thank you! In VS2019, simply adding Shell32.lib to Properties\>Linker\>Input\> Additional Dependencies did the trick! 😄
