Xcode executable execution working directory on double-click

I have a fairly simple C++ code that I made with Xcode 3.1. It compiles fine and works if I run it from a terminal. But, if I double-click the executable, it launches and is looking for some supporting, local files at my "Macintosh HD" directory level instead of in the folder I launched it from (output files are also placed at that directory level). All file paths in the code are relative.
Is this a compilation issue or option that I can change in Xcode? How do I make it so I can also just double-click the executable?
Thanks,
John

Double clicking actually executes Terminal with root as current directory which then runs your C code. Change your code to look at the path in arg and use it to access the supporting files.

Similar Messages

  • HT201365 How do I close my apps with new upgrade?  It doesn't work when you double  click home button and hold until the x comes?

    I just upgraded to new iOS 7.2 and I don't know how to close out my applications? It doesn't work with the double click of home button and simply holding until the x shows?

    Tap Home button twice then use an  upward swipe on the preview to close the app

  • Cannot load .dll files in another directory when double clicking on the .exe

    Hi all,
    I am currently using VS 2005. I have quite a few of .dll(s) that is currently residing in the same directory as the .exe
    I want to put the .dll(s) in another directory and have the application point it to that directory so that it can load the .dll(s) from there. 
    I know that I am able to set the Environment path to my desired directory in project properties->debugging. 
    However, i also know that this is only applicable for debug mode and executing the app by pressing "F5" or the "play" button.
    But when i double click on the app in the debug folder, it does not load the .dll(s) from the specified path. 
    How can I make the .dll(s) load from my specified path even when i double click on the .exe? in debug and release mode. 
    Cheers,
    nat

    Hi Nat,
    Thank you for your information.
    Your issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because you want to load dlls from your application, it is more related to programming, I suggest opening a new thread about your issue in some development forums based on the type of your application. For example, if you are working with Windows Forms app,
    you can consult on Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
    If you are working with WPF app, WPF forum is a proper forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Having problem with my iphone camera,doesnt work when i click the camera app,but it does work when i double click when my phone is off.

    having problem with my iphone camera,doesnt work when i click the camera app,but when i double click when my phone is locked it works.

    The Basic Troubleshooting Steps are:
    Restart..  Reset..  Restore...
    Reset your phone:
    Press the sleep/wake button & home button at the same time, keep pressing until you see the Apple logo, then release the buttons...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • Javascript not working unless user double clicks

    I'm working on a redesign of a site. On the FAQ page, there is a javascript. You are supposed to click on the Q to reaveal the A. On the dev site you have to doubleclick. This is wrong.
    Here is the page in development:
    http://mayakaimal.com/mayakaimal2/about-faq.html
    It works on the old site:
    http://mayakaimal.com/faq.html
    Any insight greatly appreciated.
    mookie

    The issue is because on the dev site the hidden answers have all been given a class Afaq which has css of display:none which hides all the answers on page load. Whereas the other site there is no class on the answers div, but all the answers have inline styling to hide them.
    The javascript works by changing the inline styling of the answer div... the first time it is clicked on the dev site it doesn't find any inline styling so sets some to display none, so that on the second click it begings working again!
    so the simplest solution would be either to alter the javascript to change the css class, or to remove the class and add inline styling like on the live site.
    Compare the two sites with a tool like firebug for firefox and you should see the difference in HTML markup and the javascript changing the inline styling.
    Jeff Logan Web Solutions
    http://twitter.com/JeffLogan_WS

  • Itunes has stopped working when I double-click a song

    Well my itunes usually take a while to start up because I've got a lot of music and videos in it, but today it takes no time to start, but when I try to launch a song I get the 'Itunes has stopped working Windows is looking for a solution' message, I repaired it, doesn't work, uninstalled then reinstalled it, doesn't work neither.
    It can't play music, videos or open Apple Store, but otherwise it doesn't crash at all, I can create new playlists etc.
    And when I right click on a song and choose 'obtain information' I get a blank window with normal buttons like 'OK' or 'Cancel' but nothing else, when I click on a button Itunes crash...
    Please!
    I'm running on Windows 7 64bits
    And by the way I made a system clean up yesterday, so it may be caused by this...but how can I undo it :S

    Well it's working fine again.........................................I don't get it - -

  • Itunes won't work when I double click on my desk top and it won't update.

    I'm having major problems with Itunes. As I stated in my title, I can't open Itunes on the desktop. I get this error message when I try. "This action only valid with products installed." However, it will open up when I connect my IPOD or click on something for it to play. I cannot also go to my files manually on my ipod. It will just sync them up with whatever is new.
    When I have tried to update it, or reinstall it, I get this message: "The feature you are trying to use is on a network resource that is unavailable." It tells me to "Click OK to try again, or alternate path to a folder containing the installation package 'Itunes.msi' in the box below"
    I have tried to uninstall ITUNES, but, when I do, I get the error message that I get when I try to update or install itunes.
    Can anybody help me?

    My won't either. This started with me when I installed the update. I get the message that the file itunes.msi cannot be found. I have even tried to re-install from my original disc and it still cannot find itunes.msi. I have ran the 'find' procedure and my computer cannot find the file. I don't know how to get the file since I have tried installing from the original disc.

  • How can I execute a bash script by double clicking in finder

    Hello!
    How can I execute a bash script using finder? Or better: How can I create an alias, which executes my bash script?
    Thanks Johann

    Add the suffix command in your script name. E.g. Script.command.

  • Double-clicking the home button on my 4S running 7.1 no longer works

    So how do I close apps?

    There is something not working in your double click, perhaps too slow...my iPhone 4 works fine with the double click, pulls in the dock with all of the recent apps and index material for each app sitting just above the app.  Swipe the index page up and off the top of the screen and the app disappears from the recents dock.
    Try doing a reboot by holding both the power and home buttons until the apple logo appears, ignore the red slider if that appears...see if the music works then.

  • Double-clicking on a file on Xserve RAID opens different file...

    Hi,
    This may or may not be the correct place to post this message. I am working with an Xserve RAID connected to an Xserve running OS X Server 10.4.10. I have experienced being in a directory and double-clicking on an Indesign file type and the content from a completely diferrent file (jpg) opens in it's place as the Indesign file. The corresponding jpg, which is from the same directory, seems unaffected. The data from the Indesign file is lost and replaced with the content from the jpg. Very strange. I saw this a couple of months ago and running Disk Warrior on the RAID, rebuilding the directory, seemed to have worked. I would like to know more about why this is happening and to know if there is a solution once and for all.
    I did run DiskWarrior again today, so I will probably not be able to re-produce this for a while (hopefully never )
    Any advice or suggestions welcome...
    Thank you,
    Sean

    This might be related to 10.4.10.
    We experience similar behaviour on 10.4.10 (and on some rare 10.3.9 systems)
    So you could consider downgrading to 10.4.9 or wait for 10.4.11

  • Double clicking .jar file does nothing!

    Hello i am wondering, how to run a .jar file by double clicking it?
    After creating the jar file and by typing javaw.exe -jar ledger.jar in command prompt in windows 7 works fine for my swing application.
    I created a .bat file which has javaw.exe -jar ledger.jar also works fine.
    But when i double clicking the ledger.jar is not working, not giving any error, not even doing anything.
    I tried associating .jar file with java or javaw then also nothing happens.
    My questions are:
    1) What i have to do to execute the .jar file by double clicking it?
    2) Why java is not so user friendly to the end users especially in Desktop Applications?
    Thanks in advance.
    Note: OS - Windows 7 64 bit
    JRE - 32 bit in Program files (x86) folder version 7

    handat wrote:
    Your other question, please blame Microsoft for not making file associations easier to manage.Too easy. You can blame MS all you want; it is the task of the Java runtime installer to properly setup the file associations - OR the administrator which bypasses the runtime installation with his own scripts. i have installed the runtime many times including on Windows 7 and it always does it properly. I have no clue how people end up with half-finished installations.

  • Hierarchial List double click Event

    Hi Friends,
    I have developed a Heirarchial List using Function Modules.
    My requirement is when i double click on items(child) it has to go to a sap standard transaction.
    But Double clcik event is not working when i double click on any item. Can anybody pls  give me an idea
    how to achieve this?
    Thnaks in Advance.
    With regards,
    Rajgopal

    Dera friend,
                      follow the below mentioned code . hope u will undersatnd.
    Here is the procedure to handle Interactive ALV.
    1. declare events table like this.
    data :
          i_events  type slis_t_event,
          w_events  like line of i_events.
    2.
    Build events table .
    w_events-name = 'USER_COMMAND' .
    w_events-form = 'USER_COMMAND' .
    append w_events to i_events.
    clear w_events.
    3.
    pass this events table through REUSE_ALV_GRID_DISPLAY.
    4.
    USER_COMMAND call back subroutine should be like this in your case. This is nowhere called using PERFORM statement in ur program.
    5.
    USER_COMMAND subroutine should be like this.
    *&      Form  user_command
    form user_command using ucomm like sy-ucomm
                      selfield type slis_selfield.
      case ucomm .
        when '&IC1'. This is for double click on ALV output.  
       skip 10.
          position 10.
          write 'Double click was executed'.
      endcase.
    endform.                    "user_command
    selfield structure
    You can also handle Interactive ALV using this structure.
    types: begin of slis_selfield,
             tabname              type slis_tabname,
             tabindex             like sy-tabix,
             sumindex             like sy-tabix,
             endsum(1)            type c,
             sel_tab_field        type slis_sel_tab_field,
             value                type slis_entry,
             before_action(1)     type c,
             after_action(1)      type c,
             refresh(1)           type c,
             col_stable(1)        type c,
             row_stable(1)        type c,
           colwidth_optimize(1) type c,
             exit(1)              type c,
             fieldname            type slis_fieldname,
             grouplevel           type i,
             collect_from         type i,
             collect_to           type i,
           end of slis_selfield.
    You have to check the above structure in debug when u double click what the above contains. very helpful structure fo ur case.
    regards,
    PrashantH maturu.

  • Deploying AAMEE 3.1 created MSI by double clicking it in UI mode

    With the release of AAMEE 3.1, AAMEE created MSI supports both silent and UI based installation.
    For UI based install of AAMEE 3.1 created packages, run the MSI as an administrator. If you are logged in as Admin user, you can double click it, otherwise right click the MSI and run as administrator. A minimalistic UI will be shown with just a progress bar. Any error during MSI install will cause a roll back and the user should check the logs to see what went wrong. You can also run the MSI in UI mode through this command line –
    msiexec.exe /i <path of msi>
    AAMEE still supports silent installation as the standard way of deploying the packages. Silent installation can be done only through the command line option –
    msiexec.exe /i  <path of msi> /qn.
    Make sure that the command line is invoked with admin privileges. For users using SCCM 2007 for deploying AAMEE created packages, make sure to check “Allow users to interact with this program” checkbox in Environment tab of the SCCM Program for UI based installation. The corresponding checkbox for SCCM 2012 is “Allow users to view and interact with the program installation”.
    For uninstallation of MSI in UI mode, there is only a command line option –
    msiexec.exe /x <path of msi>
    For silent uninstallation, add the /qn switch with the above command line –
    msiexec.exe /x <path of msi> /qn
    This UI based installation is only supported by the packages created using AAMEE 3.1. If you are using AAMEE 3.1 beta or AAMEE 3.0 for CS6 packaging, please download AAMEE 3.1 from http://www.adobe.com/devnet/creativesuite/enterprisedeployment.html.
    Feel free to mail me at [email protected] in case you see any issues.
    Thanks,
    Saransh Katariya | Member of technical staff | Adobe Systems | [email protected]

    I want to revisit this. You can also see my related posts here:
    http://forums.adobe.com/message/5073735
    I had contented myself that I would use a batch file and require users to right-click and run as admin on the batch file. This was so that I could get Acrobat 10 installed at the same time. However, now that I have Acrobat 11, and I can separate out the installers, I would like to get back to this "double-click" method. I've verified that my new package (without Acrobat) works using the msiexec command. However, it still doesn't work as a double-click.
    Here are the key lines from PDApp.log:
    3/8/2013 07:54:21 [ERROR] Setup - Error parsing command line arguments at - "DISABLE_CCM_DESKTOPSHORTCUT".
    Expected arguments are -
              --mode=silent
              --overrideFile="<FilePath>"
    3/8/2013 07:54:21 [FATAL] Setup - Administrative Privileges required to continue
    3/8/2013 07:54:21 [FATAL] Setup - End Adobe Setup. Exit code: -10
    However, I am an admin on the machine, just as I am on all the machines that I've tested this on. And when I use a batch file with the msiexec and right-click and run as admin, I don't have to put other credentials in, verifying that I am, in fact, an admin on the machine.
    Thanks for your assistance.
    Mark

  • Work Item: Is it possible to re-execute a work item ?

    Hello all,
    Once a W.I. has completed, is it possible to re-execute it ?
    Thanks.
    José

    Hi Rick,
    Wel... at first, I was simply double-clicking on the WI in the Business WP and it seemed to me like it was not executing it but after some deeper analysis, I realized that I had a problem with my code and that it was actually re-executing it everytime I was doubli-clicking on it. 
    In conclusion, we can re-execute a WI as long as its status is not "Completed" i.e if the status is "Executed", we can re-execute it no problem.
    José

  • IPOD TOUCH SCREEN WONT SLIDE UP OR DOWN AND I HAVE TO DOUBLE CLICK ON IT TO GET TO SOMETHING. NEED HELP!!

    IPOD WONT WORK UNLESS YOU DOUBLE CLICK THE APP. WHEN YOU DO IT WON'T LET ME SLIDE UP OR DOWN.
    < Edited By Host >

    Try the standard fixes:
    - Reset. Nothing will be lost.
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory defaults/new iPod.

Maybe you are looking for

  • Letter keys are not working on MacBook Air when playing games?

    Hello. I'm using 10.6.6 on my MacBook Air 2.1 (2009 model). I've got a really strange issue when playing games (any game produces this issue). ONLY the letter keys aren't working. The rest is working - numbers, function keys, arrows, tab, enter, dele

  • To change indian store to oman store

    How to change indian store tooman store?i am not able to download apps.

  • How do i clean the Black MacBook?

    hi, i was wondering how to clean my black macbook...the flat black paints holds alot of finger prints and they don't wipe right off the way they do on the white macbook with it's smooth finish..... any advice is well appreciated... thanks... MAC BOOK

  • Color cast when printing from Aperture

    I'm having troubles with printing since the last upgrade of Aperture.I'm using the Canon ipF5100. When I print using Aperture the is a nasty greenish color. Now I've to switch to Photoshop CS3 to make a print. Before the update I could make fine prin

  • Can any body tell me how to create a layout variant in the selection

    hi friends i would like to know how to create a layout variant in the selection screen and how to select the variant to display the ouptut using the layout using disvariant.please if possible give me example. thanks in advance.