I Don't Know How To Use/Run These Files That Are In A Github C++ Library I'm Trying To Add To My Project? - c++

https://github.com/gladosconn/ecdsa_cxxI have been trying to get this library into my project (C++ using Visual Studio 2022, in Windows) because I need to use the ecdsa signature algorithm, I have copied all the files in src folder to a folder called "ecdsa" in the src folder inside my project, and I didn't do anything with the test folders (I think that I don't need them since they're just tests), but then there are these files (.ytml) ,(.txt) ,(.py), I have no idea what am I supposed to do with them or where to put them, but I sure I need them because the program isn't working, it's giving me this error Cannot open include file: 'secp256k1.h': No such file or directory Libraries.Also I have done everything in the requirements section, my compiler supports C++11, and I have installed openssl, and I have CMake installed.This is my first time using anything from Github so I'm sure what to do.

In Visual Studio, right-click on your project in the Solution Explorer pane. From the menu that pops up, choose the 'Properties' item. It is usually at the very bottom. A dialog box will appear.
In the left pane of the dialog box, expand the options Configuration Properties > C++ > General. Now, in the right pane of the dialog box, probably at or near the top will be an item labeled 'Additional Include Directories`. Add the full path to the folder where you copied the source files from GitHub.
You may need to explicitly add ALL the files you downloaded from GitHub into your Visual Studio project.
Try compiling again.

Related

How can I tell Visual studio where my additional .dll files are?

I have recently switched my IDE to Visual Studio 2019 for C++ projects. I easily followed a tutorial into setting up a new library like SFML into visual studio, and tell it where the additional include and library directories are.
But there is something else that is required for it to work, which are the .dll files. Every page I followed, even the Documentation by the SFML website, it says that they have to be in the same directory as my project. That means I need to copy-paste the 7-8 files into my project directory. This really makes the folder look untidy. I would like to create a new folder and tell Visual Studio where those files are. I tried going doing this
Project -> Properties -> Linker -> Input -> Additional dependencies
Usually, the lines that would work are
sfml-system-d.lib
sfml-window-d.lib
...
I tried doing $(ProjectDir)valid path\ sfml-files.lib but this gives me the linker error, saying that It could not find the file.
If I simply move the .dlls into a folder without doing anything, the code would compile and link fine. But when it runs, Windows gives me a pop-up box with the same error message.
Here is how it currently looks
Looks really messy, I just want to be able to move them into dependencies like how src contains the source files.
How can I achieve this?
As it is now, it works perfectly fine. The issue only occurs when I try to create a new folder.
I hope I have covered the important information required for a good answer, If not please let me know what more I should add
Microsoft Visual Studio 2019
Currently running 64-bit platform with Debug configuration. Hence the -d suffix
You could create a path environment for your specified directory, which is like drescherjm’s suggestion. The steps:
Right-click “This PC” -> “Properties”-> “Advance System settings”
Click “Environment Variables”
In the System Variables group, edit “Path”
Add your directory, for example: ”D:\ SFML-2.5.1\bin”
Restart your visual studio and re-open your project
The easier solution might be to put them in the x64 subdirectory. This allows you to have various builds side by side (x86/x64, debug/release).
Since this x64 directory is where the EXE is located, it is the first directory searched for DLL's. It will take precedence over the Path solution suggested in the other answer. The Path directories are searched last of all.

Add Image to Assets Folder UWP C++

