C++ - New SFML project with the same settings - c++

I set up a new project and configured it to use SFML as instructed here:
http://www.sfml-dev.org/tutorials/2.1/start-vc.php
I'm going to be developing a chess game, but before that, I will probably create several projects to experiment with SFML and I wondered whether it's possible to copy the solution settings (like the dependencies) to a new project instead of manually configuring SFML every time I create a new project/solution. Is it possible, and if so, how would I go about doing so?
I've already tried going to File -> New -> Project From Existing Code but that apparently didn't work as the dependencies weren't there in the new project.
I'd appreciate help with this.

1- Create your base project with all the settings
2- File (in upper left)
3- Export Template
4- Follow the instructions
5- When you make your project, select "template" instead of the other options
6- Tada!

Related

Xcode & C/C++ project

I want to use Xcode for C/C++ project.
I don't care about build/compilation, all i want is to use it as editor.
Needs:
- Find symobol , References , callers etc
I've opened a console project, i can search for a symbol in the same file but nothing else. (for example, right click + jump to definition gives me a question mark ('?').
Any pointer to what needs to be done ?
Thanks,
Shaul.
From my experience, XCode is not designed to work well with C++. For example, you'll find that simple refactoring, such as renaming a function and automatically renaming usages, doesn't work well with XCode. I find AppCode works a lot better for (Obj)C++ development. Worth a look.
Thare are two approches
You need to create a library of your c++ project and add that library in your project
Add C++ project in your xcode and make it build as target source
let me now if you need a walkthrough
Ok, I found the solution.
When adding files to the Xcode project, on the bottom , need to click 'Options' and then choose 'Create groups' instead 'Create folder references'
This options will add all the sources and headers to 'Compile sources' and 'Headers' (Under 'Build Phases')

How do i use a bunch of .h and .cpp files to create a static library that can be used in another c++ Project

I am trying to learn C++ from some Stanford Course and they have a custom library which contains a bunch of header files(.h) and their associated source (.cpp) files.
I want to create new C++ projects in xcode 6.x to try out code and include those custom header files in my new projects.
I have no freaking idea how to include those files in my project so that i can peacefully #include "blahblahblah.h" and use functions from that header file without issues.
I am new to both xcode, c++(although i know some coding part) and anything else with this process.
Summary:
I have a folder Library which contains a series of .h and .cpp
files.
I have XCode 6.x.x/Eclipse installed.
I want to create a new C++ project and use #include
"OneOfThoseHeaderFiles.h" and then use a function or something from
those header files.
Also assume i have no clue how to run some command line codes that i see a lot of.
If someone can please tell me in the most simple way(preferably step-by-step) i would be so eternally grateful and sing praises to you until the day i die :)
Note: Either XCode or Eclipse is fine. I really just want to start coding.
I have spent the better part of a whole week trying out xcode, eclipse etc and trying to follow a ton of steps to get it working but i just cant get how to add the files without issues. Either the info seems to be for Xcode 4.x and every menu seems changed or the suggestions are so complicated that a novice like me cant figure it out.
First off, almost all the information for Xcode will be available on the Apple Developer's portal:
https://developer.apple.com/library/prerelease/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/start_project.html#//apple_ref/doc/uid/TP40010215-CH2-SW5
To create a simple static library on Xcode 6 you start by creating a new project, then under OS X - Framework and Library select Library, on the next window change the Framework to None (Plain C/C++ Library) and static (since that is what your are stating).
Once your project is created, add the existing headers and sources to your project, either by dragging them with the mouse or with the add files drop menu from the right click functionality, you can create a new group in Xcode if you want some order for them.
When adding the files, on the add window shown you can select to either copy them or use their current location.
If needed you might have to change the "header search path" in your target configuration under "Build Settings", if it is the first time you are using Xcode some of this will sound weird but I am sure you will find most of it on the Apple Developers portal in great detail.
If you want to test the files without having to create an external static library you could create a command line project and test them faster and easier.

how to use xcode cocos2d project including both box2d and chipmunk?

I don't know if this sounds crazy.
I have 2 xcode projects, 1 using cocos2d-box2d and the other using cocos2d-chipmunk, and want to merge them into one single project.
I just know how to create project with choosing box2d/chipmunk, but not import one engine to an existing project with an engine.
I tried to copy files to another project and errors showed at Box2d/chipmunk classes.
How to import Box2D to a Chipmunk project (or the reserve) correctly?
Do not drop them both into your project. Create a static library target for each physics engine. That way you can make sure they build separately, and apply custom build settings for each where necessary.
Since you're already in the process of converting a project you may find it easier to migrate to Kobold2D directly. Both Box2D and Chipmunk are setup and ready to use, there's nothing speaking against using both in the same project. All you'd need to do is add the headers for both physics engines and you're ready to go.
PS: yes, it DOES sound crazy. :)
What were the errors? There shouldn't be anything that would prevent Box2D and Chipmunk from existing in the same executable. My best guess is that you have other duplicate symbols in the project or need to tweak the compile settings for something.

Eclipse CDT - new template or "project type"

Using Eclipse Helios and CDT 7.
Is it possible to save a project as a new template/project type?
When you go to create a new project, a dialog opens and you select a project type (Executable -> empty project, etc.) I would like to add one.
Point is, I'm playing with SDL, and I know I'll be making a lot of new projects. I don't want to have to go into the preferences each time and set up the compiler/linker to find the files.
I've been looking for a while, but have had no luck finding anything.
Yes you can do what you want. Check out the link How to Register Templates. I created the following plugin using the instructions in the previous link. Download Plugin.

Xcode: multiple projects, more than one main executable

Hi I'm new to Xcode. I'm trying to learn c++ and I was wondering if it is possible to have multi projects and choose which project should run. I used ms visual studios before and I like how under a solution I can create multiple projects and choose which one is the executable one. Xcode also has targets not exactly sure what they are maybe they play a role? I tried messing around but I constantly have issue because of duplicate mains. I'm going through a chapter and there are case studies. I'm trying to keep every chapter organized in one project well something like that. Any help thanks!
Xcode targets are probably what you are looking for. You can have many targets in a single project, and whichever one you select as active will be used when you tell Xcode to compile or run. If you are having problems with duplicate mains, you probably have all of your .cpp files in all of your targets. If you have main1.cpp and main2.cpp in the same target, Xcode will attempt to use both of them and run into a conflict. Including all common files in all targets, but only the appropriate main files will likely solve your problems.
for creating a new main.cpp file you should go to
File-New-target.
After it gets created just select your file here to choose which file you want to execute:
Actually you can create a workspace, then create each exercise as a project or as a target inside a root project, the second option is preferred if the exercises need to share the same libs and setup.
To select the active scheme to debug and run you can use this selection menu close to debug controls.