I have a platform independent source code that can run on Windows and UNIX platforms. To compile the source on Windows, there is support for cygwin. But I want to compile it with Visual Studio 2005. How will I do it? What are the project settings required to be done on Visual studio and what about linking options? Will I be able to get any idea from successfully compiled source on cygwin? BTW, source code is in C language. Please someone help me on this.
Thanks in advance!
IMHO you're out of luck. If this project depends on cygwin, you most probably can't compile it with reasonable effort in vs.
Basically (for simple libraries) you should be fine by dumping all the .c and .h files into a visual studio project.
Most of the time you can just drop it to your own sources. If you want to create a library choose create new project -> new library, put all the sourcefiles in there and the library will automatically be linked with your main program.
Related
my question is very simple.
I'm dealing with portaudio with the support of ASIO drivers for a university assignment. With Visual Studio I managed to compile everything an also to create a dll and now I must do the same but with cygwin. Is it possible to use the dll created with Visual Studio 2019 with cygwin? If it isn't, there is a way to do it?
Thanks in advance
Yes, you must have myfile.h myfile.dll and myfile.lib .
your goal is to produce myfile.a and put it in lib directory.
For that there is a tool Lib2a that take myfile.dll and myfile.lib in input and give myfile.a file.
https://code.google.com/archive/p/lib2a/downloads
I recently downloaded Visual Studio Code to begin learning the C programming language. I installed the program as well as the C extension. However, when I tried to create the "Hello, World!" program, it would not run, and in the Problems menu it did not recognize the stdio.h header file, saying that I need to update my includePath. I have not been able to find any stdio.h file on my computer to link to. Do I need to download the C library files (even though I have read they should be included with the compiler), and if so, where can I find them? Or is there another solution? Thanks, and sorry if this is a stupid question, I am new to this.
I think you might be confusing VS Code with the VS IDE.
VS Code is a source editor only; that is to say that it's basically just a glorified text editor. It has the ability to load extensions and open a shell to compile the code, and there are a few extensions that let you debug the code itself, but they can be tricky to get setup and installed to work well with C/C++ code. VS Code does not have a compiler/assembler/linker nor the requisite headers or SDK's as that is up to you (the user) to install and then point to those in your settings file.
The Visual Studio IDE, on the other hand, is a complete integrated development environment that also includes the system headers and SDK's for Windows, as well as the binaries to properly compile, link and assemble your code into a binary for a Windows system (cross platform is possible as well). The Visual Studio IDE comes in many different flavors with the latest being VS 2017.
If you wish to stick with VS Code, you'll need to grab a compiler and the appropriate header files for the system you're targeting. If you wish to just stick with Windows for now, you can grab the Windows 7 SDK here or the Windows 10 SDK here .. you could even grab both and just reference the one you wish when you want. Note that the Windows 7 SDK includes the Microsoft C/C++ compiler, alternatively you can download the MSVC compiler from their Build Tools site.
There's also Cygwin in which you can use the GNU compiler, and of course Clang, which can be referenced in both VS Code and the VS IDE.
I hope that can help.
I need to use WinDivert to make a program. I'm confused how to make and compile a C program that uses the precompiled WinDivert.dll, WinDivert.sys, WinDivert.inf, and WdfCoInstaller*.dll files.
For example, if I wanted to compile the passthru example with some modifications, how do I do it?
The precompiled driver modules seem to work fine, as do the precompiled samples, but I need to make a program of my own.
Notes: I'm using windows 8.1. I have Visual Studio 2013 Ultimate and WDK 8.1 installed. I don't think it works with Visual Studio, or if it does, I don't know how.
You could try using LoadLibrary()/GetProcAddress() to dynamically load WinDivert.dll. This is a reasonably foolproof method that should work for any compiler/library combination.
I just finished a semester up of C programming for a class I'm in, and it has left me with some questions that I was hoping to get answered.
During my class we have been using GCC to compile C programs. This is all good and well, but I have a question about compiling.
What if I wanted to build a C program on Windows? There is no GCC. Is that what Microsoft Visual Studio is for?
Also, what if I wanted to compile a program and distribute it? What would I compile to distribute to other Window's users?
In summary, I know how to write C programs, but I just don't get how you would make a program to give to someone who doesn't have a C compiler and is basically computer dumb.
Thanks in advance,
Ryan
Generally you will need to do two things:
Compile your program into a stand-alone executable or binary.
a. On Windows this would be a win32 executable.
b. On Linux this would be an elf binary.
Create an installer package for your program.
a. On Windows you might use NSIS, Microsoft MSI, or InstallShield.
b. On Linux you would do well to use a packager for the distribution you want to target.
Anecodtally, it is very easy to utilize Eclipse CDT and NSIS to develop C and C++ software on Windows without needing to pay any license fees.
Eclipse CDT: http://eclipse.org/cdt/
Starter Guide: http://www.codeproject.com/KB/tips/CPP_Dev_eclipse_CDT.aspx
NSIS: http://nsis.sourceforge.net/Main_Page
Note that if you use Visual Studio then you will also need to compile in release mode and distribute the Visual Studio CRT or .NET runtime(s). It depends upon how you link to the standard library provided by your compiler.
you can get GCC for windows....
but, Visual Studio is probably a better choice.
Once you have built it, you can use something like Wix or InnoSetup to make an install program for it.
I'm running visual studio 2010 (ultimate), for C development.
I have a C library with pre-compiled dll's but I have the pdb and the source code.
However, when I right-click on a method to 'view definition' it just takes me to the header file and not the source. The same happens when debugging.
In visual studio I've added the folder with the source code to the 'source folder' configuration and I've also tried storing the pdb with the dll and the lib files.
Do I need to do anything else?
Thanks.
Visual Studio C/C++ source navigation is pathetic, and pretty much always has been. Personally I wouldn't waste valuable time trying to bend it to my desires.
VisualAssist (www.wholetomato.com) is a great 3rd party add-in, which IMO everybody using VS for C/C++ development should invest in. It has a 'goto' feature, which Just Works.
No interest to declare, just a long-term (distressingly so!) satisfied customer.