undefined reference to `_1'

BlitzMax Forums/BlitzMax Programming/undefined reference to `_1'

Leon Drake(Posted 2007) [#1]
I keep getting this error i've located the problem.

seems to be coming from this function

Function savepackage(afile$,pack:package)
If afile$ = "" Or pack = Null Then Return -1
Local indexdoc:xmlDocument = xmlDocument.Create()
Local inode:xmlNode,map:area,mat:TTMaterial
Local cnode:xmlNode,tnode:xmlNode,pm:TPixmap
Local filelist:TList = New TList,pfile:packfile
'lets create an index
indexdoc.Root().Name = "includes"
'lets add our areas if any

For mat = EachIn material_list
	If mat.pack = pack Then
	inode = indexdoc.Root().AddNode("material", AS_CHILD)
	inode.Attribute("handle").Value = mat.pbucket_handle$
	inode.Attribute("index").Value = mat.index
	inode.Attribute("name").Value = mat.mat_name$
	inode.Attribute("red").Value = mat.colalphshin#[0]
	inode.Attribute("green").Value = mat.colalphshin#[1]
	inode.Attribute("blue").Value = mat.colalphshin#[2]
	inode.Attribute("alpha").Value = mat.colalphshin#[3]
	inode.Attribute("shine").Value = mat.colalphshin#[4]
	inode.Attribute("blend").Value = mat.matbmode
		For i = 0 To 5
		inode.Attribute("flag"+i).Value = mat.matflags[i]	
		Next
	
	cnode = inode.AddNode("texture", AS_CHILD)
		For i = 0 To 2
		If texture$[i] <> "" Then
		tnode = cnode.AddNode("image", AS_CHILD)
		tnode.Attribute("index").Value = i		
		tnode.Attribute("anim").Value = mat.texanim[i]
		tnode.Attribute("frames").Value = mat.texframes[i]
		tnode.Attribute("w").Value = mat.texsizew[i]
		tnode.Attribute("h").Value = mat.texsizeh[i]
		tnode.Attribute("blend").Value = mat.textureblend[i]	
			For ii = 0 To 9
			tnode.Attribute("flag"+ii).Value = mat.texflags[ii+(i*10)]
			Next
		pfile = New packfile
		pm = LockImage(mat.texturecache[i])
		UnlockImage(mat.texturecache[i])
		SavePixmapPNG( pm,pfile.bfile,9 )
		pfile.file$ = pack.packid$+"."+pack.packname$+"."+mat.mat_name$
		tnode.Attribute("file").Value = pack.packid$+"."+pack.packname$+"."+mat.mat_name$
		ListAddLast(filelist,pfile)	
		EndIf
		Next
	
	EndIf
Next

For map = EachIn area_list
	If map.pack = pack Then
	inode = indexdoc.Root().AddNode("area", AS_CHILD)
	inode.Attribute("areaid").Value = map.areaid$
	inode.Attribute("areaname").Value = map.areaname$
	inode.Attribute("areatype").Value = map.areatype
	'now to add geometry data
	pfile = New packfile
		
	pfile.bfile = writegeodata(map.world)
	pfile.file$ = pack.packid$+"."+pack.packname$+"."+map.areaname$
	inode.Attribute("file").Value = pack.packid$+"."+pack.packname$+"."+map.areaname$
	ListAddLast(filelist,pfile)
	EndIf
Next
'Rem
pfile = New packfile
indexdoc.Save(pfile.bfile,FORMAT_BINARY)
pfile.file$ = "index"
ListAddLast(filelist,pfile)

'now save the resources together
For pfile = EachIn filelist
pfile.bbcfile = Crunch(pfile.bfile,4)
Next

'now add to archive file

For pfile = EachIn filelist
AddToArchive(pfile.bbcfile,pfile.file$,afile$)
Next
'End Rem
ClearList filelist

End Function 



im using a modified version of BBCruncher but i commented out those functions and i still get the problem i think it may be related to maxml


Brucey(Posted 2007) [#2]
what's the exact error message you get?


Leon Drake(Posted 2007) [#3]
its in output tab

Linking:eoled.exe
C:/Program Files/BlitzMax/endsoflegend/.bmx/eoled.bmx.gui.release.win32.x86.o: undefined reference to `_1'
Build Error: Failed to link C:/Program Files/BlitzMax/endsoflegend/eoled.exe
Process complete


Leon Drake(Posted 2007) [#4]
if i take out the function using xml it seems to work. i dont seem to have this problem on my other app but its only reading XML not generating a document.


Leon Drake(Posted 2007) [#5]
ok i just made a blank app with these lines

Import pub.maxml

Local indexdoc:xmlDocument = xmlDocument.Create()


I still seem to be getting the problem.

I wonder if i got the wrong version. I never got Pub.maxml when syncing mods i had to download it manually.


Leon Drake(Posted 2007) [#6]
meh, i guess i'll jst steer clear of using .Create() method. works fine if i just put

indexdoc:xmlDocument = new xmlDocument