Tuesday, April 27, 2010

[CMake] Cannot determine link language for target?

For whatever reason add
SET_TARGET_PROPERTIES(XYZ PROPERTIES LINKER_LANGUAGE C)

const-overloading in C++

See more at http://www.parashift.com/c++-faq-lite/const-correctness.html

Do you want to debug a program with command line parameters in Visual C++ 2008?

Set them in project->configuration properties->Debugging. But there is one more thing to do: Set your project as the Startup Project in the Solution Explorer! If you don't do that, the command line parameters won't be passed in whatever you try!

Shrink the file size of a pdf?

Shrink the file size of a pdf? Use the following command. ebook has a good balance between the file size and the image quality. screen compresses the images too much.


gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook[screen, ] -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

-dPDFSETTINGS=configuration
Presets the "distiller parameters" to one of four predefined settings:
  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
  • /default selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.