Skip to content

Instantly share code, notes, and snippets.

@norm2782
Created July 15, 2011 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save norm2782/1084715 to your computer and use it in GitHub Desktop.
Save norm2782/1084715 to your computer and use it in GitHub Desktop.
c2hs --cppopts='-I.' --cppopts='-U __BLOCKS__' Git2.chs
ghc --make Main.hs
[1 of 2] Compiling Git2 ( Git2.hs, Git2.o )
Linking Main ...
ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
Undefined symbols for architecture i386:
"_git_repository_database", referenced from:
_s1JB_info in Git2.o
"_git_repository_free", referenced from:
_s1KY_info in Git2.o
"_git_repository_head_detached", referenced from:
_s1Mp_info in Git2.o
"_git_repository_head_orphan", referenced from:
_s1NM_info in Git2.o
"_git_repository_is_bare", referenced from:
_s1Sc_info in Git2.o
"_git_repository_is_empty", referenced from:
_s1P9_info in Git2.o
"_git_repository_path", referenced from:
_s1Qw_info in Git2.o
_s320_info in Git2.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: *** [Main] Error 1
λ include → λ git master* → tree .
.
├── Git2.chs
├── Main.hs
├── Makefile
├── git2
│   ├── blob.h
│   ├── branch.h
│   ├── commit.h
│   ├── common.h
│   ├── config.h
│   ├── errors.h
│   ├── index.h
│   ├── net.h
│   ├── object.h
│   ├── odb.h
│   ├── odb_backend.h
│   ├── oid.h
│   ├── reflog.h
│   ├── refs.h
│   ├── refspec.h
│   ├── remote.h
│   ├── repository.h
│   ├── revwalk.h
│   ├── signature.h
│   ├── status.h
│   ├── tag.h
│   ├── thread-utils.h
│   ├── transport.h
│   ├── tree.h
│   ├── types.h
│   └── zlib.h
└── git2.h -- Includes all other header files
-- Somewhere in the beginning of Git2.chs
#include "git2.h"
module Git2 where
-- Example fun from the errors:
database :: Repository -> IO ObjDB
database (Repository r) = return . ObjDB =<< {#call git_repository_database#} r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment