Xcode 4 menu "Build" and "Clean" options disabled - c++

I have a few c++ Xcode 3 projects which I need to move to Xcode 4. I have done this by simply renaming the Xcode 3 folder, loading the Xcode 3 project in Xcode 4 and then hitting the modernize button. In the case of some of these projects I cannot build them because the Xcode 4 "Build" and "Clean" menu options are disabled (they are all static libraries so there is no question of running them). I have added some of these ported Xcode 4 projects into an Xcode 4 workspace where they build fine as part of building the entire workspace contents. None the less I will probably need to build these projects independently as well. Any ideas?
Thanks,
Barrie

I was getting the same problem with an Xcode 3.2 project when loaded into Xcode 4.2. What solved it for me was changing the "Schemes", which is Xcode 4.2 for "Project Settings." They seem to interpret the settings files a bit differently.
Go to Menu: Product -> Edit Schemes. Note which library is selected in the pulldown menu along the top of the new dialog. You'll probably need make this change for each library. Mine defaulted to all boxes checked & I left it like that.
Click to see Scheme build panel
Along the left column, expand the "Build" block. Select "Build" from Pre-Actions, Build, Post-Actions. Now in the larger right block, you'll see a build target (possibly in red, mine all were).
Click the "+" button at the bottom of this block; it should bring up a list of targets. Select the one you want to build for this library and click "Add". Now you can select the old invalid target and click the "-" button at the bottom to remove it. Click "OK".
After fixing one of these targets, "Build" and "Clean" should become enabled when that fixed library is selected as your current scheme in the upper-left of the main window.
If you have a master project, you want each sub-project set up as a dependency of the master project too. Xcode 4.2 also missed this from the Xcode 3.2 project.
On the main window, bring up the Project Navigator (leftmost icon above left column) and select your master project. To the right, select the target. To the right of that, on the top select "Build Phases." You should get a list below that for your current dependencies. Click the "+" button at the bottom again to add the targets from each project.
Click to see Target dependencies dialog

Related

How do I run multiple program in codelite

I had to do my homework with c programming in codelite. Just like codeBlock and Dev-C++ which give user to run multiple console program in the same folder, however, when I run it on codelite it fail.
I have create different workspace folder or even different project.But when I try to build it, only the first c file get to build but not later created c file.
May anyone please help me on this issues?I just want to rum multiple program in codelite just like code block.
Hitting F7, builds the active project (the project with a bold text in the workspace tree view).
To change the active project:
Double click a project, or:
Right click a project and select Make active
To build all the projects in a single click (Default key: F7):
Add new project to the workspace
Right click it and select Build Order
In the dialog that pops up, click on the checkbox near each project
Build the dummy project (make it active as described above) and hit F7
OR, build the entire workspace (Ctrl-Shift-B):
From the menu bar select Build -> Build Workspace (default key bindings: Ctrl-Shift-B)
To execute a project (default key binding: Ctrl-F5):
Make the project active by double clicking it
Hit Ctrl-F5
NOTE:
All keybindings can be changed from Settings -> Keyboard shortcuts
HTH,
Eran

Specifying external Makefile options in Eclipse CDT

I'd like to (temporarily) migrate a C++ project from Netbeans to Eclipse (in order to use Eclipse's parallel debugger). So far I've created a "Makefile project with Existing Code" project in Eclipse that references the Netbeans project Makefile/directory. However the Netbeans project accepts config options for example
make -f Makefile CONF=GNU_Debug
How can I pass this option to the Makefile in Eclipse?
Eclipse version
Eclipse for Parallel Application Developers -- Mars.2 Release (4.5.2)
You can change the default make call in the projects properties dialog:
My version:
Version: Mars.1 Release (4.5.1)
Note that the -f Makefile should be superfluous.
In addition to πάντα ῥεῖ's answer, which changes settings "globally" for a project, you can define individual make targets in the Make Target view.
Steps:
Choose Window -> Show View -> Other... -> Make -> Make Target (or simpler, press Ctrl+3 then type Make Target and choose the view from the list.)
Right click on the project in the view and choose New...
Enter the make target you want to use, e.g. CONF=GNU_Debug and press OK
Double-click on target to build
Here is a screenshot:
Shortcuts
You can quickly rebuild last selected Make target by pressing F9
Bring up a pop-up to select Make target by pressing Shift+F9
Access the same UI as above by right-clicking on project in Project Explorer and choosing Make Targets -> Build or selecting the same from the Project menu.

Adding the android-support-v7-appcompat library?

New to Android, trying to follow the training tutorials step by step, but riddled with errors, what a mess!
First stumbling block on:
http://developer.android.com/tools/support-library/setup.html
The instruction to add the library reads:
Quote:
"Add the library to your application project:
In the Project Explorer, right-click your project and select Properties.
In the category panel on the left side of the dialog, select Android.
In the Library pane, click the Add button.
..."
There is no Add button to be found in the Libraries pane in the Java Build Path, but several Add Jar, Add library and other buttons, none of which will solve the errors in Mainactivity.java.
After looking around I found that opening the Projects pane and use the Add button there resolved the errors and I could run the app. However getting problems in the next steps...

