随笔分类 -  ios

上一页 1 2 3
Vector:no such file or directory解决
摘要:如果想在ios代码如果想使用stl的vector,在头文件里包含vector如#import <vector> 编译报错为Vector:no such file or directory,我想其他的stl头文件也一样解决方法就是在 XCode 中选中项目所有源文件,右键选 get info 菜单,把头文件的 file type 全部改成 soucecode.cpp.h,实现文件的 file type 全部改成 soucecode.cpp.objcpp。 另一种方法是选择项目-》Targets-》Build Settings-》LLVM GCC4.2-Language-》Compil 阅读全文
posted @ 2012-09-06 13:22 袁晓平 阅读(2603) 评论(0) 推荐(0)
NSString 中包含中文字符时转换为NSURL
摘要:NSString中如果包括中文字符的话转换为NSURL得到的值为nil,在网上搜了下,用stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding可以解决,代码如下:NSString *str = [NSString stringWithUTF8String:surl.c_str()]; str = @"http://218.21.213.10/MobileOA/TIFF/鄂安办发45号关于下达2012年全市安全生产相对控制指标的通知1.jpg"; str = [str stringByAddingPerce 阅读全文
posted @ 2012-09-06 13:10 袁晓平 阅读(1578) 评论(0) 推荐(0)
boost::asio::streambuf相关的操作方法
摘要:boost::asio::streambuf的定义如下:namespace boost {namespace asio {/// Typedef for the typical usage of basic_streambuf.typedef basic_streambuf<> streambuf;} // namespace asio} // namespace boost basic_streambuf继承于std::streambuf,如下: class basic_streambuf : public std::streambuf, private noncopyable 阅读全文
posted @ 2012-08-26 16:00 袁晓平 阅读(3200) 评论(0) 推荐(0)
应用boost库serialize标准库里的map
摘要:需求,最近做ios程序,需要将用户密码和帐号保存到本地磁盘,而用用户不止一个,想到boost库里的serialization比较适合,用户就用标准库里的map来保存,也就是std::map<std::string, std::string>,代码如下:UserInfo.h://// UserInfo.h// app1//// Created by xp y on 12-8-23.// Copyright (c) 2012年 xp y. All rights reserved.//#ifndef __app1__UserInfo__#define __app1__UserInfo__ 阅读全文
posted @ 2012-08-23 21:45 袁晓平 阅读(1693) 评论(0) 推荐(0)
将asihttprequest编译后的目标文件打包
摘要:cd /Users/test/Library/Developer/Xcode/DerivedData/iPhone-acjjpwfwhnpvlcdpfanyrczgtnkr/Build/Intermediates/iPhone.build/Debug-iphoneos/iPhone.build/Objects-normal/armv7/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar -r -v ./ASIHttpRequest.a ./ASIAuthenticationDialog.o ./ASIDataCompressor 阅读全文
posted @ 2012-08-16 23:04 袁晓平 阅读(274) 评论(0) 推荐(0)
mpc-0.9编译方法
摘要:解压源代码至mpc-0.9mkdir mpc-0.9-outcd mpc-0.9-out../mpc-0.9/configure --prefix=/home/musictom/mpc-0.9-install --with-gmp=/home/musictom/gmp-5.0.5-install --with-mpfr=/home/musictom/mpfr-3.1.0-installmakemake install如果要让库在arm机器上能运行,要加上--host=arm-eabi选项 阅读全文
posted @ 2012-07-14 21:19 袁晓平 阅读(261) 评论(0) 推荐(0)
mpfr-3.1.0编译方法
摘要:解压源代码至mpfr-3.1.0mkdir mpfr-3.1.0-out../mpfr-3.1.0/configure --prefix=/home/musictom/mpfr-3.1.0-install --with-gmp=/home/musictom/gmp-5.0.5-installmakemake install 阅读全文
posted @ 2012-07-14 21:07 袁晓平 阅读(346) 评论(0) 推荐(0)
gmp-5.0.5编译
摘要:1、解压源代码至gmp-5.0.52、mkdir gmp-5.0.5-out3、cd gmp-5.0.5-outCPPFLAGS=-fexceptions ../gmp-5.0.5/configure--enable-cxx --prefix=/usr/localmakemake installmake check 阅读全文
posted @ 2012-07-14 20:55 袁晓平 阅读(431) 评论(0) 推荐(0)
binutils-2.22编译心得
摘要:最近想自己编译出arm的gcc,其中必须的一步是必须编译binutils,所以尝试了一下,步骤如下:1、安装cygwin,选择gcc及libiconv库,安装,不要用mingw的编译器编译,我查了下,好象mingw里是没有fcntl.h的,所以编时会报错的,可以用gcc -v查看编译器的信息2、解压binutils-2.223、mkdir binutils-2.22-arm-unknown-eabi-outcd binutils-2.22-arm-unknown-eabi-out../binutils-2.22/configure --prefix=/home/musictom/binutil 阅读全文
posted @ 2012-07-14 18:18 袁晓平 阅读(1391) 评论(0) 推荐(0)
poco之HttpRequest之post方法
摘要:#import <iostream>#import <Poco/Net/HTTPClientSession.h>#import <Poco/Net/HttpRequest.h>#import <Poco/Net/HttpResponse.h>#import <Poco/URI.h>#import <Poco/Net/HTTPCredentials.h>#import <Poco/StreamCopier.h>#import <Poco/Net/HTMLForm.h>#import <Poco/ 阅读全文
posted @ 2012-06-10 15:40 袁晓平 阅读(5311) 评论(0) 推荐(0)
poco之HttpRequest之get方法
摘要:Poco::Net::HTTPClientSession s("www.cnblogs.com"); 需要引用的头文件是:#import <Poco/Net/HTTPClientSession.h>#import <Poco/Net/HttpRequest.h>#import <Poco/Net/HttpResponse.h>#import <Poco/StreamCopier.h>#import <Poco/Net/HTMLForm.h>#import <Poco/BinaryReader.h>#im 阅读全文
posted @ 2012-06-08 17:00 袁晓平 阅读(2113) 评论(0) 推荐(0)
为iphone及iphone simulator编译qt库
摘要:获取qt库,打开terminal,键入cd /Users/test/Downloads回车,git clone git://gitorious.org/+qt-iphone/qt/qt-iphone-clone.git 等待片刻,在当前目录会有一个目录qt-iphone-clone,进入目录,打开ios.txt,里面模拟器及真机的编译方法按照方法,键入./configure -xplatform iphonesimulator-g++42 -platform macx-ios-g++42 -opensource -ios -no-accessibility -no-qt3support -no 阅读全文
posted @ 2012-06-01 13:43 袁晓平 阅读(748) 评论(0) 推荐(0)
为iphone及iphone simulator编译poco库
摘要:./configure --config=iPhone --prefix=/libs/pocos --static --notests --nosamples#./configure --config=iPhoneSimulator --prefix=/libs/pocos --static --notests --nosamples 由于系统升级到了mac os x 10.7.4,xcode目录也变到了/Applications/Xcode.app,所以要编译iphone版的就要做些修改,找到build/config/iPhone文件打开编辑,修改如下:IPHONE_SDK_VERSION 阅读全文
posted @ 2012-05-30 14:02 袁晓平 阅读(368) 评论(0) 推荐(0)
为iphone 及iphone simulator编译boost库
摘要:1 下载boost,解压到/Users/test/Downloads/boost_1_49_02 cd /Users/test/Downloads/boost_1_49_03 打开terminal控制台,键入su然后输入管理员密码,再键入vi ./build.bat4 在控制台里录入以下内容:#! /bin/sh#PREFIX=/libs#echo ${PREFIX}#ls /usr/localecho 'now start install boost.build'#cd tools/build/v2/#chmod +x ./bootstrap.sh#./bootstrap.s 阅读全文
posted @ 2012-05-25 22:16 袁晓平 阅读(1193) 评论(0) 推荐(0)
mac os下通过命令行的方式编译c++代码并在xcode里引用
摘要:1编写c++类:c.h #include <stdio.h>class AA {public:void Go();};c.mm#include "c.h"AA::Go() {printf("AA::Go");}2编译刚刚写的类,分两 种运行环境,一种是在模拟器下运行,编译的目标代码架构为i386,一种是在真实iphone ipad里运行,目标代码架构为armv7,我们先编译可以在模拟器里运行的,要用模拟器的gcc编译器,打开命令行,键入命令:cd /program/code/ /Developer/platforms/iPhoneSimula 阅读全文
posted @ 2012-05-22 13:18 袁晓平 阅读(2369) 评论(0) 推荐(0)

上一页 1 2 3