user233: The plan is to create a bigger project and to split the ESP8266 webserver-code over several modules (.h .c files). The main problem is that the ESP8266WebServer server is not declared in the index.h and index.c files.
What I've been trying to do:
Content main.c
#include <ESP8266WiFi.h>
#include "ESP8266WebServer.h"
#include "index.h"

ESP8266WebServer server(80);
const char* ssid =     "test";     
const char* password = "12345678";  

void setup() 
{
  WiFi.softAP(ssid, password);
  server.on("/", handleRoot(server));           // <-- use of deleted function 'esp8266webserver::ESP8266WebServerTemplate<WiFiServer>::ESP8266WebServerTemplate(const esp8266webserver::ESP8266WebServerTemplate<WiFiServer>&)'
  server.begin();
}

void loop()
{
  server1.handleClient();
}

Content index.h:
void handleRoot(ESP8266WebServer server); 

const char htmlIndex[] PROGMEM = R"=====(
<html>
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Test</title>
  </head>
  <body>
    <h1>Hello World!</h1>
  </body>
</html>
)=====";

Content index.c:
#include "webpages/index.h"

void handleRoot(ESP8266WebServer server) 
{
  Serial.println("GET /");
  server.send(200, "text/html", htmlIndex);
}

How can I use the ESP8266WebServer server created in the main.c in index.c? 

user31105: Move the webserver to index.c and include the webserver type:
ESP8266WebServer server(80);

Add an external reference in index.h and include it:
#include "ESP8266WebServer.h"

extern ESP8266WebServer server;

Index.h is included by both main.c and index.c so it will know about server being an ESP8266WebServer type, but does not allocate memory for it; that is done in index.c
This is called a forward reference.

233: <p>The plan is to create a bigger project and to split the ESP8266 webserver-code over several modules (.h .c files). The main problem is that the ESP8266WebServer <strong>server</strong> is not declared in the index.h and index.c files.</p>

<p>What I've been trying to do:</p>

<p>Content main.c</p>

<pre><code>#include &lt;ESP8266WiFi.h&gt;
#include "ESP8266WebServer.h"
#include "index.h"

ESP8266WebServer server(80);
const char* ssid =     "test";     
const char* password = "12345678";  

void setup() 
{
  WiFi.softAP(ssid, password);
  server.on("/", handleRoot(server));           // &lt;-- use of deleted function 'esp8266webserver::ESP8266WebServerTemplate&lt;WiFiServer&gt;::ESP8266WebServerTemplate(const esp8266webserver::ESP8266WebServerTemplate&lt;WiFiServer&gt;&amp;)'
  server.begin();
}

void loop()
{
  server1.handleClient();
}
</code></pre>

<p>Content index.h:</p>

<pre><code>void handleRoot(ESP8266WebServer server); 

const char htmlIndex[] PROGMEM = R"=====(
&lt;html&gt;
  &lt;head&gt;
    &lt;meta http-equiv="content-type" content="text/html;charset=UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
    &lt;title&gt;Test&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Hello World!&lt;/h1&gt;
  &lt;/body&gt;
&lt;/html&gt;
)=====";
</code></pre>

<p>Content index.c:</p>

<pre><code>#include "webpages/index.h"

void handleRoot(ESP8266WebServer server) 
{
  Serial.println("GET /");
  server.send(200, "text/html", htmlIndex);
}
</code></pre>

<p>How can I use the ESP8266WebServer <strong>server</strong> created in the main.c in index.c? </p>
 31105: <p>Move the webserver to index.c and include the webserver type:</p>

<pre><code>ESP8266WebServer server(80);
</code></pre>

<p>Add an external reference in index.h and include it:</p>

<pre><code>#include "ESP8266WebServer.h"

extern ESP8266WebServer server;
</code></pre>

<p>Index.h is included by both main.c and index.c so it will know about server being an ESP8266WebServer type, but does not allocate memory for it; that is done in index.c</p>

<p>This is called a forward reference.</p>
