Getting Fatal error: Uncaught Error: Call to undefined function plugin_dir_path() when linking to another file within my wordpress plugin

I solved the problem using the admin_url() wordpress function. In order to link to another page in the plugin or even to another plugin within my project, I did it by passing the registered url to admin_url() function.

<a href="https://wordpress.stackexchange.com/questions/367725/<?php echo  admin_url("admin.php?page=edit-member-page&id='.$id);?>">John Smit`h</a>

//The $id variable passed to the link will be retrieved by use of `$_GET[‘id’]; superglobal on edit_member.php
But first url sluf: edit-member-page first should be registered in your plugin or functions.php

in my plugin main

 //add menu call back
    function load_edit_member_page_callback(){
    include_once("edit_member.php")
    }
//add admin menu action
add_action('admin_menu','register_edit_member_fun');
//implement register_edit_member_fun function
function register_edit_member_fun(){
add_menu_page(
    'edit member', //page title
    '', //menu title (I left it blank because  I don't want the menu to appear to users. I just need to make use of the slug to link internally
    'manage_options', //capability
    'edit-member-page', //slug, this is what I passed to hre attribute above
    'load_edit_member_page_callback',//callable function


    );
}

Hope this helps someone.