What to do about MinGW missing Core Audio headers? - c

I'm currently trying to build a little C app using Eclipse CDT and MinGW, however I've hit a snag.
I'm looking for devicetopology.h among other header files which were introduced as part of the Core Audio API in Windows Vista.
My question is really "why are 4 year old headers still not in the mingw win32api" - not in the ungrateful sense but more along the lines of is there some technical reason why MinGW can't make use of those libraries?
Any missing defs that I've encountered so far I've just defined in my own source, but I'm apprehensive about importing an entire .h file and I'm unsure of where I'd even source such a file other than the Windows SDK which I imagine was designed to compile under VC. I've found a project called PortAudio (http://www.portaudio.com) which has the headers in their SVN but wished to understand the reasons why the headers aren't included in the first place instead of copy paste coding.
I'd just use VS C++ Express to solve this problem, however I missed some of the features which were gimped the last time I used the C# Express version.
Thanks for any help!

To your last comment - what's missing from Visual C++ Express that you get from using MinGW instead? Note that you can also drive the compiler included with VC++ Express (or the compiler that comes with the Windows SDK) from any IDE that supports driving a command-line build - which is what I'd guess you have to do with MinGW, too.
If it's debugging capabilities that you're looking for, the free Debugging Tools for Windows package that comes with the Windows SDK is quite capable (though the VC++ Express debugger is pretty nice, too).
VC++ Express doesn't have MFC, but then again neither does MinGW. So what's missing from VC++ that's hanging you up?

Related

Visual Studio Code does not include C header files

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.

How to compile a program in c with a fresh copy of windows? No External Software

Is there any way to compile some Windows API code without installing any development environments to Windows?
Does Windows come with a C Compiler built in that I could just write some code in notepad, and run it through a cmd or a batch file?
.NET includes a command line compiler for C#. (not exactly what you asked for, but it might suit you.) I believe .NET is preinstalled on modern versions of Windows. Look in the folder \Windows\Microsoft.NET\Framework\v4* and see if you have a file called CSC.EXE. This is the command line compiler for C#.
See
"How can I compile a .NET project without having Visual Studio installed?"
Working with the C# 2.0 Command Line Compiler
Is it possible to install a C# compiler without Visual Studio?
For more information and examples.
You can also get the free version of Visual Studio that supports C++. Download Visual Studio Community 2013
No version of Windows I am aware of comes with a C compiler.
No, Windows does not come with a C compiler.
And I don't mean to sound patronizing, but why do you think it'd make sense for it to come with one? Sure, it'd be handy --- if it were a decent compiler --- but beside that, it is not required for normal OS operation. An optimizing compiler is a complex piece of software that would not see any use at all from most users (since most users aren't developers --- and even they might prefer using a compiler of their choice instead of something that just happened to be around).
I should note that at least some Linux distros also come without a compiler by default (as long as it's not needed as a dependency for something else --- which, granted, can happen easily).
As others have pointed out, Windows does not come with a preinstalled C compiler. There are several good free one available for download (including a freeware version of microsoft visual c), but that does not mean you can't access with Windows API/SDK.
If you need to make API/SDK calls without the requirement you install anything, you can use Windows Script Hosting https://en.wikipedia.org/wiki/Windows_Script_Host. It supports a number of languages out of the box, such as Jscript, VBScript, and has the ability to add even more options. Using Windows Script Hosting you can create any call you require into the Windows API/SDK.
Newer versions of windows have started to move towards powershell which is even more powerful -- but is not yet universally available which might mean having to install addition software (which I assume is what you are trying to avoid).
I think you may want Visual Studio Express.
http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx
You do not mention which version of Windows. Also Windows API calls are customarily built with Visual C++. Although you could build with C# or VB.NET and wrap the calls. As another poster mentioned, if your version includes a .NET, then there are command line building tools available

invalid configuration file in turbo c when using project

I'm trying to use my project file in c, but it wont let me do it, it gives invalid configuration file then shows the directory of my project file.
I am using Turbo C simulator for windows 7 64 bit
I already tried to re install it but same error keeps happening, i can run normal files though just cant include my project file.
Do yourself a favor and install some worthy compiler. There are alot of options available on the market. I prefer Microsoft Visual Studio.
Some free worthy compilers:
Microsoft Visual Studio Express
Code Blocks
Eclipse
Turbo C is a old version any way you want a solution how to create a project file without error see this video:
https://www.youtube.com/watch?v=KAdlaYclkvg
It may help you, follow each and every step carefully it's better not to use turbo c++. use dev c++ or code blocks for better management of project files.

Dos.h + Pc.h in C and Windows Vista

I am currently looking to work with Mesa3D to create a software rendered graphic application with OpenGL.
I am looking a a few tutorials right now on how to use it, and many are written with DOS or older versions of Windows in mind. As I run Vista I don't seem to have the right files I need.
The Mesa3D tutorial I am using uses outportb() and a few other commands which I can't seem to get working. After looking around I have found you require the 2 include files:
dos.h
pc.h
These do not seem to be found within the Window's SDK that comes with Visual Studio 2010 (Express) or even the older version of 2005 (Professional) which I currently have.
They seem to be found with the DJGPP compiler that only works under DOS and is not supported in Vista, even with compatability mode. Running DosBox still does not get this to work.
I am wondering - is there perhaps a new functions replacing outportb or can I use these DJGPP files with my C/C++ complier with VS or PellesC (which I find better for C-only programs)?
In addition the conio.h include file I have with both VS and PellesC doesn't have the textmode() function, but the DJGPP version does.
If anyone could help either getting DJGPP working on Vista or allowing me to use the dos,pc and conio.h files from DJGPP with either VS or PellesC that'd be a great help!
Port-manipulating functions will simply not work in Win32 programs. Either use Win32 APIs to do I/O (rendering included) or stick to DOS and run your program in DOS or whatever DOS emulator you can find that works. Vista and later Windows won't run most DOS programs directly as the support for DOS is either severely reduced or removed altogether (e.g. in 64-bit Windows).
The low-level hardware access that functions like outportb give you is not available to programs in modern Windows environments. Such capabilities are reserved for specially-trusted code (OS internals and drivers). You need to go through higher-level APIs or drivers in order to access the same functionality.
The Mesa3D website has a readme for Windows developers that has information about what you need to install and configure. It also references some official demo code that you can use as the basis for your project. The Mesa3D website also has a repository full of demo programs that will probably serve as better examples than the out-of-date tutorials that you mentioned.
Do not use 16bit compilers on vista and higher.. instead use DOSBOX to run your programs.

Good IDE/compiler for simple C dll's

I'm trying to disassemble a C/C++ DLL, and have made some progress, but I would like to create my own C DLL with the same function the original exports, and compare disassemblies.
Visual Studio adds to much crap, and when I remove the crap and build my project, the expected DLL is missing.
I need a lightweight, preferably IDE, tool to edit and build very simple C libraries.
Take a look at Code::Blocks
I need a lightweight, preferably IDE, tool to edit and build very simple C libraries.
I have found that one of the best ways to do integrated C-only Win32 development is using the freely available Lcc Win32 Compiler which comes with a built-in IDE, including resource editor.
In fact, it is really very lightweight and can be run from a USB stick with some manual tweaking.
It's indeed a really small download of just 6 mb and you can even download an optional Win32 API help file which is really useful while doing development.
The compiler also comes with a C tutorial, as well as good user documentation detailing how to use the integrated Win32 resource editor "wedit", there's also an advanced manual about more complex development tasks.
Dev-C++ is a nice and fast IDE which works well with MingW.
But it's all been asked and answered before ...
MinGW adds its own crap. Install your VC express properly and save yourself a lifetime of trouble.
Btw, you don't need to use Visual Studio for its compiler or vice versa. The oddity of missing a build dll is probably because you are not looking at the right path.
If you are building C DLLs you really would benefit from its command line toolset and utilities, sdks, easy config etc. MS lock-in proprietary extensions are widely used (in context of you trying to emulate another dll), and last thing you need is chasing cross compiler issues..
GCC + any text editor such as VIM is a very light alternative.
For Windows Development, all you need is inside MinGW
Edit: If you are in dire need of an IDE you can also use the MinGW tools from Eclipse with the CDT plugin. Although it adds weight to the solution because of the installation of Eclipse, this is what I really use to build my small DLLs (JNI wrappers in my case).
You can setup your small and direct makefiles or let Eclipse do it automatically for you and concentrate only on the source files (*.h, *.c).
The best part of using this approach instead other IDE is that you do not need Eclipse to further build the DLL, since the underlying project files generated are standard ones directly usable by integrated dev inside MinGW (or any Unix distro) such as make, configure, automake, and so on.
I'll second the vote for Code::Blocks, it's what I use (despite having VS 2008 installed as well). It is very simple and lightweight but has basically all the features you'd expect out of an IDE. It comes with several predefined project templates for all kinds of C and C++ development, including templates for DLLs.
Download the version that includes MinGW and you get a complete lightweight IDE ready to start compiling. You can also easily configure it to use the Visual Studio compiler instead of gcc if you prefer.
try Open Watcom. A cross-platform product, well-supported by the community, lets you develop in DOS, Windows, OS/2 etc for a lot of platforms. Version 1.8 was released recently. Has a light-weight IDE indeed

Resources