Unable to start program - access is denied

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
bioan
Posts: 7
Joined: Wed Feb 16, 2022 10:50 am

Unable to start program - access is denied

Post by bioan »

Hello!
I want to run FreeCAD from inside Visual Studio 2022 after successfully compiling the source code on a Windows 11 Pro system.
Everything is in place, the exe files (both for debug / release) and the rest of the generated / copied library files are also in place, inside the specified CMAKE_INSTALL_PREFIX location (D:\Proiecte\FreeCAD_build\Exe\bin - in my case) , but all it happens is to receive the error from the picture attached. What is wrong? I can run both Debug / Release FreeCAD exe from the Windows Explorer , but no success starting them from inside VisualStudio. I like to be able to debug the source code.
I also run the VisualStudio 2022 as an admin but no effect.
Any idea is welcome.
Attachments
FC_error.gif
FC_error.gif (967.03 KiB) Viewed 727 times
bioan
Posts: 7
Joined: Wed Feb 16, 2022 10:50 am

Re: Unable to start program - access is denied

Post by bioan »

I managed to start FreeCAD from inside VisualStudio by setting FreeCADMain as Startup project.. Because there is no indication about this, I have to try and test different projects inside FreeCAD solution as Startup project, until this resolve the question. In the official documentation about compilation of FreeCAD there is no indication about this step and I wonder why is missing.
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Unable to start program - access is denied

Post by onekk »

bioan wrote: Sun Feb 05, 2023 8:41 am ...
As a Linux user I can't answer.

FreeCAD is running on three different OS so probably this is the cause that this information is missing.

On what Wiki page this information should go. In what context?

I fear that you are assuming (wrongly) that everyone is using Windows as OS and VisualStudio as Compiler.

Ti answer to question about where in the Wiki should go these information could you please answer:

- What is the scope if running FreeCAD inside VisualStudio? Probably debugging it?


Regards.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
GeneFC
Veteran
Posts: 5373
Joined: Sat Mar 19, 2016 3:36 pm
Location: Punta Gorda, FL

Re: Unable to start program - access is denied

Post by GeneFC »

bioan wrote: Sun Feb 05, 2023 8:41 am In the official documentation about compilation of FreeCAD there is no indication about this step and I wonder why is missing.
The wiki discusses compilation, not debugging. The entry is already long, with several options for compiling.

If someone wants to continue to debugging then it might be expected that person would already understand how to use VS.

Gene
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Unable to start program - access is denied

Post by uwestoehr »

bioan wrote: Sat Feb 04, 2023 2:05 pm What is wrong? I can run both Debug / Release FreeCAD exe from the Windows Explorer , but no success starting them from inside VisualStudio. I like to be able to debug the source code.
You have two options:
- follow the Wiki as exact as possible ;) : https://wiki.freecad.org/Compile_on_Windows#Debug_Build (Right-click on the target FreeCADMain...)
- set a custom file target. To do this, go to the toolbar button with the green triangle and click there the small black triangle at the rightmost of the button. In the appearing settings you can select a file.

NOTE: to run a debug build read section "As prerequisite for the debug build..." in https://wiki.freecad.org/Compile_on_Windows#Debug_Build. To later go back to a release build you need to do the opposite. (reason is that the OCC debug libraries nowadays have the same name than the release ones and I don't have time to find out how to change this).
Post Reply