I am working on an application which is working properly in Debug configuration.
But when I am trying to build it in Release mode, its showing me list of errors specifically not finding header libraries.
Is there any extra settings I have to do for it?
Thank You.
Check the build settings of your application. (In XCode3: Project -> Project Settings -> Build tab).
You may set options for 'All Configurations' or for individual configuration separately. Check the entries you have for 'Header Search Paths' in Release versus Debug.
See the header paths settings in dubug and release mode .Make them same in both configurations
Related
I have two c++ source files. I am building each in a separate build configuration. I have set up each build configuration to exclude the other source file. In the Project Explorer, one of the file's icons has a slash through it, showing it as the source file that is excluded and I cannot refactor code for this source file. This is all as expected, done according to the instructions found here.
I have verified that each file has the "Exclude resource from build" box checked for the appropriate build configuration. Furthermore, I have verified that the build command for each build configuration builds the correct source file.
Then I click Project->Build Configurations->Set Active and select the other build configuration but the same source file is excluded. I also tried switching configurations by actually building the different configurations, but again, the file exclusions remain the same (both the icon shows it as deactivated and I cannot refactor that source file).
I have searched various posts but do not see the exact circumstance I'm facing, though this one was close. Perhaps I don't know the correct terminology to do a proper search.
Am I switching between configurations correctly? Is there a workaround for this behavior (besides including all files in the build, if I need to refactor, and then re-excluding them before build)?
I have seen this behavior in Nsight (running Eclipse 3.8) and in Eclipse Mars (4.5.0). I am running on Linux CentOS 6.7, 64-bit.
In Window->Preferences->Indexer, select "Use active build configuration" (help.eclipse.org/mars/…) in the frame titled "Build configuration for the indexer".
In Eclipse I have exported code formatting, cleanup, import orders etc to files and checked them into svn.
This is useful for my team so that they can all use the same setup.
However, I can't find a way to do the same for Compiler options. There are quite a few useful settings that aren't switched on by default and its error prone for everyone to change them manually.
I know that I can use FindBugs (and we do through CI) but the Eclipse compiler options are better integrated and faster.
The best way to share all of those settings is to use Project-specific settings. Open the Project properties and select the various sections that you want to configure (for example, Java Compiler, then select the option Enable project specific settings.
Any settings you configure this way are stored in the project in a folder named .settings. Check that folder in to source control along with the .classpath and .project files, and whenever the project is checked out Eclipse will automatically apply the settings. Workspace settings are overridden by project-specific settings, so using this technique it doesn't matter how other workspaces or users have their settings configured.
The answer of #E-Riz is perfectly correct. If you find that you need to synchronize more than the listed settings for your team members in the future, then you should also have a look at Googles workspace mechanic, which allows to automatically apply any set of preferences to a workspace and to check during each start if the local preferences are still valid for the shared setup.
I am trying to build my project for sdk iphoneos and iphonesimulator. There are few .a static libraries that can only be utilized for iphoneos. Where can I go an ignore these files if its being build for iphonesimulator within XCode?
Thanks.
Instead of hard linking the libraries, use the "Other Linker Flags" setting in the project configuration settings. You'll be able to link different versions of libraries based on the current build configuration.
By default you already have Debug and Release build configuration, press the "plus" button on the Debug will add a configuration for a specific architecture. Choose "Any iOS Simulator" and link the libraries you would like to use to run the app on simulator. Then press the "plus" button on the Debug again, this time choose "Any iOS" and link the libraries you would like to use to run the app on the device.
Lastly, do the same thing for the Release configuration.
You can set two targets, one for simulator and one for device, and in the simulator target settings (Build Phases -> Link Binary With Libraries) remove the unwanted *.a files
I just had this issue and I solved by creating a new target just for the simulator.
At the new target you can go to the target settings -> build phases -> link binary with libraries and removed the static library just for that target.
Also make sure you do not include the files from the static library by using the TARGET_IPHONE_SIMULATOR macro for checking, just as #MDT did.
I'm trying to get the example project for an SoundCloud API wrapper working using XCode 3. There are some few basic instructions at the start, but I'm having trouble:
QuickStart
In your terminal:
git clone
git://github.com/soundcloud/cocoa-api-wrapper.git
SoundCloudAPI cd SoundCloudAPI git
submodule update --recursive --init
In your Xcode project:
drag SoundCloudAPI.xcodeproj into your project
add it as a build dependency
add the static library as
a liked target
add "[relative path to
SoundCloudAPI]/Sources/SoundCloudAPI"
to your header search path in the
build settings
you can also include
the OAuth2Client headers by adding
"[relative path to
SoundCloudAPI]/Outsourced/OAuth2Client/Sources/OAuth2Client"
too (although you might not need
them)
I've completely ignored the part before In Your Xcode project. I think I've done everything correctly to add the build dependency following this post, the frameworks are still marked in red as if they were missing. Any advice?
Also the three points after that are also not very clear? Could someone explain these in a bit more detail? For example, where is the header search path? and where are the build settings?
Thanks so much!
Tip: Given that you've tagged this question with iphone, I'll assume you're building an iPhone app. In that case, you need to add libSoundCloudAPI.a as a direct dependency, but not SoundCloudAPI.framework.
To set the header search path in Xcode 3:
Ctrl-click your app's target (inside Targets in the Group & Files panel on the left hand side) and choose Get Info
Click the Build tab - these are the build settings! :-)
Set Configuration: to All Configurations, Show: to All Settings
In the Search Paths section, update Header Search Paths
In the build settings I have it define DEBUG when in the debug build configuration, so that I may make my code do separate things depending on which type of build it is.
However in Eclipse it darkens out the parts of the code which are excluded by the preprocessor, and this doesn't keep up when I change the setting (whether I'm currently building debug or release). So, I have a bunch of code which is perpetually darkened out, and the Eclipse indexer and other helpful features don't work inside of those areas.
How to fix? Has anyone else encountered this?
Update: Still having this issue. I eventually abandoned my unit-test build configs and simply put that functionality into a command-line switch. Just so that I could get indexing to work while I write my unit tests.
You have to set the option "Build configuration for the indexer" to "Use active build configuration" in the projects C/C++ indexer preferences. Open the properties panel for the project, go to c/C++ General and Indexer and enable project specific settings and change the radiobutton on the bottom to "Use Active build configuration".
Of course you can also set this in the global properties panel of Eclipse to change this setting for all projects.
Go to your project's Properties, then go to C/C++ General -> Paths and Symbols -> Symbols. Add your defines there and it will work.
If you want to change the defines for your system based on build configuration, you need to do as dgrant said here: "Project properties and select C/C++ General -> Paths and Symbols then select the Symbols tab", but you need to make sure you have the correct configuration selected at the top of your window. Also be sure when you add the symbol to the list that you DON'T check the "add to all configurations" checkbox.
If you want your correct set of symbols to be parsed by CDT in your editor, you'll also need to make sure you have the correct build configuration active as well. To do that, right-click on your project and select Build Configurations -> Set Active -> and select the build configuration you want to make active. CDT will now parse all the files as if this build configuration were active instead, using the global symbols you defined in the last step.
There is a problem I've seen with every version of Eclipse where it doesn't always decide to rebuild your index files immediately. To get it to do so, you can either start a build (the build doesn't actually have to complete), or you can right-click on your project and go to Index -> Rebuild. Both cause an immediate re-indexing to occur. You shouldn't need this, however. I can confirm that simply changing the build configuration as described in step 2 above will cause an #ifdef I have in my code which checks for a symbol defined only in one of my build configurations to immediately become greyed-out or un-greyed-out, as it should.
Check provider: -> C/C++ General -> Preprocessor Include Paths, Macros etc. -> Providers -> CDT Managed Build Settings Entries. It should be enabled.
Check if defined symbol is in entries of this provider.
Indexer is optional.
My satisfactory solution has been to move away from Eclipse to editors with a working libclang plugin: Sublime Text, Vim.
For an intelligent IDE for C/C++, one probably can't go wrong with XCode or MSVC.