Results 1 to 7 of 7

Thread: Solving "Undefined Symbol" errors

  1. #1

    Solving "Undefined Symbol" errors

    Hey FPC-people,

    I've bumped into a problem. I'm trying to compile my engine on windows with FPC/Lazarus but it doesn't work. This is strange because I can do it with Delphi on Windows and with FPC on Linux.

    These are my errors:
    meshtestproj.lpr(244,1) Error: Illegal COFF Magic while reading G:\n3d\repo\fpc-demos\precompiled\sdl.o
    meshtestproj.lpr(244,1) Error: Undefined symbol: THREADVARLIST_SDL
    meshtestproj.lpr(244,1) Error: Undefined symbol: RTTI_SDL_PSDL_JOYSTICK
    First of all, I would like to know what these errors mean in general. Also, what can I try to solve these?

    Thanks!
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  2. #2
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Have you tried adding the -MDelpi switch to the command? It sometimes helps. What version of fpc are you using? 2.4.0 perhaps?
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  3. #3
    I use "{$MODE Delphi}" in most of my files, so I guess that means yes.

    Also, I'm using Lazarus so commandline tricks don't really help (unless you can explain how to do the same thing with Laz).
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  4. #4
    You should use latest daily snapshot for windows Lazarus. The official release is way outdated.

  5. #5
    Ok, are you referring to these?

    http://www.hu.freepascal.org/lazarus/

    I might give it a try, but first I'll explore my other options. I actually don't think that this is caused by using a different version.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  6. #6
    meshtestproj.lpr(244,1) Error: Illegal COFF Magic while reading G:\n3d\repo\fpc-demos\precompiled\sdl.o
    I think that this error is caused by wrong version/format of the sdl.o file. Therefore deleting it and compiling again should work.

    Maybe the win and linux fpc linkers require different format of the *.o files. This would explain why it compiles only on linux. As for Delphi, if I remember correctly, it uses .dcu files, not .o so also no problem there.

  7. #7
    I finally managed to solve it.

    It seems that the project was using the wrong version of sdl.pas (the one stored in the lazarus directories). Still not sure why that caused the "Undefined symbol" errors.

    @Grudzio: Your explanation seems plausible. I'll keep it in mind for when I encouter the COFF magic error again.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •