Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have downloaded a source code and can't get my head around to how can I compile it/open it in VS 2017. It should have been straight forward but nothing worked until you create a new project. If I just open a C file in VS, it just show me the file and there's no way to run it. Imagine I wrote a simple Hello World in C and I have its C file. How could I open and run it in VS? The only way I found was to create a new project and copy/paste the code from my C file into the newly generated file by VS. This gets extremely inefficient with large projects having multiple C/h files :/
Yes, you should Create a New project -> Visual C++ -> Empty Project. After that, you will see in the solution explorer (Resource files, Header files, and Source files) folders. Right click on Header files and Then Add -> Add existing items, Then you can select multiple header files. Follow for source files same as header files that you Added
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is there anyway to compile C++ source files in Linux and make these files unreadable to users? Either have the files encrypted or read them into memory is acceptable.
We are developing a Linux based software and we don't want our users to have direct access to our source code files.
Once a binary is created from C++ source files, the original source files are not needed in order to run the program. You can distribute only the compiled program.
Just build a container image with your software and its dependencies and run it anywhere. No need to distribute sources or compile for specific distributions.
You can use Flatpak or Docker, for example.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
it is possible to include headers files intro visual studio wihtout #include preprocessor ?
I mean, i have a .cpp intro a visual studio project, and i don't want to use #include intro header file or source file. I want to be included automatically.
I mean some Windows header files are included automatically.. Soo i think is possible with files from my project too..
Best regards.
Having some kind of global include files ain't what is recommended in C++ as you can't reason about dependencies anymore. Though it is possible with the Visual Studio compiler by using the /FI command line option.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Ok, so I create a project.
Now I create two c++ classes in that project A and B.
A has some compilation errors. B is just fine and compiles fine.
Now, when I run B, it wouldn't run because A still has compilation errors.
So, I don't like to create a whole new project just because I want to create a new c++ file (scratch to experiment on) and toggle between the two projects.
Is there any way I can just have two c++ files existing independently in a single project?
In the current scenario, how do i build/compile and run only one of the c++ file (A or B) without the other one getting compiled and run as well.
This is why I never made the transition from sublime to VS.
First Question: In Visual Studio, in your Solution Explorer, right click under your project and select "Add>New Item" and then select your code file format in the Window that pops up(C++ in your case). Enter a name for the file and then click the "Add" button.
Second Question: In the solution explorer window, right click the file that you do not wish to be included in the project and select "Exclude from Project". That file will not be compiled, but will still be visible in Visual Studio. When you want to include the file, same procedure: Right click the file, select "Include in project".
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I am working on a raspberry pi project that I have picked up from a previous groups work.
It seems that the program used to control the raspberry pi has been compiled and we can run it fine, however there is no original source code (C++) or any project files for Qt as far as I can see, below is a copy of the folder, is there any way to get at the source code using Qt or something else?
We want to be able to make changes to the program.
There is no documentation on the build of the software, only indication on how to run it which we can do fine, I am trying to track down the authors but to no luck.
What can I try? I tried opening the files here with http://codelite.org/.
All of the object files and the turbo_gui file just contain one line: ELF SOH SOH SOH
On the image you posted, the directory is a Qt build directory, not a source directory.
The folder you showed contains some source files automatically generated by Qt, some compiled .o files and a linked binary, but not the original source code.
If the authors didn't publish the original C++ source code, there is no way to get the exact source code back. You should ask the authors to send you a copy of the source code.
If there is no way to get the source code, the best you can do is use a disassembler or decompiler (such as Hex-Ray's plugin for IDA) to get an idea of how the code works, then reimplement it yourself.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I can't for the life of my get this code to compile. I have it running fine on all other computers, but I had to switch to a windows machine and I am attempting to add sqlite3 back to the included header files and it is nothing short of a nightmare.
I have downloading the proper files, installed it correctly, the header file is being found in Visual Studios, but I am getting a ton of unresolved externals. I found that I need to create the .lib file myself and then I should be all set. I went ahead and tried using the LIB.exe included within Visual Studios on the .def file ( I have the .def, .dll, .c, and .exe file), and I get the error that it is unable to open sqlite3.lib. Am I using the wrong command or something? I have spent hours looking it up and I believe I am doing it correctly.
My command is LIB /DEF:sqlite3.def
Should I be using something else? I do not have any object files, just the def file.
The suggested way of using the SQLite library is to embed it directly in your application, i.e., download the amalgamation source code, and just add the sqlite3.c and .h files to your project in the sample place where you have the other source files.