Resource File is not created from Visual Studio - c++

I'm currently writing AddOns for ArchiCAD.
Since .sln projects work with absolute paths, we wanted to try to have the same folder structure on every PC so we can share our projects with each other.
Example: Project for Room Numbering AddOn
I created a project under C:\workspace\ArchiCAD\AddOns\RoomNumbering
and the total path for every file is now C:\workspace\ArchiCAD\AddOns\RoomNumbering\...
and now everyone should be able to copy the folder structure and place the complete project folder in it and work with it.
I did this and tried to build the project on a different Computer.
When I open in vsc it finds all the files and external dependencies, but when I want to built the Project it hits me with an error:
FATAL ERROR LNK1811: cannot open input file "C:\workspace\ArchiCAD\AddOns\RoomNumbering\Build\ResourceObjects\RoomNumbering.res"
But this is a file that is supposed to be created during the built.
This is how it looks on my own Computer pre and after built.
The folder in question pre built:
The folder in question after built:
On my own Computer it creates the .res file, on other computers it does nothing (no new files get created after building).
I tried to build the Project first and then share it, so the .res file already exists. While this works, this isn't the desired way, since it still throws errors.
If it is relevant:
The projects get created by downloading the ArchiCAD AddOn Template (https://github.com/GRAPHISOFT/archicad-addon-cmake) and built it with CMake.
Does anyone know why vsc behaves that way or what I am doing wrong?
Thanks for any help and Kind Regards
Dayiz

Related

How to fix "libopenblas.dll was not found" system error on visual studio C++?

I want to use the armadillo library in my C++ code. I downloaded it, and copied both the "include" and "lib_win64" folders into a new folder in my solution folder called "Dependencies".
The include folder contained another folder within which contained all the header files.
The lib_win64 folder contained "libopenblas.dll" and "libopenblas.lib".
Now, I opened up my C++ program in visual studio, went into project properties and changed these:
I added $(SolutionDir)Dependencies\armadillo\include in the C++->general->Additional include directories field
I added $(SolutionDir)Dependencies\armadillo\lib_win64 in the Linker->general->Additional library directories field
I lastly added libopenblas.lib to the Linker->input->Additional dependencies field
The C++ program builds successfully, but when I try to run it, I receive the system error: "The code execution cannot proceed because libopenblas.dll was not found. Reinstalling the program may fix this problem."
The initial armadillo download folder contains other folders, one being an example C++ program. I run that and it compiles and executes as it should, with no system error. So, I don't think the .dll file is corrupted or anything.
I was wondering if someone has maybe had a similar issue, or knows somewhere I may have messed up and can point it out.
Any advice would be much appreicated!

What cpp file types can I delete/exclude when packaging into an install bundle?

I want to package my executable file and other needed files into an install file (using NSIS) so that other people can install and use. There are a few file types I am uncertain of whether they are needed for installation or if it is safe to delete them.
Here is a random example of the files in the project folder as well as the Debug file automatically generated by VS:
I have already deleted the .user file as I know that is not needed, but not sure when it comes to .vcxproj, .tlog, .build.cppclean, .idp, and .pdb files. Also, do I need to keep the .obj files as well as the .cpp files?
This is my first time trying to do this, I am just messing around to seeing how it all works so thanks in advance.
You generally only need the .exe. Your app might depend on custom .dlls or the C++ run-time library in which case you would bundle the custom .dlls and/or the C++ redistributable.
Your screen shots are of a debug build and you normally want to distribute a release build instead because it is often smaller and contains more optimized code.
.obj files contain the machine code for each source file and is used by the linker when it merges all the required code into your .exe.
.pdb files contain debugging information. You should not distribute them but it is helpful to store them for yourself in case you need to debug a released version of your application.
The rest of the files in Debug and Release can also be ignored.
If your project is open source then you could include the c/c++ files and the Visual Studio project files. Or you could just upload them to Github.
In NSIS you could do something like this
InstallDir $ProgramFiles\MyApp
Page Directory
Page InstFiles
Section
SetOutPath $InstDir
File myproject\Release\MyApp.exe
File mylibrary\Release\*.dll
SectionEnd
It is a good idea to test your installer on a freshly installed Windows instance. Ideally the minimal version you require, Windows 7 etc. This should allow you to verify that you have included all the files required by your application.

Project File Not Found while attempting build in Azure DevOps Pipeline

I have a solution that has 6 projects, some of which are in separate DevOps projects. I am attempting to setup a build pipeline in Azure DevOps and my repository is already located there. Regardless of location, I continue to get errors that the csproj file cannot be found for any of the projects. The build cannot continue without the csproj files (obviously).
I have tried to move the .SLN file to the root folder, inside the specific project file and still get this error. I have also looked at the relative paths in the .SLN and attempted to manually modify them without any change.
Additionally, I used the vanilla configuration for the build pipeline before attempting to change path locations etc.
Here is the structure of source control:
Source structure
The 6 projects highlighted yellow are included in this solution.
Here is the output errors from the build in DevOps:
Output errors
I also tried adding the locations explicitly without any luck. By default, the location path was just $/PermitInspector/PermitInspector which is the location of the .SLN file. (Which is where I started with the attempt to automate builds).
Any suggestions would be helpful and I would be happy to share additional information or screen grabs that might be useful, but this is all I can come up with so far.
I was able to resolve the path issues by applying path filters under the build configuration in DevOps. There is a single work space and 3 of the projects are located in a root folder within the work space and the other 3 projects were in a separate root folder. The main issue appeared to be that the solution file is located inside the second root folder so I had to explicitly define the path to the other project files. By default, the only mapped work space was to the location of the SLN file. Now if I can just get NuGet restore working for the sub-projects! Thanks again,
Correct mapping that fixed the issue

C++ Project not building. No output files are produced

I have a solution with multiple C# projects included, and a single C++ project.
The C++ project is a .NET Framework bootstrapper that should produce a native executable file. I first built the project as a single project solution, however i'm now trying to migrate it into a master solution.
In order to migrate it, I added a new project called Setup to my existing solution called Master. I then added each header, source and resource by adding new files and copy-pasting the content.
I also changed the output directory to $(Configuration)\ so that it doesn't put the Debug and Release folders in the root folder of the solution.
Now, when I attempt to build the project, it says Rebuild All Succeeded, however when i try to debug it i get the following error
Unable to start the program ~ The system cannot find the file specified
Image of error shown when attempting to debug (F5)
If i navigate to the output directories, they are empty.
This is my first attempt at a C++ project, have i made a schoolboy error?
Does anyone know how I can get this working?
I found the answer. It was indeed a schoolboy error.
I was targeting AnyCPU, whereas i should have been targeting x86.
Now that i'm targeting the correct architecture, the project builds as expected.

c++ executable program test

I have been following some tutorials for c++ game programing. I am kind of new to c++ and I'm using Microsoft Visual C++ 2010 Express IDE. I'm working on creating a game, and when I run the program through the IDE, it shows the grass sprites as expected. But when I run the .exe file from the Release folder, it shows weird images. and when I run the .exe file from the debug folder I get a grey screen. Can anybody tell me why this is happening?
I hazard to guess that your sprite images are kept as data files in your project folder. With that I offer the following premise:
The default run-location from the Visual Studio IDE is the project folder of the project which you're executing. That is, normally it executes from the directory where your .vcproj or .vcprojx file is kept (and that is often one folder below your solution directory folder, where your .sln file is kept).
If your project runs correctly from the IDE, but fails to run directly from the release folder, it is highly likely you are relying on project data files (images in your case) that are kept along side your source files in the project folder. When run from the Release folder, those files are no longer visible because your the Release folder is your working directory; not the project folder.
There are a number of ways to solve this problem, each with its own merits. A few options are:
Post Build Step
Make a post-build step for your project that copies your data files to the $(TargetDir) location with your project. These files will then be visible in the same directory as your executable.
Benefit: Its easy.
Drawback: It will always run if you click "build solution" even if the data files are "up-to-date."
Custom Build Targets
Add your data files to the project and write a Custom Build script that performs the same copy, but also establishes an output dependency file(s).
Benefit: Almost as easy as #1, but a little more tedious.
Drawback: You may have a lot of data files and each will require its own custom build step. (Note: you can multi-select all the data files in your project, and if you're creative with the built-in macros you can have them all use the "same" build rules and commands).
Embedded Resources
Add the data files as custom resources to your executable.
Benefit: Your project no longer requires data files side-by-side with the executable since they are embedded in the resource table of your EXE module.
Drawback: Custom code is required to dynamically load the custom resources from your executable's resource table rather than off-disk. It isn't difficult at all to do, but is additional work.
There are other options as well, but I hope this gives you some ideas to start with.
I use VS2008 and try to answer your question. Right click on the project and select properties on the bottom of popup, then go to Debugging under Configuration properties. You can see command you run and arguments you pass in IDE. I guess you miss some parameters.