CFLite: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


==The "Easy" Way==
==The "Easy" Way==
Just go download and install Safari for windows. Guess what?  it comes with CoreFoundation. (Oh, and CFNetwork and CoreGraphics, which kicks an amazing amount of ass by the way). Now just follow [[CFLite|These Directions]] but skip step 1.  Now drag CF and it's constituent .dlls (most of the other dlls in the Safari folder) and drop them into your build folder (where your exe is going to be).  Add CF.dll to your project, add the search paths to the CF folder for the headersYou should be good to go.
# Download my pre-built [http://kjams.com/cflite/downloads/CoreFoundation.zip CoreFoundation]
# Unzip it and drop the folder into your WINDOWS directory (typically on your C:\ drive)
# On your desktop, right click on "My Computer", click "properties", click "Advanced", click "Environment Variables", then under "System Variables", scroll down to "Path" and select it, click "Edit", then add "%SystemRoot%\CoreFoundation;" to the beginning of the line(note that if you produce an application you'll have to have your installer do all this programmatically)
# In your Visual Studio (or whatever IDE):
## In "C++ / General / Additional Include Directories", add these include paths:<br><pre>C:\WINDOWS\CoreFoundation<br>C:\WINDOWS\CoreFoundation\GNUCompatability</pre>
## In "C++ / Preprocessor / Preprocessor Defninitions", add "__WIN32__"
## In "Linker / General / Additional Library Directories", add "C:\WINDOWS\CoreFoundation"
## In "Linker / Input / Additional Dependencies", add "CoreFoundation.dll"
## In Release configuration only: In "Linker / Optimization / References", change it to "Keep Unreferenced Data"
# You're done!  Enjoy the goodness!


==The Hard Way==
==The Hard Way==
Build the thing your self.  Separate page for that, [[CFLite|go here]].
Build the thing your self.  Separate page for that, [[CFLite|go here]].

Revision as of 19:24, 18 November 2008

What is it? CoreFoundation is a cross platform set of classes that handle international text (unicode + any conversions + search & replace), plist & xml parsing & container classes, with i/o (memory, file, network, virtual device), structured data management of said containers (can wrap with STL): dictionaries (maps), arrays (lists of any kind), sets, and all primitive data types plus calendars, dates, locales, etc. This from the CFLite page:

  • CF provides the fundamental C data types (for example, String, Dictionary, Array, Data and Number) as well as the essential services (such as plug-ins, URL handling and networking) ... [it] provides convenient facilities for importing and exporting these types as part of a rich, flexible data structure known as a property list (a kind of XML).

The thing is so blindingly useful for managing preferences, API parameter lists, creating, storing, sending and receiving your in-memory data structures as files or via the web, it makes so many things so easy it's a wonder more people aren't using it. Oh, i know why, nobody's made an easy way to get it going on windows. Sure they *say* "it's open source, just compile it on windows"? Well, it's not quite that easy, actually. So i'm going to make it easy for you to use this on Windows, so now you can really write cross platform code to manage your core data types and the ability to easily serialize huge data structures for streaming to / from a file, within memory, or over the web.

The "Easy" Way

  1. Download my pre-built CoreFoundation
  2. Unzip it and drop the folder into your WINDOWS directory (typically on your C:\ drive)
  3. On your desktop, right click on "My Computer", click "properties", click "Advanced", click "Environment Variables", then under "System Variables", scroll down to "Path" and select it, click "Edit", then add "%SystemRoot%\CoreFoundation;" to the beginning of the line. (note that if you produce an application you'll have to have your installer do all this programmatically)
  4. In your Visual Studio (or whatever IDE):
    1. In "C++ / General / Additional Include Directories", add these include paths:
      C:\WINDOWS\CoreFoundation<br>C:\WINDOWS\CoreFoundation\GNUCompatability
    2. In "C++ / Preprocessor / Preprocessor Defninitions", add "__WIN32__"
    3. In "Linker / General / Additional Library Directories", add "C:\WINDOWS\CoreFoundation"
    4. In "Linker / Input / Additional Dependencies", add "CoreFoundation.dll"
    5. In Release configuration only: In "Linker / Optimization / References", change it to "Keep Unreferenced Data"
  5. You're done! Enjoy the goodness!

The Hard Way

Build the thing your self. Separate page for that, go here.