# \[AMPL 24993\] AMPL ERRORS

**URL:** <https://discuss.ampl.com/t/ampl-24993-ampl-errors/963>\
**Category:** Google Group Mirror\
**Created:** [February 26, 2024, 5:25am UTC](https://discuss.ampl.com/t/ampl-24993-ampl-errors/963 "2024-02-26T05:25:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 26, 2024, 7:14pm UTC](https://discuss.ampl.com/t/ampl-24993-ampl-errors/963/2 "2024-02-26T19:14:13Z")

</div>

When I put these statements in a file named amplerrors.txt, and then read that file into AMPL, I see this error message:

```auto
ampl: include amplerrors.txt;

..\amplerrors.txt, line 27 (offset 578):
	Cg is not defined
context: sum{i in N} >>> (Cg[i]*G <<< [i,t] + COg[i]*G[i,t]) +

```

This error occurs because `Cg` is used in your objective function, but there is no definition of `Cg` in any param or var statement in your model. Usually the reason for this error is one of the following:

- You used a param or var but forgot to define it.
- There is a mistake in typing a param or var name, either in its definition or in the place where it is used.

---

_[View the full topic](https://discuss.ampl.com/t/ampl-24993-ampl-errors/963)._
