7068

GHC linking problem

Question:

I'm trying to compile the following code.

import Data.List import Data.Ord import qualified Data.MemoCombinators as Memo collatzLength :: Int -> Int collatzLength = Memo.arrayRange (1, 1000000) collatzLength' where collatzLength' 1 = 1 collatzLength' n | odd n = 1 + collatzLength (3 * n + 1) | even n = 1 + collatzLength (n `quot` 2) main = print $ maximumBy (comparing fst) $ [(collatzLength n, n) | n <- [1..1000000]]

The Haskell compiler spits out:

euler14.o: In function `s1pw_info': (.text+0x8dd): undefined reference to `__stginit_datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_' euler14.o: In function `rfX_info': (.text+0x35d): undefined reference to `datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_arrayRange_info' euler14.o: In function `rfX_srt': (.data+0x4c): undefined reference to `datazmmemocombinatorszm0zi4zi1_DataziMemoCombinators_arrayRange_closure' collect2: ld returned 1 exit status

I tried googling, but to no avail. Is there anywhere these errors can be looked up? What do they mean?

Answer1:

You gotta compile with the <a href="http://haskell.org/ghc/docs/5.00/set/make-mode.html" rel="nofollow">--make</a> flag.

Recommend

  • MySQL multiple Id lookups
  • How to programmatically add/remove exsting projects to a solution?
  • zend framework 2 Dynamic Breadcrumbs - Passing Parameters
  • Python deque: difference from list?
  • Floating point number format
  • Continuous colorbar with contour levels
  • Netlify fails to deploy site after public is added to .gitignore
  • Why net().get on success return empty string
  • Android Swipe Images
  • How to calculate a point on a rotated axis?
  • Use entered URL and button to display image from URL
  • How do you save a custom class as an attribute of a CoreData entity in Swift 3?
  • Make ASP.NET web application FIPS Compliant?
  • Word to html conversion using php
  • ProgressDialog.show inside AsyncTask stop my Program from execution
  • Matplotlib: subplot
  • twitter bootstrap for high resolution mobile displays
  • I am trying to create an app in android to insert data into sql server through a web service.
  • Is js executed after form synchronized submit
  • LIBSODIUM decrypt data inside mysql query like did with AES_DECRYPT
  • What is the purpose of set clock skew in wcf security mode settings
  • Parsing string using the Scanner class
  • Laravel Query Builder Update with Increment
  • What's the difference between using RDFS/OWL and XML?
  • Send HTML Mail with Unicode
  • SELECT on JSONField with Django
  • Circular Left Rotation Algorithm in C#
  • Windows biometric framework sample umdf driver: This device cannot start. (Code 10)
  • How to join two tables from different databases
  • xpath assertion failure with dynamic xpath
  • Multiplying polynomials/simplifying like terms
  • how to run a different select statement based on condition in Hive SQL
  • Stacked bar chart with continuous time-axis as x-axis
  • Why isn't stemDocument stemming?
  • Excel VBA : conditional formatting of sheet1 cells from sheet2 values in excel 2007
  • Codeigniniter insert data through models and controller
  • Sign a Pdf using custom digital signature in Java
  • Firebase: How to read from external DB?
  • convert json to excel in java