Bug 16803 - Objective-C library binding causes linking error of libstdc++
Summary: Objective-C library binding causes linking error of libstdc++
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.5.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-14 23:04 UTC by kochizufan
Modified: 2014-01-06 07:33 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Build Log (146.42 KB, text/plain)
2013-12-14 23:05 UTC, kochizufan
Details
SpatialiteTest.tgz (77 bytes, text/plain)
2013-12-15 00:08 UTC, kochizufan
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description kochizufan 2013-12-14 23:04:09 UTC
In binding Objective-C library, there are linking libstdc++ error in building process, even if compiling with -lstdc++.

Build log and project which cause error is attached.
They are tar zipped, build log's filename is Binding_Error.txt

Environment is,

Xamarin Studio:
Version 4.2.2 (build 2)

Runtime:
Mono 3.2.5 ((no/964e8f0)
GTK+ 2.24.20 theme: Raleigh
GTK# (2.12.0.0)
Package version: 302050000

Xcode:
Xcode 5.0

Xamarin.iOS:
Version: 7.0.5.2

Xamarin.Android:
Version: 4.10.2

Java:
1.6.0_29

OS:
Mac OS X 10.8.5
Comment 1 kochizufan 2013-12-14 23:05:53 UTC
Created attachment 5662 [details]
Build Log
Comment 2 kochizufan 2013-12-15 00:06:43 UTC
Error causing project is too big to attach, so I put it on external drive.

See

https://drive.google.com/file/d/0B0CI3NpXmz1cZ2VxdEs0VXo2Uzg/edit?usp=sharing

Filename: SpatialiteTest.tgz
Comment 3 kochizufan 2013-12-15 00:08:10 UTC
Created attachment 5663 [details]
SpatialiteTest.tgz

Project file
Comment 4 Rolf Bjarne Kvinge [MSFT] 2013-12-16 09:21:13 UTC
How did you build the native library? Or did you download it from somewhere?
Comment 5 kochizufan 2013-12-16 09:35:59 UTC
I make a dependency tree of SpatialDBKit (https://github.com/andreacremaschi/SpatialDBKit) by Cocoapod, and take a compiled binary from Xcode's derived data folder.

The binary works well if I put it in Xcode's project, so I think this binary is valid..
Is there any problems in the binary?
Comment 6 Rolf Bjarne Kvinge [MSFT] 2013-12-20 04:52:57 UTC
I did the following:

* Created a new Empty Application in Xcode 5.
* Added a Podfile:
    platform :ios, '5.0'
    pod 'SpatialDBKit'
* Ran: 'pod install'
* Closed Xcode.
* Reopened myproject.xcworkspace in Xcode (as indicated by 'pod install').
* Built.

First I got a few compiler errors complaining about isnan, when those were fixed I got a lot of linker errors identical to the ones in the Xamarin.iOS project: https://gist.github.com/rolfbjarne/1745bc4f16bb34bb3033

Could you give exact instructions on how to create an Xcode project that builds?
Comment 7 kochizufan 2013-12-21 02:56:26 UTC
Sorry for my poorness of English, I can't understand your pointing out, so please allow me to ask:

https://gist.github.com/rolfbjarne/1745bc4f16bb34bb3033

This errors shown in Xcode? or Xamarin?

If shown in Xamarin, it is my reported issue itself.

If shown in Xcode, such condition is not occured in my environment, so I try it again and tell you the way.
Comment 8 Rolf Bjarne Kvinge [MSFT] 2013-12-23 21:00:33 UTC
Yes, that error is in Xcode.
Comment 9 kochizufan 2013-12-24 11:41:59 UTC
I reconstructed Xcode project again, and confirmed these error.

I tried to resolve them, and after changing some settings, they were solved.

1: Changing Podfile's SDK version from 5.0 to 7.0.
====
platform :ios, '7.0'
pod 'SpatialDBKit'
====

2: All of targets' (Not only Application but also Pods, Pods-sqlite3, Pods-geos, .... and so on)
"Apple LLVM 5.0 - Language - C++ / C++ Standard Library" setting change to 
"Compiler Default".

3: All of targets' (same above, application, Pods, Pods-xxxx...) Architectures 
change from "armv7, armv7s, arm64" to "armv7, armv7s".

After doing them, all errors vanished both simulator and device builds.
Comment 10 kochizufan 2013-12-24 11:45:03 UTC
These changes contain not only application settings but also libraries',
so may errors in Xamarin are also same cause.
I'll try to check it.
Comment 11 kochizufan 2013-12-24 22:23:17 UTC
I checked and binding compile passed.
Sorry, this issue maybe libraries compile error.

I might have mistaken in checking library to work in Xcode..
Comment 12 Rolf Bjarne Kvinge [MSFT] 2014-01-06 07:33:34 UTC
I'm closing this bug then.

If it happens again in the future, just reopen the bug.