1833802 Members
2269 Online
110063 Solutions
New Discussion

Re: Cannot load <file>

 
Nameesh
Frequent Advisor

Cannot load <file>

Hi,

I have created a file which contains few of the rules that would be executed on the basis of few conditions. This file is being called from the Makefile. And during compilation, I get the following error :

Cannot load

The looks like this :

************************
#!/bin/ksh
package="$PACKAGE"
classCodes="classCodes"

if
.
.
fi
*************************

The file has appropriate permissions also.

Please suggest the reason and possible solution for the same.

Regards,
Nameesh.
7 REPLIES 7
Elmar P. Kolkman
Honored Contributor

Re: Cannot load <file>

How do you call it from your Makefile?
Every problem has at least one solution. Only some solutions are harder to find.
Nameesh
Frequent Advisor

Re: Cannot load <file>

Hi,

I call it from another rule in the Makefile ie.,

preComp:
export PACKAGE="$(PACKAGE)"
$(TEMPLATES)

And the compilation stops while reading and running this file contents.

Please suggest.

Regards,
Nameesh.
Elmar P. Kolkman
Honored Contributor

Re: Cannot load <file>

I guess there is a leading tab before the in your Makefile which is removed by the forum. Do you specify the script with full pathname? Or a relative path? . is not in your PATH when running from make...

Every problem has at least one solution. Only some solutions are harder to find.
Nameesh
Frequent Advisor

Re: Cannot load <file>

There is doesn't seem to be any problem in the makefile. I have made sure that there no blank spaces in the Makefile and it contains only Tabs.

This is present in present in the direcotry from where I am running the make. But, doesn't have a extension.

File is of command text type. Does that make any difference ?
Elmar P. Kolkman
Honored Contributor

Re: Cannot load <file>

Nameesh,
if is in the current directory, call it in your Makefile by prepending it with './'

Just test it, then shoot at my response ;-).
Every problem has at least one solution. Only some solutions are harder to find.
Nameesh
Frequent Advisor

Re: Cannot load <file>

That surely isn't the reason because I am setting my PATH variable correctly.

I just tried to remove some junk space character and then it is able to access the file.

But then, the variables exported in the Makefile are not visible in the . Eg:

rule1: export CLASSPATH=$BLD_LIB
$SRC

In this instance, I set the CLASSPATH. but, the variable value is not visible in the and it tells that :

CLASSPATH variable not found

Please help

Regards,
Nameesh.
Elmar P. Kolkman
Honored Contributor

Re: Cannot load <file>

I'm not talking about CLASSPATH, I'm, talking about the command PATH, used to locate which command you try to run. For instance, if you type sh on your command line, PATH is used to find where sh is located on your system. It defines if /bin/sh, /usr/bin/sh, /sbin/sh or perhaps even /usr/local/bin/sh is called. When running commands as normal user from the command line, you can even call commands in the current directory, since '.' is in the PATH too by default.

But the error message indicates it cannot find your executable, so it seems your current directory, '.', is not in your PATH. You could do 'echo ${PATH}' in your Makefile before starting to make sure.
Every problem has at least one solution. Only some solutions are harder to find.