Author Topic: Linker found unidentified names  (Read 176 times)

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

  • Sr. Member
  • ****
  • Posts: 496
    • PluriBASIC
Linker found unidentified names
« on: May 14, 2019, 10:31:24 PM »
 Hello Charles, sorry to bother, i just want to help Oxygen to get better. :)

In 32bit mode, this code compiles and works fine, but
try this in 64 bit mode and it fails at compilation.

I have this TYPE:

Code: [Select]
TYPE THREADVAR_PTR
  QUAD   addr
  = 
  DWORD  upper
  DWORD  lower
END TYPE

When i define a THREADVAR_PTR variable like this:

Code: [Select]
THREADVAR_PTR tp
And then use it like this:

Code: [Select]
tp.addr = getmemory(sizeof(dtype))
I get this when i try to compile:

Code: [Select]
Linker found unidentified names:
364 fildqword "main source

When i edit the TYPE like this:

Code: [Select]
TYPE THREADVAR_PTR
  SYS   addr
  DWORD dummy ' add some extra dummy bytes in case of 32 bit.
  = 
  DWORD  upper
  DWORD  lower
END TYPE

Everything compiles fine.

 I think it should be an easy fix, right?
« Last Edit: May 14, 2019, 10:39:46 PM by Brian Alvarez »

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4186
    • Oxygen Basic
Re: Linker found unidentified names
« Reply #1 on: May 14, 2019, 11:08:27 PM »
Thanks Brian,

I will investigate.


You won't need the dummy, and lower comes before upper in little-endian x86:

Code: [Select]
TYPE THREADVAR_PTR
  SYS   addr
  =
  DWORD  lower
  DWORD  upper

Brian Alvarez

  • Sr. Member
  • ****
  • Posts: 496
    • PluriBASIC
Re: Linker found unidentified names
« Reply #2 on: May 15, 2019, 01:40:22 AM »
Cool, Thanks Charles. I thought that since SYS is 32 bits in x32 mode, the second dword would overflow the type.
Its good to know it wont...

So, the bigger blocks defines the size of the UDT, right?

Charles Pegge

  • Admin Support Member
  • *****
  • Posts: 4186
    • Oxygen Basic
Re: Linker found unidentified names
« Reply #3 on: May 15, 2019, 02:18:00 AM »
Yes, unions are always padded out to the max.