Xcode as a compiler

How can i use xcode 4 to compile basic c programs to run in terminal, I am 14 and I have been using Macvim as a basic compiler but now it does not work.

im sorry but where do i type this, where should i write the executable, thanks

Similar Messages

  • Xcode will not compile

    I migrated from Windows C++(Dev C++) to Mac (Xcode) and Xcode will not compile, the command for it is greyed out (not selectable). Even Hello World Wouldn't compile. What am I doing wrong here?
    (this is an empty C++ file that's been opened)

    What kind of application do I want to open for basic C++. I've tried numerous now and I always get at least one error of conflicting commands.

  • Xcode errors on compile

    Hello,
    I'm trying to compile some sample code from a book on objective C. I've got xcode 4.2 installed on my old macbook pro with snow leopard (10.6.8, 32 bit core duo). I compiled the code on another macbook pro with lion and the code ran just fine with no errors. It looks like a syntax error of some kind but everything was copy/pasted and I even set xcode to run as 32 bit since the default is 64. Any ideas?

    also.. that doesn't really explain why it would run on another computer but not this one.. Is it a feature that can only be run on the 10.7 sdk? or Lion?

  • XCode won't compile

    This project used to compile for me on a different computer. That computer is gone now, and I've moved the project to a new computer. I have not changed anything at all about the project, but when I try to build it now, I get 3,626 error messages that start off with this:
    cd /Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge
    /usr/bin/gcc-4.0 -x c++-header -arch ppc -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -mtune=G5 -fvisibility-inlines-hidden -mmacosx-version-min=10.4 -I/Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge/build/JaCK3.build/Deploy ment/version8lib.build/version8lib.hmap -F/Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge/build/Deployment -F/Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge/../Libraries -I/Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge/build/Deployment/include -I/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks -I/Users/jesse/VersionControl/JaCK3/trunk/c++/fmbridge/build/JaCK3.build/Deploy ment/version8lib.build/DerivedSources -isysroot /Developer/SDKs/MacOSX10.4u.sdk -c /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h -o /Library/Caches/com.apple.Xcode.1028/SharedPrecompiledHeaders/Carbon-hadzljfzkp pjveajhqnujmgoizvu/Carbon.h.gch
    /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20:39: error: CoreServices/CoreServices.h: No such file or directory
    /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:24:53: error: ApplicationServices/ApplicationServices.h: No such file or directory
    In file included from /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Head ers/HIToolbox.h:25,
    from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:29:
    /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Heade rs/HIObject.h:24:43: error: CoreFoundation/CoreFoundation.h: No such file or directory
    In file included from /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Head ers/HIToolbox.h:33,
    from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:29:
    /System/Library/Frameworks/Carbon.framework/Frameworks/HIToolbox.framework/Heade rs/HIGeometry.h:20:39: error: CoreGraphics/CoreGraphics.h: No such file or directory
    etc....

    Jesse Barnum wrote:
    Sorry, I appreciate your help and should have thought more carefully about offending people.
    No offense taken. It is just that many people who post here only do so out of frustration and really only want to rant. They are unwilling to step back and take a more logical and reasoned look at a problem. I'm not going to bother reading rants, but I will be glad to help anyone who will meet me halfway.
    However, I deeply dislike XCode, for numerous reasons:
    I'm pretty ambivalent about Xcode. I've seen better and worse IDEs. It would probably be better if there were some competition around, but Metrowerks put themselves out of business.
    Xcode certainly has its faults, but what you have described is not behavior that I have experienced or that I have ever heard about.
    *This same exact project compiled fine on another computer (which unfortunately has been wiped clean)
    I have to say I'm skeptical about this. How do I (or you) know that there wasn't some fix not checked in to SCM on the other machine? Or some change that didn't work but did wind up in SM?
    *I'm able to build successfully on Leopard, just not my computer running Tiger. However, when I do the build on Leopard, it won't run on Tiger (I get missing link errors at runtime), even though I specify 10.4 as the target SDK.
    One way to narrow down where the problem might be is to build a test application on each system and make sure that works properly. How do I know you aren't one of those people who tried to pick and choose which parts of Xcode to install? You must install all of Xcode.
    How do I know you haven't tried to run one of those nasty apps like Monolingual that strips out resources that "you don't need"?
    *When I do the build in Tiger with 'current operating system' specified as the SDK, I get a completely about 800 error messages.
    That indicates that either your project or Xcode installation is completely broken. The first thing to do is find out which one of those it is.
    When I specify 10.4 as the SDK (which seems to me like it should be the same behavior as 'current operating system', since the machine is running 10.4), I get about 3,000 error messages as stated in my original post.
    Given that you don't seem to be able to build anything, trying a cross-platform built is unlikely to work better. The 10.4u SDK is for building a Universal binary (PPC and x86).
    *It is very difficult for me to figure out where to change various settings, since some are at the project level, some are at the target level, and some are at the build configuration level. Sometimes when I double-click on a target to change its settings, I get a blank editable text area; other times I get a GUI with modifiable target settings. In other words, I find the UI to be extremely difficult to manage.
    Those are certainly valid complaints. Once you get past this initial problem of building, it might be a good idea to post one or more new threads about how to use Xcode more effectively.
    In fact, when I've had to change certain settings in the past, it's faster for me to modify the project file in a text editor than to hunt for that particular GUI widget.
    Given that you seem uncomfortable with Xcode, this seems like a pretty dangerous thing to do. You could easily wreck your project so that it stops building for mysterious reasons.
    I'm much more comfortable with Java and IntelliJ than I am with C++ and XCode, so I'm sure that is a big part of my problem, but my gut reaction to the problems that I'm having right now is "don't breathe wrong on XCode or it will stop working and you have to recreate the project". That is why I don't like it (to put it mildly).
    You normally shouldn't have to recreate projects just to get Xcode working. However, that might be what you need to do in this case. If you can definitively prove that Xcode is correctly installed - by building a set of simple 10.4, 10.5 and 10.4u applications, then your project must be corrupted.
    Again, I appreciate your help. I only posted this rant to explain my previous post, which I should have kept to myself.
    I know how you feel. I got someone else mad at me in another thread when I called pthreads "pathetic"

  • Xcode 4 clang compiler flag -std=c++0x -stdlib=libc++

    Hi,
    I just bought Xcode 4 and I wanted to play a bit with the c++0x feature that are implemented at the moment in clang, there is not alot but some is there.
    I am compiling with those flag: -std=c++0x -stdlib=libc++
    This -stdlib=libc++ is to enable the rewrite of stl for clang, unfortunatly if i enable it clang can't find any std include. In example a simple program outputing a literal string to the console won't find <iostream>.
    And From this website (http://clang.llvm.org/cxx_status.html) the variadic template should be implemented and working, but it fail to understand the expression.
    Any body managed to use clang c++0x feature? and use the std lib libc++?
    thanks
    Mani

    I am building from Xcode 4 and in the Other C++ Flags I put -std=c++0x -stdlib=libc++ and the build error is this:
    CompileC /Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Objects-normal/x8664/main.o Cxx0x_Fun/main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/mani/Documents/Mani_Devel/_Development/Xcode4_TestCxx0x/Cxx0xFun
    setenv LANG en_US.US-ASCII
    /Developer/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -DDEBUG -isysroot /Developer/SDKs/MacOSX10.6.sdk -fasm-blocks -mmacosx-version-min=10.6 -gdwarf-2 -fvisibility=hidden -fvisibility-inlines-hidden -iquote /Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Cxx0xFun-generated-files.hmap -I/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Cxx0xFun-own-target-headers.hmap -I/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Cxx0xFun-all-target-headers.hmap -iquote /Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Cxx0xFun-project-headers.hmap -I/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0x_Fun-gohuisfbbejatlagnjp ymgabgyxg/Build/Products/Debug/include -I/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/DerivedSources/x8664 -I/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0xFun.build/DerivedSources -F/Users/mani/Library/Developer/Xcode/DerivedData/Cxx0x_Fun-gohuisfbbejatlagnjp ymgabgyxg/Build/Products/Debug -std=c++0x -stdlib=libc++ -c /Users/mani/Documents/Mani_Devel/_Development/Xcode4_TestCxx0x/Cxx0x_Fun/Cxx0xFun/main.cpp -o /Users/mani/Library/Developer/Xcode/DerivedData/Cxx0xFun-gohuisfbbejatlagnjpymgabgyxg/Build/Intermediates/Cxx0x_Fun.build/Debug/Cxx0x _Fun.build/Objects-normal/x8664/main.o
    /Users/mani/Documents/Mani_Devel/_Development/Xcode4_TestCxx0x/Cxx0x_Fun/Cxx0xFun/main.cpp:9:10: fatal error: 'iostream' file not found [1]
    #include <iostream>
    ^
    1 error generated.
    #include <iostream>
    #if _has_feature(cxx_variadictemplates)
    template<typename... T>
    struct A
    static unsigned const size=sizeof...(T);
    #else
    #endif
    int main (int argc, const char * argv[])
    #if _has_feature(cxx_variadictemplates)
    A<int,int,int>::size;
    // insert code here...
    std::cout << "Hello, World!
    #endif
    return 0;
    Thanks for your help.

  • XCode as C compiler

    I have been trying to learn C in my new mini but i dont know how to use xcode as a c compiler. Can somebody help? I have it installed in my mac.

    Here is an alternative, if you don't want to use the Xcode environment at all: use TextWrangler.
    TextWrangler is a simple plain code editor (well... compared to Xcode), and I use it all the time to write plain C programs with. TextWrangler can compile and run your C program, and put its output into a new text window. All it needs is this piece of magic before the very first line of your actual C code:
    #!/bin/sh
    /usr/bin/gcc -xc - <<EVILEOF
    and this at the very end of your file, starting on a new line:
    EVILEOF
    ./a.out
    I assigned a keyboard shortcut to the "Run" command, so for me it's a simple edit-compile and run-review result-edit loop.
    I don't have a clue how it works I got it from this 3-year-old post and have been a happy coder since!

  • XCode 4.2 compiling against std C libs

    hello all,
    i'm having a little problem with xcde 4.2 today
    today i did the following
    1. upgraded to lion
    2. removed old xcode 4.0
    3. installed new xcode 4.2
    4. created a static library project.
    5. added existing source files to project
    6. compiled lib.
    and i get a lot of errors about missing std c functions such as memcpy and strcat. is my install messed up?
    any help anyone could give me is very much appreciated.
    thank you.

    Grant Bennet-Adler
    Every language has mechanisms to "manage" name conflicts for variable names, functions, classes, source files ...
    In C, most include files are part of the "central library".  Some group projects are managed enough to have several sparse directories for headers, but most end up in either the "system" or "this project" collections.  Name colnflicts with files are inevitable.
    C++ uses "namespaces" to manage conflicts, but the rule-set for "how C++ decides" causes headaches.
    Java has "packages", but even within the "system realm" of functions, *some* functions must be fully-qualified.
    Once a programmer has even two programs he uses regularly, name conflicts are possible.
    Using names that declare its use is very helpful.  It is especially helpful 6 months down the road when you have forgotten most of what you just did.

  • Xcode isn't compiling Java correctly

    when ever i run a Java program from Xcode, I dont see the <filename>.class file. and i dont want to run UNIX all the time. At school we use TextPad and all is compiled. why isnt Xcode doing this?????????

    Hi Marcin
    The .class files are deeply hidden away in the build directory so they're not visible unless you go looking for them using the Finder - most users never bother. As part of the build process (for a Java Tool project) they're copied inside a jar file (Java Archive). When you select the "Build and Go" command, Xcode runs the java compiler to create the class files, then puts them into a jar file, then it runs the JVM, which uses the jar file to load all the classes in your program. All this happens in the background, so usually you're not even aware that it's happening.
    Hope this makes things a bit clearer
    Bob

  • Xcode 4, LLDB compiler & debugging

    With GDB, years of practice taught me to type into console during a debugging session to print out the contents of a local variable. Often this was easier than poking around the variables pane opening objects etc. So in the console window I could type "po <some object>" and get what I want. When I try to do this with LLDB I get an error message about the variable not being defined in the frame. Switching compilers back to GDB gives me the old behavior
    So, the question is, is there a way to get the old behavior with LLDB or do I have to use the UI for inspection?
    Thanks!
    TB

    For some unknowable reason, I no longer am getting errors when I try to print a local variable in console. So everyone out there, thanks anyway!

  • Fatal Syntax Errors Unique to XCode Compile

    I am attempting to bring a Unix library into an XCode project for iPad and compile it. This Unix library compiles for i386 without any problems when I use gcc from Terminal, which is v4.2. However, when I attempt to compile those same sources from within the XCode project, I receive hundreds of fatal syntax errors, even though I it is still compiling to i386, and it is still using GCC 4.2. Here is an example declaration where it gives an error:
    The Code:
    int memcmp(const void *, const void *, size_t);
    The error:
    Expected declaration specifiers or '...' before '(' token
    I must admit I am just now reading my introduction to Objective-C, so it is possible that there is a syntax error there according to some strict guidelines. The above code is actually C, but I did not worry about this because I was not expecting to extensively modify this library.
    How is the XCode compile so different from using Apple's built-in GCC 4.2 that I receive hundreds of fatal syntax errors from within XCode, but it compiles with only a few warnings from the command line?

    kienjakenobi wrote:
    At the moment, I am having difficulty compiling libpng. libpng does not appear to like Apple's custom stdio.h header file.
    What errors are you getting? I'm pretty sure I've build this library before, although not for iOS. Building for iOS shouldn't be much different than any cross-platform build, such as when building 32-bit on a 64-bit machine.
    I tried it myself and couldn't get the configure script to do it all. Those things never work when you need them to. I had to hack up the Makefile and libtool file. Here is a patch file:
    diff -crB libpng-1.2.44/Makefile libpng-1.2.44.iOS/Makefile
    * libpng-1.2.44/Makefile 2010-10-14 14:57:16.000000000 -0400
    --- libpng-1.2.44.iOS/Makefile 2010-10-14 14:50:06.000000000 -0400
    * 171,180 **
    AUTOHEADER = ${SHELL} /Users/jdaniel/Downloads/libpng-1.2.44/missing --run autoheader
    AUTOMAKE = ${SHELL} /Users/jdaniel/Downloads/libpng-1.2.44/missing --run automake-1.11
    AWK = awk
    ! CC = gcc
    CCDEPMODE = depmode=gcc3
    ! CFLAGS = -g -O2
    ! CPP = gcc -E
    CPPFLAGS =
    CYGPATH_W = echo
    DEFS = -DHAVECONFIGH
    --- 171,180 ----
    AUTOHEADER = ${SHELL} /Users/jdaniel/Downloads/libpng-1.2.44/missing --run autoheader
    AUTOMAKE = ${SHELL} /Users/jdaniel/Downloads/libpng-1.2.44/missing --run automake-1.11
    AWK = awk
    ! CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
    CCDEPMODE = depmode=gcc3
    ! CFLAGS = -g -O2 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk -arch armv7
    ! CPP = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp -E
    CPPFLAGS =
    CYGPATH_W = echo
    DEFS = -DHAVECONFIGH
    * 194,200 **
    INSTALL_PROGRAM = ${INSTALL}
    INSTALL_SCRIPT = ${INSTALL}
    INSTALLSTRIPPROGRAM = $(install_sh) -c -s
    ! LD = /usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld
    LDFLAGS =
    LIBOBJS =
    LIBPNG_DEFINES = -DPNGCONFIGURELIBPNG
    --- 194,200 ----
    INSTALL_PROGRAM = ${INSTALL}
    INSTALL_SCRIPT = ${INSTALL}
    INSTALLSTRIPPROGRAM = $(install_sh) -c -s
    ! LD = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld
    LDFLAGS =
    LIBOBJS =
    LIBPNG_DEFINES = -DPNGCONFIGURELIBPNG
    diff -crB libpng-1.2.44/config.log libpng-1.2.44.iOS/config.log
    * libpng-1.2.44/config.log 2010-10-14 14:57:16.000000000 -0400
    --- libpng-1.2.44.iOS/config.log 2010-10-14 14:48:08.000000000 -0400
    * 30,37 **
    Processor type: i486 (Intel 80486)
    Processors active: 0 1
    Primary memory available: 4.00 gigabytes
    ! Default processor set: 90 tasks, 370 threads, 2 processors
    ! Load average: 0.28, Mach factor: 1.71
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown
    --- 30,37 ----
    Processor type: i486 (Intel 80486)
    Processors active: 0 1
    Primary memory available: 4.00 gigabytes
    ! Default processor set: 90 tasks, 374 threads, 2 processors
    ! Load average: 0.38, Mach factor: 1.60
    /bin/machine = unknown
    /usr/bin/oslevel = unknown
    /bin/universe = unknown
    diff -crB libpng-1.2.44/libtool libpng-1.2.44.iOS/libtool
    * libpng-1.2.44/libtool 2010-10-14 14:57:16.000000000 -0400
    --- libpng-1.2.44.iOS/libtool 2010-10-14 14:55:40.000000000 -0400
    * 240,249 **
    hardcodeintolibs=no
    # Compile-time system search path for libraries.
    ! syslib_search_path_spec="/usr/lib/gcc/i686-apple-darwin10/4.2.1/x8664 /usr/lib/i686-apple-darwin10/4.2.1 /usr/lib /usr/local/lib"
    # Run-time system search path for libraries.
    ! syslib_dlsearch_pathspec="/usr/local/lib /lib /usr/lib"
    # Whether dlopen is supported.
    dlopen_support=unknown
    --- 240,249 ----
    hardcodeintolibs=no
    # Compile-time system search path for libraries.
    ! syslib_search_pathspec="/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib"
    # Run-time system search path for libraries.
    ! syslib_dlsearch_pathspec="/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.2.sdk/usr/lib"
    # Whether dlopen is supported.
    dlopen_support=unknown
    * 260,272 **
    # The linker used to build libraries.
    ! LD="/usr/libexec/gcc/i686-apple-darwin10/4.2.1/ld"
    # Commands used to build an old-style archive.
    oldarchivecmds="$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib"
    # A language specific compiler.
    ! CC="gcc"
    # Is the compiler the GNU compiler?
    with_gcc=yes
    --- 260,272 ----
    # The linker used to build libraries.
    ! LD="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld"
    # Commands used to build an old-style archive.
    oldarchivecmds="$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib"
    # A language specific compiler.
    ! CC="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc"
    # Is the compiler the GNU compiler?
    with_gcc=yes
    It seems to work:
    file ./.libs/libpng12.0.dylib
    ./.libs/libpng12.0.dylib: Mach-O dynamically linked shared library arm
    You don't need to create static libraries. Just use the "installnametool" to change the location of the dynamic libraries to @executable_path and include the required libraries inside your application bundle.

  • All was well until 10.7 + MAMP + xCode. Now...misery. Why?

    I'm a port from the PC universe. Been loving my iMac since 10.6 for about 2 years now. Recently, I decided to stop programming on the PC and move to the Mac and open source, namely PHP to start. That mean installing MAMP. No harm. Then, I entered the world of debuggin PHP without a debugger. Not fun. So, I joined the installed xDebug. Whoa! Problems all over. Issues Galore. Addressed the issues, joined the $99 developer community, downloaded xCode (for the compiler), upgraded to 10.7 Lion and fixed all sorts of stuff: paths, ini files, got pear working, php-config, phpize, xdebug.so extension.
    Now that xdebug works, I downloaded JetBrains PHPStorm for my debugger along with Dreamweaver CS4 that I've owned all along. All should be well and good, but not so.
    1. All of my Adobe CS products went to ****. I had to re-install and lost 2 yrs worth of customizations, plug-ins etc. That was Adobe's best suggestion.
    2. My external disk drives locked up, there were now permission issues on all, but my internal drive, so I couldn't get to my Time Machine backups. In any case, I had changed so much I'm not sure it would have helped.
    3. Reformatted all external drives. Lost all, but nothing there was that precious. One drive is a scratch disk, the other was my backups. I immediately made another TM backup. All went well after re-format.
    4. Download OS X.7.3....Whoa, more issues. Mainly permissions. Adobe went to **** again, but I'd already lost everything that mattered, so I trudged through the permissions thing (Library and System seemed to be the primary offenders here). User System now exists everywhere and user "Me" is gone, as is user "Administrators" group. Tried getting rid of user system. Bad, bad idea. Started over, then just tried to add Me and Administrators group. Worked out.
    5. Reinstalled Adobe a 2nd time.
    6. Now, some of my drivers, namely HP Scanjet aren't working, download, reinstall, fix that.
    7. Reinstalling HP drivers mucked up permissions again and I get all these Library permission issues on bootup. Fixed that for the 3rd or 4th time now.
    There's more, but you get the idea. All I wanted to do in the beginning was use PHP 5.3 and be able to debug it. Now I have a "hard way" degree in debugging, Unix, and the mac OS. And, I still don't know what I've done wrong.
    This permissions issue keeps cropping up. I've done the Verify/Repair Permissions thing a few times, same for the hard drive. doesn't seem to have an noticible effect.
    Is there some sort of utility out there (or already here) that will help me get my machine stable once again. I've logged probably 40 hours doing the above and this is darn near reminding me of my life with a PC--but I had 30 years of driving that crate, so it wasn't as frustrating.
    It's all about permissions and my user being installed, or not, in various locations that I'm guessing it used to be installed in. Plus, it seems RW permissions have changed to R. I've used Terminal to fix some of this along the way, and get all working correctly, but I'm scared now to turn off the darn machine, or to upgrade "anything" on it.
    Advice is welcome.
    Regards and thanks to all.
    Dan
    PS: Crap, I see a 10.7.4 on the OS dropdown. I could have gone all night without seeing that!

    It sounds like you're randomly setting file permissions without any idea of what they should be. In nearly all cases, they should be whatever the software installer makes them. On very rare occasions, it may be necessary to repair the permissions of system files after running a defective third-party installer. It's certainly necessary if you've "mucked up" those permissions yourself. You may have mucked them up so badly that they can no longer be repaired in the usual way. In that case, boot from your recovery partition (command-R at startup) and run Disk Utility. That, at least, is safe from being mucked up, but it won't fix everything; only Mac OS system files.
    If a third-party product doesn't work, reinstall it, and resist the temptation to change the permissions. If it still doesn't work, contact the developer for support.
    Repairing the permissions of a home folder in Lion is a complicated procedure. I don’t know of a simpler one that always works.
    Back up all data now. Before proceeding, you must be sure you can restore your system to its present state
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the page that opens.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    chmod -R -N ~
    The command will take a noticeable amount of time to run. When a new line ending in a dollar sign ($) appears below what you entered, it’s done. You may see a few error messages about an “invalid argument” while the command is running. You can ignore those. If you get an error message with the words “Permission denied,” enter this:
    sudo !!
    You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up.
    Next, boot from your recovery partition by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the recovery desktop appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, enter “resetpassword” (without the quotes) and press return. A Reset Password window opens. You’re not going to reset the password.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • Question about size of ints in Xcode

    Hello. I have a a few quick questions about declaring and defining variables and about their size and so forth. The book I'm reading at the moment, "Learn C on the Mac", says the following in reference to the difference between declaring and defining a variable:
    A variable declaration is any statement that specifies a variables name and type. The line *int myInt;* certainly does that. A variable definition is a declaration that causes memory to be allocated for the variable. Since the previous statement does cause memory to be allocated for myInt, it does qualify as a definition.
    I always thought a definition of a variable was a statement that assigned a value to a variable. If a basic declaration like "int myInt;" does allocate memory for the variable and therefore is a definition, can anyone give me an example of a declaration that does not allocate memory for the variable and therefore is not a definition?
    The book goes on, a page or so late, to say this:
    Since myInt was declared to be of type int, and since Xcode is currently set to use 4-byte ints, 4 bytes of memory were reserved for myInt. Since we haven't placed a value in those 4 bytes yet, they could contain any value at all. Some compilers place a value of 0 in a newly allocated variable, but others do not. The key is not to depend on a variable being preset to some specific value. If you want a variable to contain a specific value, assign the value to the variable yourself.
    First, I know that an int can be different sizes (either 4 bytes or 8 bytes, I think), but what does this depend on? I thought it depended on the compiler, but the above quote makes it sound like it depends on the IDE, Xcode. Which is it?
    Second, it said that Xcode is currently set to use 4-byte ints. Does this mean that there is a setting that the user can change to make ints a different size (like 8 bytes), or does it mean that the creators of Xcode currently have it set to use 4-byte ints?
    Third, for the part about some compilers giving a newly allocated variable a value of 0, does this apply to Xcode or any of its compilers? I assume not, but I wanted to check.
    Thanks for all the help, and have a great weekend!

    Tron55555 wrote:
    I always thought a definition of a variable was a statement that assigned a value to a variable. If a basic declaration like "int myInt;" does allocate memory for the variable and therefore is a definition, can anyone give me an example of a declaration that does not allocate memory for the variable and therefore is not a definition?
    I always like to think of a "declaration" to be something that makes no changes to the actual code, but just provides visibility so that compilation and/or linking will succeed. The "definition" allocates space.
    You can declare a function to establish it in the namespace for the compiler to find but the linker needs an actual definition somewhere to link against. With a variable, you could also declare a variable as "extern int myvar;". The actual definition "int myvar;" would be somewhere else.
    According to that book, both "extern int myvar;" and "int myvar;" are declarations, but only the latter is a definition. That is a valid way to look at it. Both statements 'delcare' something to the compiler, but on the second one 'define's some actual data.
    First, I know that an int can be different sizes (either 4 bytes or 8 bytes, I think), but what does this depend on? I thought it depended on the compiler, but the above quote makes it sound like it depends on the IDE, Xcode. Which is it?
    An "int" is supposed to be a processor's "native" size and the most efficient data type to use. A compiler may or may not be able to change that, depending on the target and the compiler. If a compiler supports that option and Xcode supports that compiler and that option, then Xcode can control it, via the compiler.
    Second, it said that Xcode is currently set to use 4-byte ints. Does this mean that there is a setting that the user can change to make ints a different size (like 8 bytes), or does it mean that the creators of Xcode currently have it set to use 4-byte ints?
    I think that "setting" is just not specifying any option to explicitly set the size. You can use "-m32" or "-m64" to control this, but I wouldn't recommend it. Let Xcode handle those low-level details.
    Third, for the part about some compilers giving a newly allocated variable a value of 0, does this apply to Xcode or any of its compilers? I assume not, but I wanted to check.
    I don't know for sure. Why would you ask? Are you thinking of including 45 lines of macro declarations 3 levels deep to initialize values based on whether or not a particular compiler/target supports automatic initialization? Xcode current supports GCC 3.3, GCC 4.0, GCC 4.2, LLVM GCC, CLang, and Intel's compiler for building PPC, i386, and x86_64 code in both debug and release, with a large number of optimization options. It doesn't matter what compiler you use or what it's behavior is - initialize your variables in C.

  • Programming for the mac without using xcode

    Hi
    I'm very new to programming for Apple platform. I wanted to clear some doubts which is currently standing as a barrier in getting started.
    Can I use a text editor (preferably TextMate), Interface Builder, and the Terminal (without using xcode to write & compile) to develop software for the Mac. I have installed the xcode package (~900 mb image).
    Can you point me to some resources on terminal commands for compile, debug codes for the mac. (Obj-C, Cocoa api)
    Thank You.
    Message was edited by: jase21

    You can use anything you want to develop software for the Mac. In fact, I always encourage people to start out with tutorials and examples using standard UNIX command line tools like vi and gcc. There are plenty of such getting started tutorials for UNIX and Linux.
    At some point, however, the command line is going to get cumbersome. You may want go start writing true Mac applications instead if command line tools. Then it will be time to start with Xcode.

  • Running "Build 'em All" example Xcode project wiped out MediaCore folder

    I'm having a hard time setting up Xcode to properly compile the example code into a debug product build that eventually ends up in the MediaCore folder.
    I initially got it to work simply by clicking the 'Run' button on the 'Skeleton' and 'Checkout' projects. 
    Then I decided to just build them all, and pressed 'Run' while I had the 'Buildall' selected.  Seemed like everything ran okay, but then AE was starting to act buggy.  Told me Quicktime wasn't installed, etc.  I noticed that all my plugins were missing, and sure enough the entire MediaCore folder seemed to be overwritten.  Do I have to re-install AE and all my plugins to get those back?
    Most importantly, though, is why did running the 'Buildall' project wipe out the folder of everything?
    I read this in the SDK guide:
    We’ve combined the sample projects into a single master project, stored in the Examples folder of the SDK. For Mac OS, it is Buildall.xcodeproj; for Windows, it is BuildAll.sln.
    In your IDE, you’ll need to change the output folder of your project to build into After Effects’ plug-in folder. For development, we recommend using the following path for Mac
    OS: /Library/Application Support/Adobe/Common/Plug-ins/[CS version]/MediaCore/
    for example: /Library/Application Support/Adobe/Common/Plug-ins/CS6/MediaCore/
    So, I set absolute paths for the build location in my project settings dialog, in the locations tab.  I placed 'intermiediates' in a different folder from 'products'. 
    I just need to know they best way to configure Xcode 4.5 to output the example projects in the correct manner.  I'm afraid I'm going to have to reinstall the plugins.
    Thanks!
    Removed incorrect image.

    hi Lazlo Hollyfeld! welcome to the dark side... :-)
    set to build directory to any folder you like (i created a nice folder called "build64"),
    then just put a shortcut from AE's "blug-ins" folder to you build folder.
    yes, AE does shortcuts.
    leave media core alone...

  • Core2 instructions and asm support for C++ in Xcode

    Hi,
    I'm new to Xcode and have been attempting to compile some of my C++ code. I have some inline assembler which uses the lock instruction for atomic operations. I would like to compile for Core2. 1. to optimize the C++ and 2. because the compiler is failing when it hits the lock instruction as it's not a i386 instruction. I have tried adding this to "other c++ flags" -march=core2 -mtune=core2
    but it complains about dodgy values... so i assume its the wrong place to do that.
    thanks guys

    Catchpole wrote:
    I've been writing C++ for 15 years. What I dont understand is how Xcode hides the compiler options. From the GCC documentation I know what the options are, I just can't find the place to set it.
    There is an "Intruction Scheduling" option but it only lists G5 modes and its a drop down, not editable.
    The Instruction Scheduling option isn't used for 386.
    To get to the compiler options, select the top-level project and Edit -> Get Info. In the Configurations drop down, select the appropriate build setting. If this code were only in release, for example, you would select "Deployment". You will probably want "All Configurations".
    In the Collection drop down, select "GNU C/C++ Compiler 4.0". The options you want are in "Code Generation". If you can't find what you are looking for, you can always just type things into "Other C flags" or "Other C++ Flags". Sorry, they aren't in alphabetical order.
    Now for the strange part. I put your function into the project I'm working on and it compiled fine. I had to make a few minor changes, here is my version:
    void lockFunction(long threadId) {
    long owner = 1;
    long count = 1;
    __asm {
    mov eax, threadId
    mov edx, eax // edx and eax identicle for compare
    lock cmpxchg owner, edx // ATOMIC compare the thread id to the lock owner
    jz incrementLock // if they are not equal, lock execution until the lock owner is reset
    waitLock:
    xor eax, eax // zero out EAX to use for comparison to the lock owner
    lock cmpxchg owner, edx // ATOMIC replace the lock owner with the thread id when the lock owner is zero
    jnz waitLock // if the previous value of the lock owner is non-zero, keep waiting
    incrementLock:
    inc count // increment the lock counter
    I'm no expert on 386 assembly, so I can't help with that. However, I think your problem is on a different level. In Collections, check the Architectures setting. Make sure it is only i386. That is the only thing I can think of.

Maybe you are looking for

  • Help! Duplicate devices on iPhone with iMessage's Continuity

    Hi! After a clean install of Yosemite  on my MacBook Pro (15" early 2011) my iPhone 4S (iOS 8.1) shows 7 different devices called "Macbook Pro of Niccoló" in Settings - Messages, without the ability to erase the duplicates. I'm used to do a clean ins

  • Finder failed to open and now it askes me to restart as soon as I turn it on.

    At first My finder would not open, and it kept asking me if I wanted to report the problem. when I restarted it the same thing happend over and over again. then It just started to have problems just logging in it would freeze after I typed in the pas

  • Problem when summery the data type of interval day to second

    hi i write a program calculate periods of time and summary it then i used interval day to second data type oracle support basic 4 math operation (+,-,*,/) on interval but although oracle does not support summary function like sum() ,avg(),count()!! t

  • Should I upgrade to Mavericks?

    I've got an early 2010 Mac Mini with an external 1T Western Digital HD dedicated to Time Machine.  I'd like to upgrade to Mavericks but I have a couple of questions: If I do a clean install, do I have to reinstall all other programs or can I just cop

  • How to creat a global variable?

    I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering. Solved! Go to Solution.