# PATH issue in appImage app?

**URL:** <https://discourse.appimage.org/t/path-issue-in-appimage-app/2587>\
**Category:** Creating AppImages\
**Created:** [January 21, 2022, 10:14am UTC](https://discourse.appimage.org/t/path-issue-in-appimage-app/2587 "2022-01-21T10:14:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lock042](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/lock042/32/652_2.png) [@lock042](https://discourse.appimage.org/u/lock042)\
**Post date:** [January 21, 2022, 10:14am UTC](https://discourse.appimage.org/t/path-issue-in-appimage-app/2587/1 "2022-01-21T10:14:50Z")

</div>

Hello.  
I have an issue with my C application.  
Inside the code I test if gnuplot exists with something like that:

```auto
	gchar *str = g_strdup("gnuplot -e > /dev/null 2>&1");

	int retval = system(str);
	g_free(str);
	if (WIFEXITED(retval))
		return 0 == WEXITSTATUS(retval);
	return FALSE;

```

Of course it works well in Linux, except when I build the app as an appImage. I think it is a PATH issue (looking in the /usr/bin of the bundle??) but I don’t know how I can solve it.  
What is the correct way to do it?

Thx a lot.

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [March 31, 2022, 8:52pm UTC](https://discourse.appimage.org/t/path-issue-in-appimage-app/2587/2 "2022-03-31T20:52:07Z")

</div>

Welcome back @lock042!

> [@lock042](#):
>
> `gnuplot`

Where is that gnuplot located? Inside or outside the AppImage? Since gnuplot cannot be expected to come with all Linux distributions by default, you should bundle it (and its dependencies) inside your AppImage.

You need to put it onto the `$PATH` so that your code works.

Or change the code to check for `<location from which the current application is running>/gnuplot`.

Check [c++ - Finding current executable's path without /proc/self/exe - Stack Overflow](https://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe) for getting the location from which the current application is running.
