GCC on Windows creates undeletable file - c

I have installed MinGW on Windows 7
i did write a hello world app...
#include <stdio.h>
void main()
{
printf("Hallo, Welt!\n");
};
i did run
gcc Hello.c -o Hello
this did create a exe app named Hello.exe
I did run it and it said hello as it should
I did add a comment to the file, save it, and rerun the compiler in CMD as Admin
then i got error
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot open output file Hello.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
So i did try to delete the file in the windows file explorer
a window did pop up and did ask me to use administrator rights to delete the file
so i did permit this admin rights as i am admin
then it did popup a other message ... i need some rights from the computer it self
i dont know what i should do now ... i am admin of the computer and i cant delete the file ... if i rightclick the file and open the file settings and there the permissions i see the admin should have all permissions.
the file is not running as i see it ... the file is not locked by any thing
what is wrong ... is it because of the code or the compiler or is it a window thing ... how can i kill this file?
Edit:
The file is not running ... in Taskmanager when displaying all tasks of any user the file dos not appear any how and is not running.
Antivirus is off and it has no influence on the problem
i did also try with firewall off
the file keeps unkillable.

I Found a solution... as it seems, until now...
I did delete C:\MinGW
I did reinstall MinGW as as admin, in the install process i did check the option to install it for all users
I did a check for the Windows Path variable in the System Settings, just to be sure it is still there for C:\MinGW\bin.
then i did try again to compile the file Hello.c and the error did appear again.
So i did create a new folder for the source C:\My_C_Files
Now i did right click it in the windows file explorer and whent to the folder properties to play around with the file/folder permissions.
I gave wide rights to the user and all rights to the admin, namely such as allow to create subfolders read permissions delete write read change and just most to the user and the admin hat it all.
I gave also ownership to the user and admin
And all this rights i did apply to any subcontent of the folder even if it was empty.
Then i did copy my *.c source code file into this new folder.
I did try again to compile it from the CMD console, first once, as it did always work, then again, where the problem always did appear... this time it did work and overwrite the *.exe file again and again, to be sure i did delete the *.exe and recompile it and it did still work.
Conclusion: It has some thing to do with the Folder Permission of the Source or Destination Folder and the permission of its content and/or the Ownership of the desired folder.
now i have no longer ld.exe or collect2.exe - permission error's as returned 1 exit status with gcc.
May this info will help others who get into this error, i saw some on google, most say the app is running but this was not the case, others suggest to enable some windows services which did not help me, others talk about permission but mostly vague hints, some talk about symlinks and other crazy stuff. Here is what i found, windows permission to folder and content for user and admin.
Thanks to every one who did try to help me.

Related

Uiautomatorviewer Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist

