GHC undefined reference to paths depending

I recently made a package for the camera, which you can see here It consists of a library and a few small sample programs that use it. Everything builds and works as expected.

I wanted to create an executable in a new package that uses this library, however I keep running into a linking error that I cannot decode:

/my/path/RandomAgent/.cabal-sandbox/lib/x86_64-linux-ghc-7.8.4/rlglue-0.2.1.1/libHSrlglue-0.2.1.1.a(Agent.o):(.text+0x34f1): undefined reference to `rlgluezm0zi2zi1zi1_Pathszurlglue_version1_closure'

      

collect2: error: ld returned 1 exit status To make it easier to diagnose, I moved one of the sample programs to my new package and found it would not build correctly. You can find this version of the executable here .

From this I concluded that the problem is probably what I am doing in my .cabal files, but I cannot see what happened. The error also seems to be related to the Paths_rlglue module, which automatically generates cabal for the first package.

Can someone help me understand why I am getting this error?

+3


source to share


2 answers


You need to include the Paths_rlglue module in open modules or other modules like any other module in your project for Cabal to link it.



Cabal should better tell you what's going on, see https://github.com/haskell/cabal/issues/1746 .

+5


source


Looks like I missed something in the documentation for Paths_pkgname

If you choose to import the Paths_pkgname module, then it should be listed in the Other Modules box, just like any other module in your package.



Adding Paths_rlglue to my library of other modules fixed the issue. Hope this saves someone all the time I wasted on this.

+2


source







All Articles