Why can't I add images to my UWP assets folder? I usually use C#, but I have to use C++ because I'll eventually be turning this into an optional package (somebody tell me if I'm wrong, and I can write optional packages in C#).
Using Visual Studio, I right click on the Assets folder in the Solutions Explorer click Add->Existing Item and then click on my image. It shows up in Visual Studio, but it doesn't actually get added to the Assets folder so I'm unable to view it when I load my app. I wouldn't think that it matters whether I use C++ or C#, but one is working and not the other.
I've tried rebuilding the project, rebooting the computer, repairing Visual Studio and I'm still stuck.
As suggested by paxbun, I tried using File Explorer to add the file. If I added the file in the Assets folder with the project files, it didn't help. I was able to get the code to work by adding the file to the AppX folder in the Debug folder, but this won't help when I'm ready to release (to make sure, I did a quick sideload).
I haven't put much at all in the code, but you can view it at https://github.com/benjasperson/SimpleCPPImage
Upon further research, I found my answer here.
Clicking "Show all files" in the Solution Explorer and then setting "Include in project" to true was all I needed to do.

Multiple file compilation in visual C++ 2010

I have a very specific question in regards to visual C++ 2010 express. I have looked everywhere but can't find instructions on how to compile several source files. I have programmed on Unix at the command line and am trying to learn visual C++ 2010. I am using a header file that contains the function declarations and global variables. I don't know if this is the correct venue to ask this question but if anyone knows of some place where I can get the answer I would be grateful
Thanks,
Ral
If you have a project that you build from the command line with a makefile, then the Visual Studio development environment will not recognize your project. To open and build your project using Visual Studio, first create an empty project containing the appropriate build settings using the Makefile Project Wizard. You can then use this project to build your project from the Visual Studio development environment.
The project displays no files in Solution Explorer. The project specifies the build settings, which are reflected in the project's property page.
The output file that you specify in the project has no effect on the name that the build script generates; it declares only an intention.
Source: Creating a Makefile Project (VS2013)
On the menu: File->New->Project
On the dialog:
select Win32 Console Application,
enter Name ( like you did in the -o in unix) in the bottom,
and press OK
On the next dialog: Press next.
On the next dialog:
unmark Precompiled headers
mark Empty project
press Finish
Now find the Solution Explorer tree. You have Solution name and a project with the same name in it.
Right click on the project (not solution)
choose Add->Existing Item
and select your files, (you can copy them to the opened folder and then choose them)
press Add
Now you can try to compile.

Eclipse CDT add existing source without copying

I have a C++ project proj1 with some source files in, however I would like to also use some of the source files I have in another project proj2. proj1 and proj2 are both subdirs of a directory my_projects. I don't want eclipse to copy the files as I want to ensure I have only one copy to edit. This is like the "add existing item" option of MS Visual Studio.
The end result I'm aiming for is to be able to create makefiles for both proj1 and proj2, zip up the two directories together and send them to coworkers so they can build the two projects themselves using make.
Is this possible in Eclipse? I've searched and haven't found the solution.
Phil
If you have proj2 open in Eclipse right click on the project and choose Import... and then select General > FileSystem and hit next. In the top window choose the directory in proj1 that contains the resources you want to link. After selecting the files you want to link in the top window hit the Advanced button to open up a submenu and select Create Links in Workspace as shown in this screenshot:
This question addresses setting up a Makefile with relative instead of absolute paths: Getting Eclipse CDT to use relative include paths in generated Makefiles
I looked forever for a solution to this, and I finally found it. Right click on the project and select Build Settings. Under the Build header on the left click "Settings". Then under the "Tool Settings" tab click "Directories" under the compiler header. Then click the add button at the top. If the desired files are in another project in the same workspace click the workspace button and then navigate to the exact folder where the files are. Once you have done this voila! you should be able to build the project!

How to create a DLL with SWIG from Visual Studio 2010

I've been trying for weeks to get Microsoft Visual Studio 2010 to create a DLL for me with SWIG. If you have already gone through this process, would you be so kind as to give a thoughtful step-by-step process explanation? I've looked everywhere online and have spent many many hours trying to do this; but all of the tutorials that I have found are outdated or badly explained.
I have succeeded in going through this process with cygwin; but as some of you know, a cygwin DLL is not very practical.
As a result, I have .i, .cpp, and .h files that I know can create a DLL together. I just need to know how to do this with Visual Studio C++ 2010. The language that I am targeting is Python.
Step-by-step instructions. This assumes you have the source and are building a single DLL extension that links the source directly into it. I didn't go back through it after creating a working project, so I may have missed something. Comment on this post if you get stuck on a step. If you have an existing DLL and want to create a Python extension DLL that wraps it, this steps are slightly different. If you need help with that comment on this post and I will extend it.
Edit 8/19/2012: If starting with a C example, don't use -c++ in step 13 and use .c instead of .cxx for the wrap file extension in steps 14 and 19.
Start Visual Studio 2010
File, New, Project from Existing Code...
Select "Visual C++" project type and click Next.
Enter project file location where the .cpp/.h/.i files are.
For Project Name, choose the name used in %module statement in your .i file (case matters).
Select project type "Dynamically linked library (DLL) project" and click Next.
Add to Include search paths the path to the Python.h file, usually something like "C:\Python27\include" and click Next.
Click Finish.
Right-click the Project in Solution Explorer, Add, Existing Item..., and select your .i file.
Right-click the .i file, Properties, and select Configuration "All Configurations".
Change Item Type to "Custom Build Tool" and click Apply.
Select "Custom Build Tool" in Properties (it will appear after Apply above).
Enter Command Line of "swig -c++ -python -outdir $(Outdir) %(Identity)" (this assumes SWIG is in your path and redirects the generated .py file to the Debug or Release directory as needed).
In Outputs enter "%(Filename)_wrap.cxx;$(Outdir)%(Filename).py".
Click OK.
Right-click the .i file, and select Compile.
Right-click the project, Add, New Filter, name it "Generated Files".
Right-click "Generated Files", click Properties, and set "SCC Files" to "False" (if you use source-control, this prevents VS2010 trying to check in the generated files in this filter).
Right-click "Generated Files", Add, Exiting Item and select the _wrap.cxx file that was generated by the compile.
Right-click the project, Properties.
Select Configuration "All Configurations".
Select Configuration Properties, Linker, General, Additional Library Directories and add the path to the python libraries, typically "C:\Python27\libs".
Select Configuration Properties, General and set TargetName to "_$(ProjectName)".
Set Target Extension to ".pyd".
Build the "Release" version of the project. You can't build the Debug version unless you build a debug version of Python itself.
Open a console, go to the Release directory of the project, run python, import your module, and call a function!