Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, March 4, 2014

Windows Heap, Stack and Leaks - A story with pictures

Well the title was just to attract your attention, anyways this is just for me to remember certain things related to windows stack and heap corruption issues.

Links:
  1. C++ Resource Leaks
  2. C++ Stack Corruption
  3. C++ Stack Overflow
  4. C++ Heap Corruption
And in case the links are dead, I have converted them into full page images, refer them if and only if the links are dead or changed.

Enjoy !




Friday, September 20, 2013

Generate Lib From DLL

Introduction
To avoid installing and fighting against MSYS and Cygwin, you can just extract exported symbols from libvlc.dll to generate a .lib (libvlc.lib) and link your program against it.

Open Visual Studio Command Prompt
It can be found within the Visual Studio Tools menu entry:
Start / Program Files / Microsoft Visual Studio / Visual Studio Tools / Visual Studio Command Prompt.

Extract Symbols
Within the command prompt type:
dumpbin /exports "C:\Program Files\VideoLAN\VLC\libvlc.dll" > "C:\Program Files\VideoLAN\VLC\libvlc.def"
Edit the libvlc.def file and modify it to get something like this:
EXPORTS
libvlc_add_intf
libvlc_audio_get_channel
libvlc_audio_get_mute
libvlc_audio_get_track
libvlc_audio_get_track_count
libvlc_audio_get_track_description
libvlc_audio_get_volume
...
Generate the .lib
Still within the command prompt type:
lib /def:"C:\Program Files\VideoLAN\VLC\libvlc.def" /out:"C:\Program Files\VideoLAN\VLC\libvlc.lib" /machine:x86
Of course, you'll need to adapt the path according to your configuration.

Source
Generate Lib From DLL