PHP class "cannot be resolved to a type" error [message #1840160] |
Wed, 07 April 2021 21:28 |
Gustavo Pinent Messages: 5 Registered: April 2021 |
Junior Member |
|
|
I've just installed Eclipse in my Macbook with Big Sur. I did open a folder with a website to work with as a project.
A lot of errors like "<classname> cannot be resolved as a type" is displayed. I have researched about this error and there is a lot of complains about, for many years. Sometimes, to modify .buildpath solve it, but my file is ok, it seems Eclipse is not finding the class declaration.
Here is the thing, as you can see below, my classes are in other files included by a dynamic path, so is only possible to know the source when running. Is there any solution or workaround to this issue?
<?php
if($_SERVER["HTTP_HOST"]=="localhost"){
ini_set("display_errors", "1");
error_reporting(E_ALL ^ E_NOTICE);
}
$main = 'admin3.php';
require_once("sessao.php");
if($Erros) die('<h1>Erro de início de sessão</h1><p>'.implode('<br />', $Erros).'</p><p>Inicialização abortada!</p>');
$reloadMain = $Amb->url.$main;
$htmlUsuario = ($_SESSION["Login"]["Usuario"]["logado"])?
'Usuário: <b>'.$_SESSION["Login"]["Usuario"]["nome"].' <a href="#" onclick="info(\'usr\'); return false;"> ? </a> <a href="#" onclick="loginLogout(); return false;">Sair</a></b>'
: 'Usuário não logado' ;
// jGp
$jGp = ($Amb->host=="localhost")? $Amb->urlJGp."ini-1.1.js" : $Amb->urlJGp."ini_1.1.js" ;
$jGp_modFup = ($Amb->host=="localhost")? $Amb->urlJGp."modFup-1.1.js" : $Amb->urlJGp."modFup_1.1.js" ;
// bibs
require_once($Amb->dirBibPhp."BaseDeDados.php");
require_once($Amb->dirBibPhp."ListaDir_1.php");
//require_once($Amb->dirBibPhp."EchoPlus.php");
//require_once($Amb->dirBibPhp."TextoFuncs.php");
//$TF = new TF();
//$echo = new EchoPlus();
$BD = new BaseDeDados(); ***here is pointed an error***
...
|
|
|
|
Powered by
FUDForum. Page generated in 0.07123 seconds