several linker errors

Mac OSX specific forum
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

several linker errors

Post by Rozek »

Good morning!

I'm currently trying to compile a PB (4.30) program on a Mac mini (Intel) running MacOS X 10.4.11 - but I just get a bunch of undefined symbols reported by the linker (unfortunately, I can't "cut & paste" the error message from the message dialog)

Here are some of the reported symbols:

_PB_ChangeAlphaIntensity
... (many other symbols which look like PB commands)
_SYS_FreeString
_jpeg_CreateDecompress
_jpeg_... (many other similar symbols)

Does that mean, that - in the first case - the reported function is not (yet) supported under macOS X?

And, in the last case: does that mean that a (JPEG) library is missing? If yes, what would I have to install or configure?

And what about "_SYS_FreeString"?

Thanks in advance for any hints!
Kind regards,

Andreas Rozek
WilliamL
Addict
Addict
Posts: 1255
Joined: Mon Aug 04, 2008 10:56 pm
Location: Seattle, USA

Post by WilliamL »

Wow, what a mess! You're gonna have to break your program down into smaller pieces and take the errors one at a time. I'm not sure what AlfaIntensity is but it may not be supported on the Mac. (if it is, I'm sure you will get a response to my comment). As for the jpeg, did you use 'ImagePlugin' to get the jpeg decoder?

You might try both the PPC and the x86 version and see if the errors are different.
MacBook Pro-M1 (2021), Tahoe 26.1, PB 6.30b2
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Are you sure you have the correct developer tools?
Where did you drag the PB folder to?
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Good morning...and thanks for your ideas!

Wether I UseJPEGImageEncoder/Decoder or not does not make any difference

ChangeAlphaIntensity does not seem to be supported under MacOSX, I may have to omit it completely from my code.

The PureBasic folder was dragged into the standard application folder - and other programs can be compiled without problems.

I'll now try to find out which routine(s) introduce those "_jpeg_" symbols.
Kind regards,

Andreas Rozek
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello again!

I recently reported the undefined PB commands as a (MacOS X specific) bug.

Concerning the undefined _SYS_FreeString and all those _jpeg_### symbols it might be useful to know that the linker (ld) which reports the symbols resides in the folder

/usr/libexec/gcc/i686-apple-darwin8/4.0.1

Again: many PB programs compile and link without errors - and I do not yet know which part(s) of my 13000 lines of code contain(s) the command(s) that lead to those linker errors...
Kind regards,

Andreas Rozek
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Well,

I just found one source for my linker errors: as soon as I add support for JPEG2000

useJPEG2000ImageDecoder()
useJPEG2000ImageEncoder()

I get most of those linker error messages shown above.

Now I still have to look for the _SYS_FreeString symbol - does anybody have any idea where this symbol could be used?

Thanks in advance for any hints!
Kind regards,

Andreas Rozek
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Rozek wrote:Now I still have to look for the _SYS_FreeString symbol - does anybody have any idea where this symbol could be used?
It's used whenever you use strings.
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello!

Thanks for the response - unfortunately, a small program using strings (well, "Hello, World!" would already be sufficient) compiles, links and runs without any problems.

So, how can it happen, that a large program does not run because of that undefined symbol????

Here is the complete error message


PureBasic - Linker error

/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_SYS_FreeString
collect2: ld returned 1 exit status


Very strange...
Kind regards,

Andreas Rozek
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

And it gets even stranger...

When I try to strip down my program (by removing lots of the routines I wrote) in order to find the error location using a binary division approach, I sometimes get *more* linker errors than before!

E.g., suddenly, the linker no longer finds

_PB_Network_AddressIndex
_PB_Network_HostInfo

which are definitely PureBasic functions...

Does anybody have *any* idea what might be going on here? Myself, I do no longer think that the problem arises because a specific routine (such as SYS_FreeString) is missing - presumably, the actual problem is something different.

Again: the code is approx. 14000 lines long (as reported by PB) and runs fine under Windows!
Kind regards,

Andreas Rozek
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

does the useJPEG2000ImageDecoder() linker error occur in just a simple program that only calls that function / that function plus loadimage?

Something is possibly corrupting the command line passed to the linker, hence why you get seemingly random errors..
(though don't quote me on that one)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello Demonio!

No, a little "program" which simply consists of

useJPEG2000ImageEncoder()
useJPEG2000ImageDecoder()

can be compiled and linked without problems...[EDIT]I also tried with an additional "loadImage" command and it still worked!

Strange, really strange...

I also already tried the command line version of the compiler - with the same results.

Is there any possibility to check how the linker is invoked? Should I use a "Linker Options File" - and, if yes, how?
Kind regards,

Andreas Rozek
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

No sure on that one.

Try this: use the command line compiler to make a commented asm file (it's the -c option I think (don't have linux/mac pbcompiler in front of me))
Then post here just the header (the lines with ; in front at the beginning of the file)

Do this with the file that causes the linker error
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello Demonio!

I did what you told me - here is the result:

Code: Select all

; 
; PureBasic x86 4.30 (MacOS X - x86) - generated code
; 
; (c) 2008 Fantaisie Software
; 
; The header must remain intact for Re-Assembly
; 
; Xml
; World
; Window3D
; ToolBar
; Thread
; Terrain
; StatusBar
; Sprite3D
; SoundPluginOGG
; SoundPluginFLAC
; Sound3D
; SerialPort
; Scintilla
; Requester
; RegularExpression
; Process
; Printer
; Preference
; Particle
; Packer
; OnError
; Node
; Movie
; Mouse
; Module
; Sound
; SoundPlugin
; Mesh
; Memory
; Math
; Material
; Mail
; Light
; Library
; Internal
; ImagePluginTIFF
; ImagePluginTGA
; ImagePluginPNG
; ImagePluginJPEG
; Http
; Help
; GadgetWeb
; Ftp
; String
; Network
; Misc
; Font
; File
; Entity
; Texture
; DragDrop
; Desktop
; DatabaseSQLite
; FileSystem
; DatabaseODBC
; Database
; Console
; ClipboardImage
; Image
; Clipboard
; Cipher
; Camera
; Billboard
; Engine3D
; Screen
; Sprite
; ImagePlugin
; Keyboard
; ImagePluginBMP
; Window
; Gadget
; Date
; Menu
; LinkedList
; Event
; AudioCD
; MultimediaBase
; 2DDrawingShared
; 2DDrawing
; Object
; SimpleList
; :System
; :Import
; 
; 
; 
I found SYS_FreeString in

Code: Select all

extern SYS_FreeString
It is used quite often, on the other hand, _SYS_FreeString does not occur in the file.

Actually, most externally referenced symbols start with an underscore, but a whole bunch of them without
Kind regards,

Andreas Rozek
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello!

I also tried to use an external "Linker Options File" - but without success: regardless what I entered into the file (it seems as if it would just be ignored)
Kind regards,

Andreas Rozek
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Well, the SYS_FreeString error appears to be a PB bug, as in my experiments with tailbite, I only ever saw _SYS_FreeString if my memory serves correctly.
You may have to PM a link to your code causing this error to Freak/Fred if it is a non-public project along with a bug report...

By the looks of it, from what you've said, SYS_FreeString is being linked in, but _SYS__FreeString is not...
The initial underscore one is correct from my experience (though I could be wrong)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Post Reply