How To Use Flex on Windows - c

I apologize if this is a dumb question, but I have 0 experience with this tool and wanted to know if I'm going about using it properly. I've downloaded flex which, upon compiling my lex file, produces a C file which then needs to be compiled separately. Is this the best way to do it?

It's possible to set up a Visual Studio project that uses flex as a custom build step in order to automatically invoke flex and then compile the generated file. I taught a compilers course last summer and we have instructions on how to get flex and a sample project file available on the archived course website. You should look under the announcement labeled "Visual Studio Starter Files for PP1."
Hope this helps!

Using Win flex-bison with visual studio is quite easier and straightforward. You can find it at Win Flex-Bison.

Related

Visual Studio 2010 err# U1095, NMAKE

I'm writing a program in C using Visual Studio 2010, and I am getting the following error:
U1095: expanded command line '(here come includes-includes-includes)'.
Some of my colleagues get the same error while others do not. The only easy feasible solution I've tried is to update NMAKE itself from a shady website (NMAKE is very hard to find).
Erasing include entries helps, but eventually we hit the limit again. One hack that works is to use all the includes in a single file per Microsoft's offering and read from that file but I'd prefer to not have to do that.
Is there an official way to update nmake without installing the Windows SDK or Visual Studio 2015?
I would not recommend using anything in programming in general that you "downloaded from a shady source". That sounds like a good way to embed viruses in your shipped code unknowingly. There is no nmake standalone, so you will be forced to use the one that ships with Visual Studio.
Some things you could try:
Attempt using 32-bit and 64-bit versions of nmake and see if you get different results.
Get a more recent version of Visual Studio and see if it works better there.
Thanks a lot for your responses, guys.
Manipulations with nmake didn't help at all.
The answer is: to completely erase a sandbox and get a clean one. So it wasn't MS-VS-2010 problem standalone, but a combination of problems between MS-VS and MKS/PTC Integrity.

Package C console application (Visual Studio '13)

I wrote a basic program for my mom, and now I want her to be able to use it. Obviously, it works on my computer. Getting the .exe file from the project folder, and putting it on her computer doesn't work: it says MSVCR120d.dll is missing whenever the .exe is run. Makes sense--as her computer doesn't have Visual Studio on it. However, I tried installing the Visual C++ Redistributable Packages for Visual Studio 2013, and that didn't work either.
To be honest, I'm not looking to spending hours of time to piece this all together. This is something I will more than likely never do again--I've already done some searching and can only find subjects speaking of C++ distributions. I want a way to get the console app on her computer to work.
The more easy way is link statically. That mean embed all the needed code to the app to run, in the final binary (.exe), eliminating dependency of other libraries.
Go to Project Properties
Go to Configuration Properties
Go to C/C++
Go to Code Generation
Change Runtime Library (in Debug to Multi-Threaded Debug /MTd and in Release to Multi-Threaded /MT)

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.

What to do about MinGW missing Core Audio headers?

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?

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