Darwin

Avoid linking in unused symbols when linking against static libs

为君一笑 提交于 2019-12-04 04:33:51
问题 I'm using the apple gcc to compile a dylib that I'm going to redistribute. For various reasons I'm using some libraries, let's say libz to keep it simple. Since this library is not typically found on a Mac system I wish to static link in used symbols into the dylib by passing the path to the .a-file to simplify deployment. Now, the linker links in all symbols from the lib into the resulting dylib although I only reference a subset. On linux I've never encountered this problem, the linker

Flutter 开发入门

拥有回忆 提交于 2019-12-04 03:58:03
编者注 由于决定采用FLutter作为未来一段时间的跨平台开发平台。则需要进行测试。顺便写一个简单的gitee的通讯录。如果后续有时间。则写一个更加完善的项目管理软件。 Flutter IDEA使用Flutter Mac版本的IDEA,找到Prefermences->pulgin,下载Flutter的支持。这里会提示,是否要安装Dart。选择是。下载后重启IDEA。 下载SDK 当使用IDEA在创建项目的过程,会被下载Flutter的SDK。则下载到指定目录。这里个人习惯是下载的build文件内。 当下载完毕后,碰到IDEA提示如下信息 The Flutter SDK installation is incomplete; please see: https://flutter.io/docs/get-started/install. 这里建议访问中国文档站,速度会快很多 起步:安装Flutter 环境配置 首先,需要到执行flutter的更新 ./~/build/flutter/bin/flutter doctor 这个时候,能够感受到中国和国际网络连接的深深恶意。 ./flutter doctor Downloading Dart SDK from Flutter engine 9e6314d348f9b5521e3c66856324d7a9c4a928c9... %

What is the deal with undefined symbols in a shared library or dylib?

独自空忆成欢 提交于 2019-12-04 02:59:30
问题 I have a Makefile for linux that I am porting over to Darwin. The makefile takes a bunch of .o files and links them together into a .so shared object. Okay, so I figured (am I wrong about this?) that the best analog for this in Darwin is the dylib. So I changed the -shared flag to -dynamiclib. Now the code that I am linking together into the dylib depends on lots of external libraries. When I try to build the dylib, I get errors saying there are undefined references. But the Linux Makefile

Is there an equivalent of lsusb for OS X

淺唱寂寞╮ 提交于 2019-12-02 14:25:40
This question seems to be all over google, but the answers all point to using System Profiler. That's nice, but with System Profiler all you get is something that looks like this: DasKeyboard: Product ID: 0x1919 Vendor ID: 0x04d9 (Holtek Semiconductor, Inc.) Version: 1.06 Speed: Up to 1.5 Mb/sec Location ID: 0x1d114000 / 11 Current Available (mA): 500 Current Required (mA): 100 USB2.0 Hub: Product ID: 0x0608 Vendor ID: 0x05e3 (Genesys Logic, Inc.) Version: 32.98 Speed: Up to 480 Mb/sec Location ID: 0x1d113000 / 10 Current Available (mA): 500 Current Required (mA): 100 Microsoft Basic Optical

How to allocate -> send -> receive -> cast -> deallocate UnsafeRawPointer from extension to app?

▼魔方 西西 提交于 2019-12-02 11:01:15
问题 I am new in UnsafeRawPointer . As I got I need to allocate unsafe memory in my extension and send pointer to my app where has to cast and release it. Below is a sketch of what I want to do. I'd like to send a string message from Safari extension and receive it in app by CFNotificationCenterGetDarwinNotifyCenter , how to do it? let center = CFNotificationCenterGetDarwinNotifyCenter() CFNotificationCenterAddObserver(center, nil, { (_, observer, name, message, _) -> Void in //message as String??

exsl:date-year in OS X

前提是你 提交于 2019-12-02 07:44:07
问题 As mentioned in this question, I am trying to transform my input xml document using Perl and libXSLT. However, when I try to run the same Perl script on OS X with little addition of following in my xsl file under the <xsl:variable name="current-year"> <xsl:value-of select="date:year()"/> </xsl:variable> I get following error. xmlXPathCompOpEval: function year not found Unregistered function xmlXPathCompiledEval: evaluation failed runtime error: file trans.xsl line 24 element value-of XPath

exsl:date-year in OS X

久未见 提交于 2019-12-02 07:33:09
As mentioned in this question , I am trying to transform my input xml document using Perl and libXSLT. However, when I try to run the same Perl script on OS X with little addition of following in my xsl file under the <xsl:variable name="current-year"> <xsl:value-of select="date:year()"/> </xsl:variable> I get following error. xmlXPathCompOpEval: function year not found Unregistered function xmlXPathCompiledEval: evaluation failed runtime error: file trans.xsl line 24 element value-of XPath evaluation returned no result. My XSLT file header has following <?xml version="1.0"?> <xsl:stylesheet

Avoid linking in unused symbols when linking against static libs

做~自己de王妃 提交于 2019-12-01 21:37:13
I'm using the apple gcc to compile a dylib that I'm going to redistribute. For various reasons I'm using some libraries, let's say libz to keep it simple. Since this library is not typically found on a Mac system I wish to static link in used symbols into the dylib by passing the path to the .a-file to simplify deployment. Now, the linker links in all symbols from the lib into the resulting dylib although I only reference a subset. On linux I've never encountered this problem, the linker happily discards all unreferenced symbols and creates a very slim executable, so it should be possible .

mac上安装python3的cx_Oracle数据库驱动

不羁岁月 提交于 2019-12-01 15:21:52
问题 使用Python3 for mac上面的cx_Oracle数据库驱动 步骤 下载Oracle的Instant Client 程序包 Instant Client 下载适用于 Mac OS X (Intel x86) 这里版本的选择,应该根据你访问的oracle库的版本来选择。 配置环境变量 ORACLE_HOME=/usr/local/oracle/instantclient_11_2 LD_LIBRARY_PATH=$ORACLE_HOME VERSION=11.2.0.3.0 ARCH=x86_64 DYLD_LIBRARY_PATH=/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/clidriver/lib:$ORACLE_HOME export ORACLE_HOME export LD_LIBRARY_PATH export VERSION export ARCH export DYLD_LIBRARY_PATH **Note:**这里的DYLD_LIBRARY_PATH需要留意,如果这里配置失误,会导致Python找不到相关库,如下错误: >>> import cx_Oracle Traceback (most recent call last): File

What is the deal with undefined symbols in a shared library or dylib?

非 Y 不嫁゛ 提交于 2019-12-01 14:59:43
I have a Makefile for linux that I am porting over to Darwin. The makefile takes a bunch of .o files and links them together into a .so shared object. Okay, so I figured (am I wrong about this?) that the best analog for this in Darwin is the dylib. So I changed the -shared flag to -dynamiclib. Now the code that I am linking together into the dylib depends on lots of external libraries. When I try to build the dylib, I get errors saying there are undefined references. But the Linux Makefile does not specify any of the -lwhatever or -L/path/whatever options in the build step that creates the .so