1
votes

Am getting the following error when trying to run (require 2htdp/image) in DrRacket:

module: identifier already required

The error occurs after updating from DrRacket 7.3 to 7.4.

I uninstalled all previous versions of DrRacket including 7.4 and reinstalled 7.3. Am continuing to get error.

I went through some of the solutions in stackoverflow for this error message before posting. However, my code is simple. I cannot even run (require 2htdp/image) on its own without code without triggering the error.

[edit]

Check-syntax:

unsaved-editor:2:9: module: identifier already required in: rectangle

I have no idea what that means, since there is no rectangle attached to this test.

[edit]

Language: Beginning Student [custom]; memory limit: 128 MB.
Teachpack: world.rkt.
1
Out of curiosity, what happens if you remove the (require ) line and try using 2htdp/image functionality? - MyStackRunnethOver
running 2htdp/image without require triggers this error: 2htdp/image: this variable is not defined - scola
I think that what @MyStackRunnethOver meant is that, what will happen if you use rectangle without require-ing anything? In any case, the unbound identifier error indicates that you are using a student language. What specific language is that (beginning vs intermediate vs advanced)? What are teachpacks that you are using? - Sorawee Porncharoenwase
@Sorawee The "rectangle" message I refer to in my edit is not using a rectangle. The error is simply from hitting run after adding (require...). To answer your question, images trigger "this function is not defined" without the (require...). Please see my edit. - scola

1 Answers

4
votes

it's means you added teachpack (*.rkt) has same function name "rectangle". just clear teachpacks only add you really needed teachpacks

(require 2htdp/image) "image.rkt" have function rectangle.

(require htdp/world) "world.rkt" also have function rectangle.

In same folder create a.rkt b.rkt c.rkt

create file a.rkt

#lang racket
(provide t)
(define (t x) (+ x 1))

create file b.rkt

#lang racket
(provide t)
(define (t x) (+ x 2))

create file c.rkt

#lang racket
(require (file "a.rkt"))
(require (file "b.rkt"))
(t 3)

run c.rkt will shows

module: identifier already required in: t