# No variables declared

**URL:** https://discuss.ampl.com/t/no-variables-declared/629
**Category:** Support
**Tags:** variables
**Created:** [June 30, 2023, 7:40pm UTC](https://discuss.ampl.com/t/no-variables-declared/629 "2023-06-30T19:40:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sta6779](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@sta6779](https://discuss.ampl.com/u/sta6779)
#### Post date: [June 30, 2023, 7:40pm UTC](https://discuss.ampl.com/t/no-variables-declared/629/1 "2023-06-30T19:40:19Z")

</div>

# define the variables

var wrenches \>=0; #number of wrenches to produce

var pliers \>=0;

# objective function

maximize earnings: 0.13 \* wrenches + 0.10 \* pliers;

# contraints

subject to steel: 1.5 \* wrenches + 1.0 \* pliers;

subject to molding: 1 \* wrenches + 1 \* pliers;

subject to assembly: 0.3 \* wrenches + 0.5 \* pliers;

subject to demand1: wrencehs \<=15000;

subject to demand2: pliers \<=16000;

subject to nonneg1: wrenches\>=0;

subject to nonneg2: pliers\>=0;

The above is my input

I tried this

ampl? model gtc.mod;

ampl: solve;

No variables declared.

ampl:

ANd I get no variables declared

---

<div class="post-metadata">

### Author: ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)
#### Post date: [June 30, 2023, 9:43pm UTC](https://discuss.ampl.com/t/no-variables-declared/629/2 "2023-06-30T21:43:48Z")

</div>

I see

```auto
ampl? model gtc.mod;

```

The `ampl?` prompt means that a command had already been started on a previous line, so something had already gone wrong.

To say exactly what went wrong, it would be necessary to see a transcript or screenshot of your whole AMPL session, and also an upload of the file gtc.mod. However, just looking at what you show here, I can see that your variable is misspelled in constraint `demand1`. Also your constraints `steel`, `molding`, and `assembly` need to have a relational operator (`>=` or `<=` or `=`) in them.
