Hi everyone, this is my first post so sorry if its a dumb question,

I have bought Randals "Art of Assembly Language" and followed the instructions inside to install HLA.

Here is what i did (running Win XP Pro)

1.) Installed MASM32 to C:\masm (all libraries extracted ok)
2.) Installed HLA from the auto-install package.
3.) Copied "ml.exe", "ml.err", "link.exe" and "mspdb50.dll" into C:\hla
4.) Rebooted PC

When i created 'HelloWorld.hla' and tried to compile it using the command prompt, i got the error message:

[ LINK: fatal error LNK1181; cannot open input file "kernel32.lib" Error returned by link = 1181 ]

"kernel32.lib" is present in both MASM\bin and was created automatically in hla\hlalib when i ran the installer.

What has gone wrong?
The compiler seems to have done something as my "helloWorld.hla" file has been accompanied by many other helloWorld files. Sadly, there is no .exe file.

I am running windows XP pro with dual OS. I am running 'Bootmagic' which has moved the Autexec.bat file. Don't know if this would cause and probs? Please help as i have installed MASM and HLA twice with same result.

Thankyou in advance.
Posted on 2004-04-04 21:18:30 by dunc
Have you set up your envrionment variables?

I don't know how they are done in XP, but you need to set the following:


set lib=f:\hla162\hlalib;
set hlainc=f:\hla162\include
set hlalib=f:\hla162\hlalib\hlalib.lib
set hlatemp=f:\hla162\temp

This is how it is in my current setup, you'll need to modify the paths accordingly.
hlatemp is optional.

If you're using RADasm, you can put these right in the hla.ini file.
Posted on 2004-04-04 22:19:28 by Kain
Hey thanks for the speedy reply,

I found the problem and you were right.

The installer set up all variables except for 'lib'. Bizarre. I set it manually and now everything works fine.
Thanks for your help.

Best Regards,
Dunc
Posted on 2004-04-04 22:22:44 by dunc
One more thing....sorry:

Is it possible to link RadASM to the hla compiler so i don't need to use the command prompt. Its ok if you cant, it would just save exiting the IDE?

Thanks again,

Dunc
Posted on 2004-04-04 22:32:34 by dunc
Yes, that's how I do it.

It's a rather complex process seting it up though. So you may want to look through the documents on setting it up.

or cheat and see how I do it:
Note, this is different from the standard HLA setup for RADasm.

first, backup the hla.ini file.
download the latest RADasm.
open up the hla.ini in an editor.

add an section like so:


1=path,f:\hla162;f:\masm32\bin
2=lib,f:\hla162\hlalib
3=hlainc,f:\hla162\include
4=hlalib,f:\hla162\hlalib\hlalib.lib
;5=hlatemp,f:\hla162\temp

make sure the paths correspond to your system. I commented out the hlatemp in my system since there appears to be a bug in HLA on processing the temp directory with some options.

Note: you don't need a path to masm32\bin if you have all the files you need in your hla directory.


make sure the makefile section looks something like this. If you change this around, the next section won't work.


0=.rap
1=.rc
2=.asm
3=.obj
4=.res
5=.exe
6=.def
7=.dll
8=.txt
9=.lib
10=.mak
11=.hla
12=" "


next, replace the section with this:
Note: this setup will use the Borland Make command. I prefer this over Nmake
You'll have to get a copy of Make to use this setup (it comes with the free borlandcc55 package).



Files=1,1,1,0
Folders=1,1,0,0
Menu=1,0,0,1,1,1,1,0,0,0
1=0,OT,make -Dhlafile="$12" -DWINAPP="-w" compilerc,
2=0,OT,make -Dhlafile="$12" -DWINAPP="-w" buildall,
3=0,OT,make -Dhlafile="$12" -DWINAPP="-w" build,
4=0,0,,5
5=0,OT,make -Dhlafile="$12" -DWINAPP="-w" syntax,
6=
11=0,OT,make -Dhlafile="$12" -DWINAPP="-w" compilerc,
12=0,OT,make -Ddebug="-Ddebug" -Dhlafile="$12" -DWINAPP="-w" buildall,
13=0,OT,make -Ddebug="-Ddebug" -Dhlafile="$12" -DWINAPP="-w" build,
14=0,0,,5
15=0,OT,make -Ddebug="-Ddebug" -Dhlafile="$12" -DWINAPP="-w" syntax,
16=
7=
17=

You can use this for console apps too, but you'll have to modify the makefile.

Next, load RadAsm and set the options/paths to your HLA folder

Once you start a project, you'll have to set up a makefile.

You can use this:

build: $(hlafile).exe

buildall: clean $(hlafile).res $(hlafile).exe

compilerc: $(hlafile).res

syntax:
hla -s $(hlafile).hla

clean:
del *.exe
del *.obj
del *.res
del *.link
del *.asm
del *.map

$(hlafile).res: $(hlafile).rc
rc /v $(hlafile).rc

$(hlafile).obj: $(hlafile).hla
hla $(debug) -w -c $(hlafile)

$(hlafile).exe: $(hlafile).hla
hla $(debug) -w $(hlafile)


If you don't have a resource, remove the xxx.res sections
If it's a console program, remove the -w

That's about it. It's not perfect, and I don't use *this* setup anymore, but my new setup is still a work in progress.

With the above setup, if you press the F5 key, it'll build your project.


It's a bit overkill if you only have one executable.

So, if you want to just assemble a simple console application, it's way easier just to edit the project options:

go to project menu, select project options:

In the "Assemble" field, clear it and type the command line that will assemble your project.

example, you would type this in the Assemble field of project options:

0,OT,hla myprogram.hla

then everytime you press F5, that command line is executed.
Posted on 2004-04-04 23:06:02 by Kain
I got the same problem with HLA v1.63, all the env vars are correct, but still it's complaining about kernel32.dll, I can't figure the problem out :(
Posted on 2004-05-03 05:22:50 by rem-c

I got the same problem with HLA v1.63, all the env vars are correct, but still it's complaining about kernel32.dll, I can't figure the problem out :(


kernel32.dll? or do you mean kernel32.lib?

If it's the library, make sure the LIB environmnet points to the correct directory (probably ...\hla\hlalib)
And make sure the kernel32.lib is in your hlalib folder, if not, copy it over from masm32 library folder.
Posted on 2004-05-03 11:20:27 by Kain
yeah sorry i' mean kernel32.lib, but the problem is, i believe did everything correct, the setup adds the lib and the env vars correctly, but still it can't find kernel32.lib when linking, so i'm out of answer :(
Posted on 2004-05-04 02:19:18 by rem-c
finally if found the problem, the setup only setups the system envs en not the user envs, after the setup I copied the lib and path vars to the user envs and now it's compiles correctly :)
Posted on 2004-05-04 13:28:29 by rem-c