Slackware packages have the tgz extension.However not everything that ends with tgz is a Slackware package.
It can be source code as well.
So if you have downloaded a tgz file from slackware mirror site or a site like linuxpackages.net then only there are chances that its a slackware package and not a source file
In order to install from source you need to compile which in your case you cannot because you do not hace gcc.
So coming to your problem ,you are unable to install because :
The package you are trying to install in not in tgz format(may be its a source file)
Anyway change its extension to .tgz and they issue:
where xyz is the package you mentioned. If this again gives the error that it's not a slackware package then here are the links from which you can downlod gcc and glib packages:
You can install these packages using installpkg command.