Skip to content

GHCi invoked to compile Template Haskell files can't find symbols defined in C code #1738

Open
@IreneKnapp

Description

@IreneKnapp

I have a single symbol defined in a .c file, which I have listed in c-sources. I additionally have some Template Haskell code which expands to a call that ultimately uses that symbol (though it's not used at splice-expansion time). When I attempt to compile a file calling my TH (using Cabal, of course), I get:

Building direct-opengl-raw-1.5.0.0...
Preprocessing library direct-opengl-raw-1.5.0.0...
[  6 of 226] Compiling Graphics.Rendering.OpenGL.Raw.EXT.SceneMarker ( src/Graphics/Rendering/OpenGL/Raw/EXT/SceneMarker.hs, dist/build/Graphics/Rendering/OpenGL/Raw/EXT/SceneMarker.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
ghc: 
lookupSymbol failed in relocateSection (relocate external)
dist/build/Graphics/Rendering/OpenGL/Raw/GetProcAddress.o: unknown symbol `_hs_OpenGLRaw_getProcAddress'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions