I am using Xcode to learn C. I made a project named Learn C, and I would like this to contain many exercises, like ex11.c, ex12.c, etc. However, this does not work, because all my exercises need the main function, but only main.c can have it.
In Eclipse, I would be able to make a workspace named Learn C, and have many .java files in it, like ex11.java, ex12.java, etc, to keep myself organized.
Does anyone know how I can recreate this in Xcode?
Thanks!
You can do this in Xcode as well. For each exercise, you need to create a new target. To do that, open your Xcode project, click on the Project Navigator tab, and select the project. Then, from the "Editor" menu, select "Add Target". If you're working with examples from a book or web page that isn't Mac-specific (or iOS-specific), you'll want to select "Command Line Tool" as the type of target. Xcode will create the new target and you can add your new ex*.c file to it.
Start by creating a workspace:
Open Xcode.
Pull down the File menu and select New Workspace...
You will be prompted for the name of the workspace and optionally a target folder to create it in. Select New Folder in the lower right corner and create a folder called Learn C. Then, select Save. A new workspace will be created in your new folder.
Once you have that you can create new projects within the new workspace. To do this...
Right-clck anywhere in the workspace explorer on the left-side pane of Xcode and select New Project....
Select OS X Application from the left pane, then (if this is just C code) Command Line Tool from the right pane. Then select Next.
Enter the name of your product (in your case, Ex1 would be your likely first product). Select the appropriate language, in your case C.
On the next wizard pane, when prompted for the location of the new product, the default settings should be sufficient, but in case they're not set correctly, make sure both Add To: and Group: have the Learn C workspace selected. Press Create.
To select which project you're building at any given time, select the active "scheme" by navigating the Product/Scheme menu and clicking on the project you want to build, or select the scheme using the button bar (its the bottom immediately to the right of the "Stop" button in the upper-left of the bar).
This should create a new project in the Learn C workspace. You can repeat the project-creation steps above (not the workspace creation; you already have one of those) for as many projects as you want, so long as their names are unique. Once you get the hang of this, you will be able to share code between projects using the advanced capabilities of the workspace and project management features, but for now this should be enough to get you going.
More information can be found on the Apple Xcode Developer Website (assuming you've shelled out your $99 annual developer fee). There is a wealth of info on Xcode, and though it (imho) isn't as snazzy as the likes of Visual Studio on Windows, it becomes natural after some time (like all things). The section titled Maintain Your Code and Other Resources in Projects or Workspaces will probably lead you further down the path you're interested in pursuing.
Best of luck.
Related
I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common Properties\Project Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
I created a flow from the process builder , and I want to sync it locally.
When I looked at the project from mavensmate , I couldn't find the file which is named .flow
This is my first question in stackoverflow , I'm sorry about my poor english , hope you can understand what I described . who could give me some suggestions?
Thanks!
First, you need to update your local SF project metadata. For that, in SublimeText, go to MavensMate menu -> Project -> Edit Project. It should open the project metadata tab in your browser. Click the "Refresh" button and then choose the flow that you need in your project tree. Click "Update project". After that you should be able to find the flow in your project folder.
Go into Mavensmate's settings.
Add ".flow" to the list of extensions under "SALESFORCE FILE EXTENSIONS (MM_APEX_FILE_EXTENSIONS)" if it isn't there already.
You might want to update "SALESFORCE API VERSION (MM_API_VERSION)" to the latest as well.
If your still having problems with that, you might want to check the Flow names including the version numbers. In my case, Mavensmate shows Versions 1, 2, 3, and has no number after the current (active) version. The file on my hard drive is labelled as version 4, so the names don't match up.
To fix this, you'll want to deactivate the processes and update your project.
We are trying to work on a Codename One project using git version control.
When I pull the project from git, the files (modified and newly added theme res files) are updated but they don't appear in the theme.
My changes aren't reflected when I try to run the project, how to refresh the project?
I tried to build/clean, refresh the cn1lib too but made no progress.
Thankyou shai, i uncheck the xml team mode but that doesnt make any difference.. you gave the link (https://www.codenameone.com/team.html), what is this for?? sorry i didn't quite get it.
And the solution isnt that clear. what do you mean by checking the res directory...
Let me clear my problem here.. when my team member adds a form (eg main form) in the gui builder, it get pulled from git in my project. there r 2 files main.ui and main file but when i open my res file or gui builder, the main form is not there.
This is actually triggered by a feature specifically designed for working with a team in version controlled environments. You can get this to work by unchecking File->XML Team Mode in the designer but that would "work around" this feature: http://www.codenameone.com/blog/teamwork-and-other-things.html
The solution would be to checkin the res directory, when it exists opening the res file refers to that instead of to the theme file. This allows your team to edit that directory together and avoid conflicts that will arise when sharing the binary res file.
I manage a team of designers working on Indesign.
When we work on a project, it often happens that a designer has to work on the project of another. We work with Dropbox for Business.
But when we take the work of another designer, there is often missing links and fonts.
Is there a plugin or a way to develop a plugin that would allow, when we create a new indd file (or for the protection of the same file):
Automatically create a "Links" folder and another "Document fonts" at side of the indd file
Systematically add a new link or new typography in the corresponding folder?
To simplify: each action on font or on a link, make a kind of "Indesign Package" in real time?
If this is not a solution, do you have any solutions to meet this need?
I don't know of a specific script or plugin that does this.
However, it should be possible to write a script with an eventhandler with a beforeClose event that runs certain script commands every time a user closes a document (or even every time a user adds, changes or deletes a link). At this point the script could run some copyLink commands on all the images and fonts (?) placing them all in the folders next to the document.
The whole script could be made a startup script, so it becomes active anytime any user runs InDesign.
(I'm actually not sure, if fonts can be copied so easily. Worst case scenario would be that the script would need to run some packaging command to gather the fonts somewhere, copy them over to where you need them and then delete the rest of the temporary package.)
Did you consider Creative Cloud Libraries ? They are meant to allow sharing assets within a team. Apart form that, you users would need to have a same access to the file system (a common drive letter for the network path for example).
Another solution would be to use a DAM solution so users would link files from the DAM.
Eventually, you could sure think of a script as mdomino offered.
It is possible to export settings from one project and import them in another.
However, it seems that only "include Paths" and "Symbols" can be moved to a new project this way.
Is there any reliable way to copy all settings? Particularly I would like to copy the linker settings for my embedded ARM project.
I do not want copy the settings manually, as this is something that will have to be done often by at bunch of people.
The easiest way I've discovered to duplicate the settings for a project is to use another workspace. It takes a few steps to set up but you should only need to do it once.
1. Start a 2nd copy of eclipse and select or create a new workspace.
2. Import your baseline code.
3. Rename the project to something generic like NewProject
4. If your project has files you don't want to be imported into new projects delete them. I find it helpful to keep a few (like main.cpp)
Now back to your original workspace.
1. File->Import->Existing Projects into Workspace Next button
2. Use Browse... to go to your newly created workspace and select NewProject.
3. Check the Copy projects into workspace checkbox.
4. If you have warnings about the project already existing try clicking the Refresh button and make sure you don't have a folder in the current workspace with the same name. [ You can delete a project but not remove it from the hard disk so you have to make sure the intended folder name is not in use. ]
5. Rename the project to your desired name.
6. Start coding...
All the toolchain settings, include paths and library paths should be intact. It seems like a lot of work, but once you do it once its not too bad (as long as you can keep duplicating that one project).
This can be done in simple steps. Useful if you do not want to create new workspaces.
Open the project in the workspace.
Click on project and copy.
On the project tab area, paste the project.
Eclipse asks for a name, rename it to a new project.
Click Ok.