Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Friday, July 30, 2010

mingw linking

Suppose mygdiprog.cpp includes wingdi.h and uses various API calls implemented via gdi32.dll

g++ -lgdi32 mygdiprog.cpp

will throw up errors for the API calls along the lines of 'undefined reference to GetDeviceCaps@8''.

You must place -lgdi32 (which means 'link in stuff from lib\libgdi32.a') after the source file name

g++ mygdiprog.cpp -lgdi32

(This is why -mwindows makes it work, because -mwindows adds a load of -l options, and it puts them in the right place on the command line.)

Followers

Blog Archive