[Solved] Help with linking error lazarus / 1-Linux ---------------------------------------------------------------------- VTwin · 2014-01-09 13:54 Hello, I am trying to get working versions of several programs on Linux. These programs work well on both Mac and Windows Lazarus distributions. I am starting with Ubuntu 12.04 Desktop 64 bit, using the Lazarus amd64 distribution: fpc_2.6.2-0_amd64.deb fpc-src_2.6.2-0_amd64.deb lazarus_1.0.14-0_amd64.deb running on Mac OS 10.6.8 in a Parallels 7 virtual machine. I am able to compile and run the default Lazarus "hello" application, however when I attempt to compile one of my programs, I get the following errors: Code: [Select]Note: DWARF debug information cannot be used with smart linking on this target, switching to static linking /usr/bin/ld: unrecognised emulation mode: acosx_version_min Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om PicTracker.lpr(26,1) Error: Error while linking PicTracker.lpr(26,1) Fatal: There were 1 errors compiling module, stopping I am not sure what this means, or where to begin tracking down this error. Any assistance would be greatly appreciated. Cheers, Frederick ---------------------------------------------------------------------- BigChimp · 2014-01-09 13:59 My guess: in project options you probably set widgetset etc to an OSX widgetset like Cocoa or Carbon. Other options are target OS or processor. You can try adding a new build mode with gtk widgetset, or removing the explicit widgetset (etc) selection and choosing default. ---------------------------------------------------------------------- VTwin · 2014-01-09 14:19 Thanks BigChimp, In Compiler Options, if I click on the link "Select another LCL widget set (macro LCLWidgetType)". There is no explicit LCLWidgetType set. The Mac build uses the default Carbon, and Windows is also default. I just tried setting LCLWidgetType to gtk, and get the same error message. Also with gtk2. Cheers, Frederick ---------------------------------------------------------------------- BigChimp · 2014-01-09 15:13 Hmmm, no more spontaneous ideas. If the project is not confidential, you could publish the project (project/publish project) to a new directory so you only have source code files there, zip it up and add it to a post. Will be glad to have a look on Windows and perhaps a Linux VM for you. ---------------------------------------------------------------------- VTwin · 2014-01-09 16:12 Thanks BigChimp, That is a very kind offer! The code is not open source, but not especially confidential. I will try compiling a couple of the other projects and see if that gives me any leads. The "acosx_version_min" leads me to suspect a math library incompatibility, but that is just a hunch. I have working Mac and Windows versions, the Windows version I compile using Parallels 7 and a XP virtual machine. No problems there. I'll report back on any progress, hopefully today, and then may take you up on your offer. Many thanks! Cheers, Frederick ---------------------------------------------------------------------- VTwin · 2014-01-09 20:14 BigChimp, I found my error after a bit of poking around. I had set the compiler "Custom option" to include: -k-macosx_version_min -k10.5 -XR/Developer/SDKs/MacOSX10.5.sdk/ and also had the conditional macro: if TargetOS = 'darwin' then begin   UsageCustomOptions += ' -k-macosx_version_min -k10.5';   UsageCustomOptions += ' -XR/Developer/SDKs/MacOSX10.5.sdk/'; end;    The Windows compiler ignored both, but the Linux compiler tried to interpret the custom options, hence the mystery error: acosx_version_min, which I misinterpreted as a math library link problem.  Deleting those two lines from the custom options solved the problem. The program is compiling and running now, so I just need to tweak the code a bit now. Many thanks! Cheers, Frederick ---------------------------------------------------------------------- BigChimp · 2014-01-10 10:37 Well, I can understand why you were thanking maths Glad you got it sorted out! note:  (yes, Captain Obvious here) Code: [Select]if TargetOS = 'darwin' then begin   UsageCustomOptions += ' -k-macosx_version_min -k10.5';   UsageCustomOptions += ' -XR/Developer/SDKs/MacOSX10.5.sdk/'; end; should explicitly test for OSX so shouldn't be a factor. It's probably the recommended way to make sure your project remains cross platform.