Problem with linking under Linux in debug mode compilation lazarus / 32-Linux ---------------------------------------------------------------------- simone · 2019-04-27 09:35 I periodically check under Linux Ubuntu a quite complex project developed under Windows, in order to detect OS dependencies. I have never had any problems in these years so far, but with Lazarus 2.x, when I compile in debug mode (no problem in release mode), I have the following linking error:  Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (9015) Linking /home/simone/Scrivania/MyGraphEditor 346/mygrapheditor/usr/bin/objcopy: "346/mygrapheditor.dbg"": questo file non esiste (***)/home/simone/Scrivania/MyGraphEditor 346/MyGraphEditor.lpr(67,1) Error: (9013) Error while linking/home/simone/Scrivania/MyGraphEditor 346/MyGraphEditor.lpr(67,1) Fatal: (10026) There were 1 errors compiling module, stoppingFatal: (1018) Compilation abortedError: /usr/bin/ppcx64 returned an error exitcode  (***) translated: This file does not exist  It seems that the linker is not able to find the .dbg file because of space character in the path. My experience in using Lazarus under Linux is limited. Has someone some explanations?  Thanks in advance. ---------------------------------------------------------------------- howardpc · 2019-04-27 09:46 On Windows I think FPC uses an internal linker if possible. On other OSs FPC relies on third party tools, some of which still cannot cope with space characters in paths. Does renaming the offending directory path to remove all spaces dispose of the issue? ---------------------------------------------------------------------- simone · 2019-04-27 09:54 Thanks Howard. Just tested: If I remove the space in the path, renaming the folder, the linking process ends without errors. The strange thing is that in the past, with same os istallation but different Lazarus version, I have never had this issue. ---------------------------------------------------------------------- Martin_fr · 2019-04-27 10:51 Maybe a difference between using internal and external debug info file? ---------------------------------------------------------------------- simone · 2019-04-27 14:40 I'm not sure to understand your hypothesis. I compiled the project starting without a .dbg file. The compiler generate the .dbg file, but the linker don't find it, reporting a path truncated in the space position. With respect to my intial post, the created .dbg file has the following path: /home/simone/Scrivania/MyGraphEditor 346/mygrapheditor.dbg The linker says: /usr/bin/objcopy: "346/mygrapheditor.dbg"": This file does not exist So I thought that the problem was the space in path. Indeed, if I remove it, the linker works well. ---------------------------------------------------------------------- Martin_fr · 2019-04-27 15:17 But you also said (or did I misread?) that you did not have the issue at some earlier point, yet believed the space had been there already? Afaik (but not a 100% sure) the .dbg file is only used/needed if you select "Use external debug symbol file (-Xg)". So maybe you did change that setting at some time. ---------------------------------------------------------------------- simone · 2019-04-27 16:09 Dear Martin, you read correctly. For this project I have always used to name the folder with last version as name+whitespace+number, without problems under Linux since now. Moreover I always used -Xg option for gbd. Are you asking me this because my problem is not reproducible? ---------------------------------------------------------------------- Martin_fr · 2019-04-27 16:24 I haven tried if it is reproducible. I couldn't know if or how much you know about -Xg. I saw the dbg file, and the mention that something seems to have changed. So I pointed this out, in case it may have been changed unintentionally. As this is not the case, I do not know what caused the change. ---------------------------------------------------------------------- simone · 2019-04-27 16:39 I always used external gdb file. However, as soon as I can, I try to reproduce the issue with a project created from scratch. The Lazarus 2.0.2 installation is fresh (from .deb files). ---------------------------------------------------------------------- Cyrax · 2019-04-27 17:05 This thread somewhat reminded this bugreport of mine : https://bugs.freepascal.org/view.php?id=35326 ---------------------------------------------------------------------- lucamar · 2019-04-27 18:04 Quote from: simone on April 27, 2019, 06:39:43 pmI always used external gdb file. However, as soon as I can, I try to reproduce the issue with a project created from scratch. The Lazarus 2.0.2 installation is fresh (from .deb files). I use external debug files too and I've always had this problem: objcopy and some other utils don't like spaces in the file names, whatever the platform. At least the versions I have; maybe the latest versions have corrected this behaviour. The "solution" is either to make sure there's never a space in the passed paths or not use the "external debug file"  option. ---------------------------------------------------------------------- simone · 2019-04-27 18:43 Under Windows this problem don't arise. However I will avoid paths with spaces, undoubtedly a bad practice used by me. I was afraid that my software had some obscure dependence on the Windows platform. Thanks for help.