i can launch Uiautomatorviewer sucessfully, inspect any page/app at personal profile.
Once phone at work profile/launching any app installed under work profile then Uiautomatorviewer throws error:
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
i am not sure why it behave like this suddenly, it used to work regardless personal / work profile last week.
i don't remember i change any configuration...
please help to give me clues why? i have followed many previous post suggestion to restart adb server, kill appium server, restart phone/laptop, disable enable developer options...etc. none works....
I tried to inspect personal profile now, the same error occurred:
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
updated: i used appium studio inspector and it works. I still not sure what happened to adb or uiautomator via command line? how do i debug it?
found an answer
com.android.ddmlib.SyncException: Is a directory
try doing adb shell rm -rf /data/local/tmp and rebooting the phone first. it's ok if you get rm: /data/local/tmp: Permission denied. ignore it - it's for the tmp folder itself after its content was already removed (that's what you need anyway)

AppX Installation Failed with errror message "The system cannot find the file specified"

I have created appx using MakeAppx tool. During sideloading, i am getting below error.
I knew Windows Apps are gets installed at location "C:\Program Files\WindowsApps"
and normal user won't have ownership for this folder.
Does I need to change the ownership for "WindowsApps" folder?Looking for the solution to this problem as we can't expect from user to change the ownership to install appx.
Today by just turning off the windows defender smartscreen security in RS3 machines,appx gets installed succefully without internet which i want.So marking this as resolution.Thankz for input#Sunteen😄

Setting up ArangoDB cluster wihout DCOS

I'm working on setting up an ArangoDB cluster in an Ubuntu machine based on these instructions :
https://docs.arangodb.com/3.0/Manual/Deployment/Distributed.html
I keep getting the below error when i execute the first command in the above documentation with sudo. I ensured that all the directories
pointing to in the /etc/arangod.conf file has the required permissions. Please can you let me know if i'm missing something here.
Below is the error i get :
2016-08-23T07:29:52Z [26629] FATAL unable to create database directory: Failed to create directory [agency1] Permission denied
The command passes the database directory on the command line (agency1) and arangodb doesn't seem to have rights to create agency1 in your current working directory.
Either provide a proper working directory on the command line or specify one in the config file.
You need to first change the directory to /var/lib/arangodb3 or whatever data directory you have set and then run the command.

Error when execute within a TFS build definition

When I tried to call command-line to get latest update for my TFS mapped folder
TF get /recursive
The call complete successfully from the run window of Windows 7.
However, when I put the call into a .bat file and run it via InvokeProcess within a build definition (guide to do that), it failed.
The message is as below.
Unable to determine the workspace. You may be able to correct this by
running 'tf workspaces /collection:TeamProjectCollectionUrl'
What happens? How can I get around with that?
The reason this is happening is because when you run the command locally, the folder you're downloading is mapped to a workspace. When you execute the command in your build, it's running under the build service account, which doesn't have a workspace mapped for the folder you're specifying.
You shouldn't need to use the tf get command as part of your build. When you configure your build, you can specify which folders should be mapped in the workspace on the "Source Settings" tab. The build process will handle making sure the contents of the folders you map in your workspace are present automatically.
The cause for my issue is that the build agent execute my .bat file under a different Windows account which is something like NTSERVICE; when I run it directly, my TFS login account was used (which was previously remembered in Windows 7 Credential Manager)
So the solution is to put in the login name and password as TF get /login:SomeTFSUsername,SomePassword (see more here)

Getiing error message 'Failed Installing JBAS50SVC' whle running service.bat file in Windows 7

I need to run Jboss 7 as service.
Followed these steps :-
Copied my Jboss to C:\Program Files <86>
Downloaded Jboss-native-2.0.10-windows-x64-ssl and copied the contenst of bin catalog to %JBOSS_HOME%/bin
Changes done on service.bat as per link instructions
https://community.jboss.org/message/724488
Changed my dir location to my Jboss bin
and given command service.bat install
C:\Program Files \jboss7>bin>service.bat install
Failed installing JBAS50SVC
Access is Denied.
Service JBoss Application Server 7.1.1 installed.
I'm not able to rectify this problem .
It appears to be windows access issue.
Try the following:
Does the windows ID you are using have Administrator privileges? If no, get a Admin ID else if Yes, proceed to step 2.
Try to do the same but in some other drive (not c: )
UPDATE #1 : OP says he can not see the output of service.bat file
Follow the following steps
Open start menu
Search for "cmd"
Right click "cmd" and run as Administrator
type in following command
cd C:\Program Files \jboss7\bin
Type service.bat and observe the output
On a 2008 Windows Server this occurs because you're not running the command line as an administrator. Those of us who have spent considerable amounts of time on 2003 server, and others before that, keep forgetting that your logged in ADMIN level account does NOT get passed to the command line automatically like with previous versions of Windows.
With any additional errors, past this one, I would keep going back to the service.bat file and looking at the path statements, throughout that file, to ensure that they are all correct to reach what is correct for your installation.
Also, don't forget to create a log folder under standalone (unless you're doing a domain install). Failure to do that will also cause issues as well.
yoda

Resources