Compiling a Visual Studio dll and using it with cygwin - c

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

Related

How do I make a WinDivert program with the precompiled driver modules?

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.

POSIX-compatible regex library for Visual Studio C

I'm working on a C program which will be run in Linux and from inside Visual Studio 2010, and I'm looking for a regex library. GNU comes with a POSIX-compatible regex library, but Visual Studio, despite having C++ std::regex, doesn't have a C-compatible library. GNU has a Windows version of their library (http://gnuwin32.sourceforge.net/packages/regex.htm), but the DLLs are 32-bit only and the source code can't compile in Visual Studio (~500 errors!). My only requirement is that the end-user should not have to install anything extra, and should get the same behaviour on both platforms. I'm not picky about whether it's POSIX-style, Perl-style or something else. What should I do?
Thanks in advance.
The one library I've found that compiles with basically no effort, and is also the smallest, is: https://code.google.com/p/slre/. It's pretty basic but is good enough for my purposes. Thanks for the help, though.

Why isn't Visual Studio 2010 recognizing CUDA functions?

I just got the CUDA drivers and the CUDA toolkit 4.2 installed onto my machine with all of the standard options. I have a CUDA capable NVIDIA GPU.
For some reason, the Visual Studio compiler, despite having the CUDA files located in the Program Files/MSBuild/Microsoft.cpp/v4.0/BuildCustomizations, will not compile a simple kernel function:
__global__ void kernel(void){
//I do nothing :(
}
It registers a type specifier error on the __global__.
Is there something more that I have to do?
Also, I have been having some trouble (IDE's and I are never compatible) with Visual Studio and its want to create a ton of files. I added all of the source and header files by "Add" and selecting "Existing File," so I believe that my source files are not with Visual Studio's plethora of files.
Thank you in advance.
Did you enable CUDA build customizations and did you name your CUDA file with a ".cu" extension? To get to the build customizations in Visual Studio 2010, right click the CUDA project in the Solution Explorer and select Build Customizations.

Compile lighttpd in Visual Studio 2005

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.

How to compile a C file without visual studio

I have visual studio 2008. I have a written a small C program. I want to compile that C file in command prompt. How do i do that ? please point me to a place where i can learn more about working with projects without visual studio.
thanks
If you have Visual Studio, you also have the command line C compiler, which Visual Studio invokes when it builds your project. So you just have to invoke it from the command line.
You can also download a C compiler for free, there are a lot of options available, such as http://gcc.gnu.org/releases.html, or see http://www.thefreecountry.com/compilers/cpp.shtml
If we assume you are using the Microsoft C/C++ Compiler (cl.exe which will be in the VC subdirectory of your Visual Studio installation), open the Visual Studio command prompt (it will have appropiate paths set). In order to compile a file called "helloworld.c", type:
cl helloworld.c
For more information, see the MSDN docs.
%comspec% /k ""c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
run above code in command prompt (visual studio 2010, editor: notepad.exe recommend)
c:\temp> cl.exe hello.c
If you're talking about not using the IDE GUI, an alternative is to set up a project for your C file as you normall would and call devenv.com to compile that project. It will then pass all the required paths and settings to the compiler and linker. We use that to compile some projects on our build servers. To learn more, type 'devenv.com /?'.
Regards,
Sebastiaan
Read more about that here:
http://msdn.microsoft.com/en-us/library/ms235639(VS.80).aspx
MSDN is a great source for more information.
Lots of options out there. As mentioned by driis, there are lots of free c compilers available to download.
If you just want to compile code on a machine that has visual studio on it, microsoft offers several tools that allow command line use and project management:
Invoke the ide from the command line. You can use devenv.exe.
Use cl.exe directly (this is the c/c++ compiler and linker.
Microsoft offer a make tool (similar to the unix one) called NMake. Use this with makefiles for project management, in conjunction with cl.exe.
Microsoft have reference documents for command line building.
Another options is MonoDevelop - an open source ide that understand visual studio project files.
Compiling the 'c' file from command line is easy and you have many answers to start with. However working with projects is a different thing and you will need to have a tool that will do it. Microsoft nmake was mentioned before, but i will suggest using gnu make utility that used for managing build. It is compiler independent, old (meaning proven) and very flexible tools that will allow you to create very robust build environment.

Resources