最近想学习iphone开发,但是由于没有c基础,只有java基础。所以先从基础学习,首先是搭建环境,目前手头没有mac机子,只能先在windows下学习基本语法。还好找到了GNUset,可以利用GNUstep在windows下模拟object c开发环境。
官方网址:http://www.gnustep.org/
安装:
GNUstep Windows Installer提供了Windows平台下的Objective-C的模拟开发环境,一共有四个软件包,其中GNUstep System 和GNUstep Core 是必装的,GNUstep Devel 和Cairo Backend 是选装的。甭管必装选装,一次性全安上,免得以后麻烦。
编写HelloWord
几乎所有的开发环境都是以HelloWord开始,在这里我们先编写HelloWord.
安装完成后,在开始菜单里的GNUstep选项里执行shell,就能打开命令行,在这里就可以使用vi编写Object-C程序了,不过操作起来总有些繁琐,其实也可以直接在Windows里进入C:/GNUstep/home/username目录,在这里用你喜欢的工具编写Object-C程序,然后再进入shell里编译。
直接给出helloworld.m文件内容,取自Programming in Objective-C 2.0一书:
#import <Foundation/Foundation.h>
int main (int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog(@"Hello World!");
[pool drain];
return 0;
}
第一次编译:
gcc -o helloworld helloworld.m
结果出现错误信息,找不到头文件:
helloworld.m:1:34: Foundation/Foundation.h: No such file or directory
helloworld.m: In function `main’:
helloworld.m:4: error: `NSAutoreleasePool’ undeclared (first use in this function)
helloworld.m:4: error: (Each undeclared identifier is reported only once
helloworld.m:4: error: for each function it appears in.)
helloworld.m:4: error: `pool’ undeclared (first use in this function)
helloworld.m:5: error: cannot find interface declaration for `NXConstantString’
第二次编译:
gcc -o helloworld helloworld.m /
-I /GNUstep/System/Library/Headers/
结果出现错误信息,找不到接口声明:
helloworld.m: In function `main’:
helloworld.m:5: error: cannot find interface declaration for `NXConstantString’
第三次编译:
gcc -o helloworld helloworld.m /
-fconstant-string-class=NSConstantString /
-I /GNUstep/System/Library/Headers/
结果出现错误信息,找不到链接库:
helloworld.m:(.text+0×33): undefined reference to `_objc_get_class’
helloworld.m:(.text+0×45): undefined reference to `_objc_msg_lookup’
helloworld.m:(.text+0×64): undefined reference to `_objc_msg_lookup’
helloworld.m:(.text+0×80): undefined reference to `_NSLog’
helloworld.m:(.text+0×93): undefined reference to `_objc_msg_lookup’
helloworld.m:(.text+0xbc): undefined reference to `___objc_exec_class’
helloworld.m:(.data+0×74): undefined reference to `___objc_class_name_NSAutoreleasePool’
helloworld.m:(.data+0×78): undefined reference to `___objc_class_name_NSConstantString’
collect2: ld returned 1 exit status
第四次编译:
gcc -o helloworld helloworld.m /
-fconstant-string-class=NSConstantString /
-I /GNUstep/System/Library/Headers/ /
-L /GNUstep/System/Library/Libraries/ /
-lobjc /
-lgnustep-base
注意:helloworld.m必须出现在-lobjc和-lgnustep-base的前面,否则会出错。
此时会出现一些info提示信息,不过不碍事,终于成功了生成了可执行文件,执行看结果。
./helloworld.exe
结果是:
注意,可以利用粘贴复制命令:Ctrl+p
相关推荐
windows下object-c环境搭建进阶
NULL 博文链接:https://hjy2099.iteye.com/blog/1562336
Windows下安装Objective-C开发环境
Windows下安装Object-C开发环境 用GNUstep在windows下模拟object c开发环境。 官方网址:http://www.gnustep.org/ 百度云下载: 链接:http://pan.baidu.com/s/1ntDqKLN 密码:muow
11 CO配置-控制-成本中心会计-定义分割结构(OKES-Define Splitting Structure)
业务背景:定义分割结构 事务码: OKES SPRO路径:SPRO->控制->成本中心会计->实际过账->期末结算->作业分配->划分->定义分割结构 第1步,SPRO路径进入 第2步,选择“新的条目”创建 分割结构 第3步,选择分割结构代码 点击“分割规则”进行下一个界面,点击“新条目”创建 分割结构规则 第4步,点击“为规则选择” 为分割结构规则创建版本并保存 第5步,选择“分配”,点击“新的条目” 输入分割结构分配
object c java_Windows环境下面搭建Object C开发环境
1、安装编译器Objective-C的编译器有很多,其中LLVM属于从GCC发展出来的,主要使用在苹果的平台中,GNU可以使用GnuStep,网址是http://wwwmain.gnustep.org/,从这里可以下载Windows版本的gcc编译器,配合codeblocks可以编译调试object c程序。 进入下载页面,下载上面3个软件包,安装,例如安装到D:\GNUstep,2、安装C...
Python爬虫实战:5分钟搞定微信公众号文章阅读数、点赞数抓取(附完整代码)
本文详细介绍了如何通过Python爬虫技术自动化抓取微信公众号文章的阅读数和点赞数。文章从数据源分析入手,分步讲解了获取文章列表与提取单篇统计数据的完整流程,并提供了应对平台风控的策略与工程化整合方案,帮助开发者高效、合规地完成数据采集任务。
手把手教你用SpringBoot+Vue3+Docker从零搭建一个在线OJ系统(附完整源码)
本文详细介绍了如何使用SpringBoot、Vue3和Docker从零搭建一个在线OJ系统,涵盖前后端开发、判题机实现及Docker容器化部署。通过完整的源码和实战步骤,帮助开发者掌握OJ系统的核心架构与关键技术,适用于算法训练、编程竞赛等场景。
Windows下搭建IOS开发环境(一)
https://blog.youkuaiyun.com/lizhenmingdirk/article/details/29850159
【计算机视觉40例】案例08:石头剪刀布手势识别
计算机视觉40例——从入门到深度学习(OpenCV-Python)》在介绍Python基础、OpenCV基础、计算机视觉理论基础、深度学习理论的基础上,介绍了计算机视觉领域内具有代表性的40个典型案例。这些案例中,既有传统的案例(数字识别、答题卡识别、物体计数、缺陷检测、手势识别、隐身术、以图搜图、车牌识别、图像加密、指纹识别等),也有深度学习案例(图像分类、风格迁移、姿势识别、实例分割等),还有人脸识别方面的案例(表情识别、驾驶员疲劳监测、识别性别与年龄等)。......
为什么Windows/iOS操作很流畅而Linux/Android却很卡顿呢
先说是不是,再问为什么。 我就知道有人会这么说,然而那样就成了一篇议论文了,而我只是想写一篇随笔。所以,不管事实是不是那样,反正我就是觉得Windows,MacOS,iOS都很流畅,而Linux,Android却很卡。当然了,这里说的是GUI,如果考量点换成是Web服务的吞吐和时延,那估计结论要反过来了,不过那是客户端程序感觉到的事,作为人,who care! 我写这篇文章还有一个意思,那就是想...
基于Arduino UNO的OLED显示器使用方法x2(Arduino系列五)
Arduino使用OLED显示模块可以实现串口数据显示,还可以与其他模块联合使用,实现实时显示开发板实时数据。
Unity零基础到入门 ☀️| 【UI系统学习】认识Unity引擎中几种最常用 UI系统,这一篇文章就够用了!
轻松学会 Unity 的 UGUI基础控件 使用 Unity中的UI介绍 UI即User Interface(用户界面)的简称。泛指用户的操作界面,UI设计主要指界面的样式,美观程度。而使用上,对软件的人机交互、操作逻辑、界面美观的整体设计则是同样重要的另一个门道。好的UI不仅是让软件变得有个性有品味,还要让软件的操作变得舒适、简单、自由,充分体现软件的定位和特点。 据我所知Unity中有两种自带的UI,一种是UGUI,一种是GUI Legacy GUI:旧版 UI,只有两个组件:文字和图片,配合鼠标事件来
Windows下安装Object C开发环境,及Hello Word(转)
Windows下安装Object C开发环境,及Hello Word 最近想学习iphone开发,但是由于没有c基础,只有java基础。所以先从基础学习,首先是搭建环境,目前手头没有mac机子,只能先在windows下学习基本语法。还好找到了GNUset,可以利用GNUstep在windows下模拟object c开发环境。 官方网址:http://www.gnustep.org/ ...
90. 将 SAP ABAP 内表内容本地导出成 Excel 文件
这里文件扩展名为 csv,全称是 Comma-Separated Values,意思是这种类型的文件内容,由逗号分隔。除了 ASC 之外,另一个可用的选项是 BIN,适用于 PDF,EXE 等二进制文件的导出。支持海量的输入和输出参数,我们这个简单的本地导出场景里,大部分参数都用不上。这个分隔符的添加逻辑,编写在上图红色高亮矩形框内,使用的语法是。本教程有学习者向我提问,询问如何将 ABAP 某某函数的某某输出参数的值,导出成本地 Excel 文件。把这个内表的内容,下载到本地,以本地文件的方式保存。
PostgreSQL idle in transaction:五个隐藏危害与治理方案
PostgreSQL 中的事务快照机制决定了开启但未提交的事务不能简单视为空闲,它会持续持有锁和快照,导致资源无法回收。idle in transaction 正是这种挂起状态的典型表现,它不占用 CPU 却可能引发锁等待、VACUUM 失效、表膨胀、连接池耗尽甚至主从切换异常等连锁故障。理解其原理后,可通过 idle_in_transaction_session_timeout 参数、连接池配置和代码规范进行治理,结合 pg_stat_activity 监控和定时巡检,能有效避免因事务挂起引发的数据库性能
ArtMate —— 美术公开课智能体开发全记录
本文档详细描述了一款专为中小学美术公开课设计的智能教学助手的开发过程。该智能体融合了多模态感知、自然语言交互、风格迁移与智能评价等技术,旨在辅助教师开展生动、高效的美术鉴赏与创作课程。全文包含需求分析、系统架构设计、核心模块代码实现、交互界面搭建及完整运行示例,并配有详尽的行内注释和设计思想阐述,为教育技术开发者提供一份可落地、可扩展的参考方案。
深度学习工具包 DeepLearningToolbox
深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[](https://bitdeli.com/free "Bitdeli Badge")
object-c 学习(第一天)经典 hello word!
最近项目不是太忙,无聊,就来学习下IOS开发,但不会oc就学习下。 首先要搭开发环境,屌丝买不起mac,只好在window下开发了: 下载软件 http://www.gnustep.org/experience/Windows.html 在这里下载前面三个,GNUstep MSYS System,GNUstep Core,GNUstep Devel,全部装好
lwip-2.0.3
lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。
VS Code 从菜鸟安装到编写第一个“Hello World!——(以C语言为例)
VS Code 从菜鸟安装到编写第一个“Hello World!——(以C语言为例)”如果有什么不正确的地方也欢迎指正批评,有好的想法或者其他的可以留言,大家一起学习交流,进步! 相信需要编程的小伙伴都是需要用到一定的编程环境,比如VIm,PyChram,VS-studio或者VS-Code等等的编程环境来帮助我们进行代码的编写和调试,这里以VS Code这款环境,介绍一下简单的入门行当! 1、第一步就是需要安装VS Code这款软件了,直接某度搜索“VS Code”即可 一般选择这个就可以了!跳转之后的
精雕软件(JDpaint) 5.5 绿色版
精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版
IEM模型,地表粗糙度模拟
利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟
在VsCode中搭建Go开发环境,手把手教你配置
前几天我聊了聊我自己从一个什么都不懂的小白,到现在只懂一点的学习历程 所谓万事开头难,学习Go语言最难的时候,也就是咱们啥都不知道的时候 之前我说了我学Go语言入门花了好几个晚上,这个时间不是花费在学习Go语言语法上,而是花在了搭建环境上…这篇文,我把我当初所有踩的坑都写到了 我自己的开发环境是Windows 10 +VS Code ,都知道VS Code是一个可以让开发者自己高度定制化的编译器...
2. 【C语言】工欲善其事:搭建 C 开发环境
上一篇文章我们聊了为什么要学 C 语言。今天,我们就不多废话,直接动手,把写 C 程序需要的家伙什儿准备好。目标很简单:让你的电脑上能编译并运行一个 C 程序。放心,这个过程不收费,也不需要很高的电脑配置。你只需要一台能正常开机的电脑,和一颗愿意折腾一小会儿的心。
搭建C语言开发环境,编写hello,world
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一、安装VC6.0(windows10) 二、编写代码-输出“hello,world!”功能 总结 前言 搭建C语言开发环境,编写hello,world! 一、安装VC6.0(windows10) 直接下一步,下一步,然后安装到C盘 二、编写代码-输出“hello,world!”功能 新建工程:Win32 Console Application 新建源文件:C++Source Fil
Visual Studio Code配置C语言环境,编写第一个Hello Wolrd
准备工具: 官网下载: 下载Visual Studio Code 下载MinGW-w64 - for 32 and 64 bit Windows,找到最新版本中的x86_64-posix-seh 下载LLVM Download Page,找到Pre-Built Binaries:选择下面的Windows (64-bit)(.sig) 网盘下载: 下载 Visual Stu...
Hello Word编写
Hello, World! 环境配备 java的安装 在百度搜索jdk进入官网安装(jdk包括了java的运行环境并且附带了开发者工具),如果遇到安装速度慢的问题,可以复制下载地址进入迅雷安装可以更快。安装时需要记住下载目录。 环境变量的配置 现在安装的jdk15会自行配置环境变量,以防万一,可以在系统变量Path中新建,输入JAVA_HOME,路径为安装时的下载目录。 安装完成后,打开命令窗口,输入代码 java -version 如果得到类似如图所示的信息,说明jdk环境配置完成 [外链图片转存失败,
4850



被折叠的 条评论
为什么被折叠?



