PB 5.40b6 - Crash in SnowLeopard

Mac OSX specific forum
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

I tried to run my program on SnowLeopard, it crashed, something to do with Curl...
Process: ReportComplete Live [208]
Path: /Volumes/Untitled/ReportComplete Live.app/Contents/MacOS/ReportComplete Live
Identifier: ReportComplete Live
Version: ??? (???)
Code Type: X86 (Native)
Parent Process: launchd [99]

Date/Time: 2015-09-21 20:56:34.439 +0100
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 33655 sec
Crashes Since Last Report: 15
Per-App Crashes Since Last Report: 4
Anonymous UUID: 1476E861-42E2-40E7-8A4F-CAA449AC6AA9

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0

Dyld Error Message:
Library not loaded: /usr/lib/libcurl.4.dylib
Referenced from: /Volumes/Untitled/ReportComplete Live.app/Contents/MacOS/ReportComplete Live
Reason: Incompatible library version: ReportComplete Live requires version 7.0.0 or later, but libcurl.4.dylib provides version 6.0.0

Binary Images:
0x8fe00000 - 0x8fe4163b dyld 132.1 (???) <4CDE4F04-0DD6-224E-ACE5-3C06E169A801> /usr/lib/dyld

Model: MacPro3,1, BootROM MP31.006C.B05, 8 processors, Quad-Core Intel Xeon, 2.8 GHz, 8 GB, SMC 1.25f4
Graphics: AMD Radeon HD 6870, AMD Radeon HD 6870, PCIe, 1024 MB
Memory Module: global_name
Bluetooth: Version 2.4.5f3, 2 service, 19 devices, 1 incoming serial ports
Network Service: Ethernet 2, Ethernet, en1
PCI Card: AMD Radeon HD 6870, sppci_displaycontroller, Slot-1
PCI Card: AMD Radeon HD 6870, ATY,DuckweedParent, Slot-1
Serial ATA Device: SAMSUNG HD103UJ, 931.51 GB
Serial ATA Device: ST2000DX001-1CM164, 1.82 TB
Serial ATA Device: ST750LX003-1AC154, 698.64 GB
Parallel ATA Device: OPTIARC DVD RW AD-7170A
Parallel ATA Device: HL-DT-STDVD-RAM GSA-H55L
USB Device: Cruzer Fit, 0x0781 (SanDisk Corporation), 0x5571, 0xfd100000 / 2
USB Device: Keyboard Hub, 0x05ac (Apple Inc.), 0x1006, 0xfd500000 / 5
USB Device: USB Optical Mouse, 0x046d (Logitech Inc.), 0xc05f, 0xfd530000 / 11
USB Device: Apple Keyboard, 0x05ac (Apple Inc.), 0x0250, 0xfd520000 / 10
USB Device: Hub, 0x2833, 0x2021, 0xfd400000 / 4
USB Device: Rift DK2, 0x2833, 0x0021, 0xfd410000 / 9
USB Device: USB 2.0 Hub, 0x1a40 (TERMINUS TECHNOLOGY INC.), 0x0101, 0xfd300000 / 3
USB Device: Camera DK2, 0x2833, 0x0201, 0xfd340000 / 8
USB Device: HD Pro Webcam C920, 0x046d (Logitech Inc.), 0x082d, 0xfd320000 / 7
USB Device: SII Smart Label Printer 450, 0x0619 (Seiko Instruments Inc.), 0x0502, 0xfd330000 / 6
USB Device: Bluetooth USB Host Controller, 0x05ac (Apple Inc.), 0x8206, 0x5d200000 / 2
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

I should add that I have this in my code:

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    ImportC "/usr/lib/libcurl.so"
  CompilerCase #PB_OS_Windows
    ImportC "libcurl.lib"
  CompilerCase #PB_OS_MacOS
    ImportC "/usr/lib/libcurl.dylib"
CompilerEndSelect    
Is this the correct way to extend the built-in curl with PB?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

If I include this instead then it works fine in SnowLeopard, but is this the correct way to do it?

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_Linux
    ImportC "/usr/lib/libcurl.so"
  CompilerCase #PB_OS_Windows
    ImportC "libcurl.lib"
  CompilerCase #PB_OS_MacOS
    If OSVersion()<=#PB_OS_MacOSX_10_7 ; <= lion
	    ImportC "libcurl.4.dylib"
	  Else
	    ImportC "/usr/lib/libcurl.dylib"
	  EndIf
CompilerEndSelect  
I have libcurl.4.dylib copied from snow leopard in the source directory, I compile on OS X 10.10.5

Should I be using a different method to use the extra missing functions from Curl (that are not yet built-into the PureBasic command set) using the built-in lib version?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

Ahh, this works for everything:

Code: Select all

ImportC "-lcurl"
Please delete this thread - no bug!

It might be useful though to put this in the help file on how to extend Curl (if you are sticking with Curl that is).
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

Hmm. I just tested again with it compiling on 10.10.5 and running on Snow Leopard, I get this error:
Dyld Error Message:
Library not loaded: /usr/lib/libcurl.4.dylib
Referenced from: /Volumes/Untitled/ReportComplete Live.app/Contents/MacOS/ReportComplete Live
Reason: Incompatible library version: ReportComplete Live requires version 7.0.0 or later, but libcurl.4.dylib provides version 6.0.0
How do I force it to use the static curl lib built into the executable rather than using the dylib ? Does ImportC "-lcurl" not do this?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Fred
Administrator
Administrator
Posts: 16687
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by Fred »

you can try "-lpbcurl" so you use our own lib. The easiest is to just use on command of the Http lib and it will link it automatically. Then leave the ImportC "" empty and import your functions, it will work on all OS.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PB 5.40b6 - Crash in SnowLeopard

Post by DoubleDutch »

Thanks, I'll try it tonight.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply