# Is it because my P4 version too old?

**URL:** <https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644>\
**Category:** Getting Started with P4\
**Created:** [February 15, 2023, 3:07am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644 "2023-02-15T03:07:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duang](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Duang](https://forum.p4.org/u/Duang)\
**Post date:** [February 15, 2023, 3:07am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644/1 "2023-02-15T03:07:19Z")

</div>

I encountered the following error when compiling my P4 program：

```auto
main.p4(214): [--Werror=type-error] error: Field miss is not a member of structure struct local_route
            if (local_route.apply().miss){
                                    ^^^^
Compilation Error`Preformatted text`

```

My code is as follows：

```auto
            if (local_route.apply().miss){
                packet_route.apply();
            }

```

Is it because my p4 version too old?

```auto
p4test --version
p4test
Version 1.1.0-rc1 (SHA: 8742052)

```

How do I upgrade the p4 version without affecting the execution of the p4run command?

---

<div class="post-metadata">

**Author:** ![vgurevich](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/vgurevich/32/23_2.png) [@vgurevich](https://forum.p4.org/u/vgurevich)\
**Post date:** [February 15, 2023, 4:25am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644/2 "2023-02-15T04:25:52Z")

</div>

Hello Duang,

First of all, you really have an extremely old version of the compiler. `.miss` attribute was added in the P4 language specification v. 1.2.0 in October 2019 and the current version is 1.2.3 (July 2022).

You should download the new version of the compiler from [GitHub - p4lang/p4c: P4\_16 reference compiler](https://github.com/p4lang/p4c) and build it using the instructions, provided there.

Alternatively, simply replace your code with the equivalent:

```auto
            if (!local_route.apply().hit){
                packet_route.apply();
            }

```

But staying on latest version of the tools is the right thing to do nevertheless (assuming that you want to receive meaningful help and support in the future).

Happy hacking,  
Vladimir

---

<div class="post-metadata">

**Author:** ![andyfingerhut](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/andyfingerhut/32/17_2.png) [@andyfingerhut](https://forum.p4.org/u/andyfingerhut)\
**Post date:** [February 15, 2023, 5:27am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644/3 "2023-02-15T05:27:25Z")

</div>

One way to get an Ubuntu 20.04 Desktop Linux VM that can be run on a macOS or Windows or Linux host system using free and open source VirtualBox is to download it from this page: [p4-guide/README-install-troubleshooting.md at master · jafingerhut/p4-guide · GitHub](https://github.com/jafingerhut/p4-guide/blob/master/bin/README-install-troubleshooting.md)

That page also explains how to run a bash script that on a freshly installed Ubuntu 18.04, 20.04, or 22.04 Linux system, that will download and compile p4c and several other open source P4 development tools.

Neither of those options includes a command called `p4run` that I am aware of. I am not familiar with it. Thus if you followed either of the options above, you would need to figure out where you got `p4run` from and install it on the new system created by the steps above.

---

<div class="post-metadata">

**Author:** ![Duang](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Duang](https://forum.p4.org/u/Duang)\
**Post date:** [February 15, 2023, 8:44am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644/4 "2023-02-15T08:44:42Z")

</div>

Thank you for your answer, p4run is a command in p4-utils. P4-Utils is an extension to _Mininet_ that makes P4 networks easier to build, run and debug. P4-utils is strongly inspired by p4app.And here is the link to this tool [https://github.com/nsg-ethz/p4-utils](https://github.com/nsg-ethz/p4-utils)

---

<div class="post-metadata">

**Author:** ![Duang](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Duang](https://forum.p4.org/u/Duang)\
**Post date:** [February 15, 2023, 9:05am UTC](https://forum.p4.org/t/is-it-because-my-p4-version-too-old/644/5 "2023-02-15T09:05:49Z")

</div>

Hello Vladimir，  
Thanks a lot for your answer, it is very useful for me.

Duang
