Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GHC undefined reference to Paths in dependency

I recently made a cabal package which can be seen here It consists of a library and a few small example programs using it. Everything builds and works as expected.

I wanted to build an executable in a new package which uses this library, however I continue to run into a linking error I can't decipher:

/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 things simpler to diagnose I moved one of the examples programs into my new package and discovered even it won't build properly. You can find that version of the executable here.

From this I've concluded that the problem is likely in something I'm doing in my .cabal files, but I can't see what's wrong. The error also seems to refer to the Paths_rlglue module which cabal automatically generates for the first package.

Can anyone help me understand why I'm getting this error?

like image 297
rofer Avatar asked Oct 15 '25 17:10

rofer


1 Answers

You need to include the Paths_rlglue module in exposed-modules or other-modules like any other module in your project so that Cabal will link it.

Cabal should be better about telling you what is going on, see https://github.com/haskell/cabal/issues/1746.

like image 173
Reid Barton Avatar answered Oct 18 '25 06:10

Reid Barton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!