The program file specified in the launch configuration does not exist

I am facing some problems regarding eclipse for c/c++. I am trying to create a new project, I provide the code, and after running the code I get this error:
The program file specified in the launch configuration does not exist
C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found
Please notice that I am working with spice toolkit; I set the path for the "include" files and the libraries, but still I can not have a result.
What causes this error and how can I resolve it?
Right click on your project --> Properties
Run/Debug settings
Delete whatever is set as "launch configuration for '........'
Project --> Clean
Project --> Build Project
You can create a run configuration. Go to Run > Run Configurations. Click New button, fill C/C++ Application field, i.e., insert path to your executable. The new configuration will appear in the list which appears when you click to the arrow next to run button.
Of course this assumes your can build without problems, otherwise you won't see an executable to point to.
You can clean the project, build it again and run it as a local C/C++ application. Simplified steps as follows,
Right click on the project
Clean Project
Again Right click on the project
Build Project
Again Right click on the project
Run As ->
Local C/C++ Application
As the error reads:
C:\Users\elisabeth\workspace\mm\Debug\mm.exe not found
First of all you need to check whether there is an executable "mm.exe" in your Debug folder. (Of course, it is not there and that is why the error)
Go to Project > Clean
and you should see some files being deleted from your Debug folder
Go to Project > Build Project
and you should see some new files being generated e.g. mm.d, mm.o, mm. This "mm" is probably the executable you're looking for
Now that you know what your executable is, you should tell eclipse what file to execute instead of mm.exe. Go to Project properties and in run debug settings create a new configuration (or edit an existing configuration, if there is one already). In this configuration, in main tab, in C/C++ Application specify a full path to "mm". Which, in your case is - "C:\Users\elisabeth\workspace\mm\Debug\mm"
A better way to do this in eclipse is:
${project_loc}/"your folder"/"your executable file"
e.g.${project_loc}/Debug/mm
what worked for me is file->refresh
then do the Debug configuration again by choosing the right c/c++ binary again.
Avoid troubles with configuration by going into Project properties > C/C++ build > Refresh Policy and specify your project folder. The configuration option "Search project" will show a correct folder then and you will see whatever you build there - Debug, Release or both. You don't want to specify the folder using Browse option every time you import project or switch configurations.
As this is the first SO discussion that appears for this topic on Google and none of the answers solved the problem my students were having, I would like to mention the solution we eventually found from this answer:
Open project properties (Right click on your project, choose Properties on the menu)
C/C++ Build -> Settings
Click on Binary Parsers tab and check PE Windows Parser
Keep clicking Move Up until it is at the top
This had been set to Elf, even though we were using a freshly downloaded Windows version of Eclipse.
sometime missed closing curly brace can be part of a problem. Make sure prototype your function at the beginning of the file. Then right click your project in the left side bar. click clean project. then click build project and finally run project
I encountered similar issues and their related problems a few days ago. Finally, I found out that, just because I had moved my project folder (workspace folder of Eclipse) to another place so Eclipse could not find what its need as usual.
Solution: I just set the workspace to my new place (Hey Eclipse, my workspace now is here) :
Menu "File" -> "Switch workspace" -> "Other..." -> click "Browse..." button and point to new place then click "Select Folder" button and click "Launch" button.
Nice day.

How to get back a file that was excluded from a build configuration in Eclipse CDT?

Using Indigo and a managed build C++ project, I right-clicked on a source file and selected Resource Configurations->Exclude From Build..., and the file promptly disappears. Scrolling down shows it at the bottom of the list of source files with a new dimmed icon. Now how do I get it back? The Reset to Default... option is always dimmed out. Right-clicking on the excluded file still only shows the Exclude From Build... option. Is there an Include in Build option somewhere? I realize I can go to .cproject file and manually edit it back in but I figure there must be a way to do it from the IDE.
Yes this is an old question. But people do go looking for answers years later..
There's an easy way, but it's counter intuitive. Right click the excluded item, select "exclude from build", and on the dialog that appears, uncheck the builds for which you'd like the item back. Note the convenient 'Deselect All' button.
In eclipse there's not a similar way to reinclude resource, like:
Resource Configuration -> Reinclude from build
You need to go in Project Proprerties (Alt+Enter) and go:
C/C++ General -> Paths and Symbols
Select tab
Source Location
and expand your project's folder: here you can select filter that you want to remove and click on "Edit Filter" and then "Remove".
While I still don't know how get back a file that's been excluded. I have discovered that it's much better to just add a new folder, and then mark the folder as excluded. Then files can be excluded by dragging them into this folder and included back by dragging them back to the original folder.