Seeking Windows Compiler Recommendation

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Seeking Windows Compiler Recommendation

Post by Carey »

CThinker wrote:
Carey wrote:
Bo Persson wrote:
Fguy64 wrote:I haven't used such a compiler myself, so I can't offer a recommendation., but you might find the following list helpfull to make a decision. It's a list of open source c compilers. Are you familiar with sourceforge?

https://sourceforge.net/search/?type_of ... c+compiler
And if you want it free, like in free beer, the Windows native compiler is also available at no cost (and with no source :-):

http://www.microsoft.com/express/vc/
This is going to be a stupid question because I've used VCExpress 2008....

Does it produce native executables? The previous version sure didn't. You had to install SDK's before it'd generate real code.

I knew the answer to this, but I've had a year+ brain freeze and haven't done any hobby programming at all, so I've forgotten.
Yes, VC Express produces native windows binaries.

I'm not sure what you mean by "The previous version sure didn't". All windows binaries are native. Perhaps you are referring to C# (assemblies) or VB (script).
No, I meant Visual Studio Express C++.

And in the 2005 version, it would *NOT* generate pure Win32 native programs that you could take to another computer and run without installing additional libraries and runtime support. (Don't hold me to this, but I think it was some .NET stuff that was put into the program. Some (much?) of it was .net code that was running and not real native windows stuff. I really can't remember for sure. It's been way too long to remember v2005 when I can't even remember v2008's details.)

If you wanted plain stand-alone executables, you had to install the PSDK. There was even a tiny link on Microsoft's VSE 2005 page that explained that point and told you where to download the PSDK and how to install it. I saved a copy of the page and stuck it onto a dvd along with the ISO's for the rest of the VS2005 stuff. (Origianlly the VSExpress stuff was to be a limited time freebie, so I downloaded all of them as ISO's.)

That's what I'm meaning.

From what my fuzzy memory is suggesting, I think v2008 can do plain stuff without requiring additional support libs to be installed on other systems.

Not that it really matters that much to me. I never liked the VCExpress stuff anyway. I was just trying to remember something.
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Seeking Windows Compiler Recommendation

Post by Carey »

This is what I was meaning about VS2005 (and wondering about VS2008)

http://web.archive.org/web/200703052347 ... fault.aspx

Note at the bottom the line
Build 32-bit native code applications designed for Windows using the Windows Platform SDK.
And somewhere on the download page (not archived at that particular date) it gave a small, easily over looked link on how to actually install the PSDK so it would create native code apps.

Carey
TonyJH
Posts: 183
Joined: Tue Jun 20, 2006 4:41 am
Location: USA

Re: Seeking Windows Compiler Recommendation

Post by TonyJH »

Carey wrote:
CThinker wrote:
Carey wrote:
Bo Persson wrote:
Fguy64 wrote:I haven't used such a compiler myself, so I can't offer a recommendation., but you might find the following list helpfull to make a decision. It's a list of open source c compilers. Are you familiar with sourceforge?

https://sourceforge.net/search/?type_of ... c+compiler
And if you want it free, like in free beer, the Windows native compiler is also available at no cost (and with no source :-):

http://www.microsoft.com/express/vc/
This is going to be a stupid question because I've used VCExpress 2008....

Does it produce native executables? The previous version sure didn't. You had to install SDK's before it'd generate real code.

I knew the answer to this, but I've had a year+ brain freeze and haven't done any hobby programming at all, so I've forgotten.
Yes, VC Express produces native windows binaries.

I'm not sure what you mean by "The previous version sure didn't". All windows binaries are native. Perhaps you are referring to C# (assemblies) or VB (script).
No, I meant Visual Studio Express C++.

And in the 2005 version, it would *NOT* generate pure Win32 native programs that you could take to another computer and run without installing additional libraries and runtime support. (Don't hold me to this, but I think it was some .NET stuff that was put into the program. Some (much?) of it was .net code that was running and not real native windows stuff. I really can't remember for sure. It's been way too long to remember v2005 when I can't even remember v2008's details.)

If you wanted plain stand-alone executables, you had to install the PSDK. There was even a tiny link on Microsoft's VSE 2005 page that explained that point and told you where to download the PSDK and how to install it. I saved a copy of the page and stuck it onto a dvd along with the ISO's for the rest of the VS2005 stuff. (Origianlly the VSExpress stuff was to be a limited time freebie, so I downloaded all of them as ISO's.)

That's what I'm meaning.

From what my fuzzy memory is suggesting, I think v2008 can do plain stuff without requiring additional support libs to be installed on other systems.

Not that it really matters that much to me. I never liked the VCExpress stuff anyway. I was just trying to remember something.
I wonder if you had the same problem I used to have.
I use Visual C++ 2005 Express and I had the problem where my program didn't work on other computers that did not have any Visual Studio stuff installed. However, this problem was solved when I changed my project settings:

Project -> properties -> configuration properties -> c/c++ -> code generation -> runtime library -> /MT (multi-threaded). (Not /MD, multi-threaded DLL).

After this change, my exe runs on other computers without Visual Studio.
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: Seeking Windows Compiler Recommendation

Post by Carey »

TonyJH wrote: I wonder if you had the same problem I used to have.
I use Visual C++ 2005 Express and I had the problem where my program didn't work on other computers that did not have any Visual Studio stuff installed. However, this problem was solved when I changed my project settings:

Project -> properties -> configuration properties -> c/c++ -> code generation -> runtime library -> /MT (multi-threaded). (Not /MD, multi-threaded DLL).

After this change, my exe runs on other computers without Visual Studio.
I do remember something along those lines. That caused problems for a lot of people.

I'm thinking more & more that it was .NET related issues.

If you tried to run them on a system that already had .net (or maybe something else) installed, then there was no problem. And a lot of people did have them installed, so many never noticed.

But if you tried to do it on a clean XP system then it wouldn't run.

I'm thinking more & more that it was .NET related, espeically since I found an Archive.org copy of Microsoft's own web page talking about building .NET apps with VSE and doing native Win32 after installing PSDK.

But I could be wrong. It's been a long time and I only used VS2005 a short time because I didn't like it.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Seeking Windows Compiler Recommendation

Post by Don »

jshriver wrote:What is a good free windows XP C compiler?

I'm wrapping up my cliboard application and wanted to create a windows version for distribution. I've tinkered with cygwin years ago, but didnt know what you all recommend.

Something foss friendly would be nice as I plan to release my code under an oss license.

-Josh
What is foss?

I'm using the mingw32 and mingw64 compiler to make windows executables from linux. It works great. I don't know how fast the executables are as I have no frame of reference.
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Seeking Windows Compiler Recommendation

Post by CThinker »

Carey wrote:This is what I was meaning about VS2005 (and wondering about VS2008)

http://web.archive.org/web/200703052347 ... fault.aspx

Note at the bottom the line
Build 32-bit native code applications designed for Windows using the Windows Platform SDK.
And somewhere on the download page (not archived at that particular date) it gave a small, easily over looked link on how to actually install the PSDK so it would create native code apps.

Carey
That just means that the "complete" set of windows libraries are in the PSDK. VC Express itself is sufficient to build native windows binaries. But if you want to code for things like WMI, ISAPI, etc, then you need the PSDK.
CThinker
Posts: 388
Joined: Wed Mar 08, 2006 10:08 pm

Re: Seeking Windows Compiler Recommendation

Post by CThinker »

Carey wrote:
CThinker wrote:
Carey wrote:
Bo Persson wrote:
Fguy64 wrote:I haven't used such a compiler myself, so I can't offer a recommendation., but you might find the following list helpfull to make a decision. It's a list of open source c compilers. Are you familiar with sourceforge?

https://sourceforge.net/search/?type_of ... c+compiler
And if you want it free, like in free beer, the Windows native compiler is also available at no cost (and with no source :-):

http://www.microsoft.com/express/vc/
This is going to be a stupid question because I've used VCExpress 2008....

Does it produce native executables? The previous version sure didn't. You had to install SDK's before it'd generate real code.

I knew the answer to this, but I've had a year+ brain freeze and haven't done any hobby programming at all, so I've forgotten.
Yes, VC Express produces native windows binaries.

I'm not sure what you mean by "The previous version sure didn't". All windows binaries are native. Perhaps you are referring to C# (assemblies) or VB (script).
No, I meant Visual Studio Express C++.

And in the 2005 version, it would *NOT* generate pure Win32 native programs that you could take to another computer and run without installing additional libraries and runtime support. (Don't hold me to this, but I think it was some .NET stuff that was put into the program. Some (much?) of it was .net code that was running and not real native windows stuff. I really can't remember for sure. It's been way too long to remember v2005 when I can't even remember v2008's details.)

If you wanted plain stand-alone executables, you had to install the PSDK. There was even a tiny link on Microsoft's VSE 2005 page that explained that point and told you where to download the PSDK and how to install it. I saved a copy of the page and stuck it onto a dvd along with the ISO's for the rest of the VS2005 stuff. (Origianlly the VSExpress stuff was to be a limited time freebie, so I downloaded all of them as ISO's.)

That's what I'm meaning.

From what my fuzzy memory is suggesting, I think v2008 can do plain stuff without requiring additional support libs to be installed on other systems.

Not that it really matters that much to me. I never liked the VCExpress stuff anyway. I was just trying to remember something.
There are two ways to use build the standard library in to windows binaries.

One is to statically link the standard library in to the binary. If you go this route, you don't need to have any of the MSVC DLLs.

Second is to dynamically link the standard library. In this case, the MSVC DLLs have to be present on the target machine for the binary to run. This is no different from the common Linux problem where you build a binary using a newer libc library and you run it on a linux with an older libc library.
User avatar
Jim Ablett
Posts: 1383
Joined: Fri Jul 14, 2006 7:56 am
Location: London, England
Full name: Jim Ablett

Re: Seeking Windows Compiler Recommendation

Post by Jim Ablett »

Ron Murawski wrote:
jshriver wrote:What is a good free windows XP C compiler?

I'm wrapping up my cliboard application and wanted to create a windows version for distribution. I've tinkered with cygwin years ago, but didnt know what you all recommend.

Something foss friendly would be nice as I plan to release my code under an oss license.

-Josh
The problem with cygwin is that you need the correct version of the cygwin.dll flie. Some users become confused trying to decide which dll is the right one. It's easy for a user to copy the latest version into your program's directory. If your program expects an earlier version it will stop working.

It's better for users if you use MinGW because it will compile native Windows code. But it might be more difficult for you because you won't have access to all those handy Linux utilities that Cygwin provides.

You can always develop in Cygwin and do your final build using MinGW. Alternately, there's a couple of excellent C/C++ IDEs available for Windows/MinGW development or you can use Microsoft's free IDE and compiler.

Ron

"The gcc that you get under Cygwin with compiler switch -mno-cygwin is
*identical* to the mingw gcc. It's built from gcc sources downloaded
from mingw.org. It uses the exact same mingw-runtime and
w32api sources too, in fact they share the same CVS repository. For all
intents and purposes you should bit for bit identical binary output
(assuming you pick corresponding versions of
{gcc,binutils,mingw-runtime,w32api}) for cygwin's "gcc -mno-cygwin" and
the mingw gcc.

The entire point of -mno-cygwin is to provide quick and easy access to
the mingw toolchain from within cygwin. Binaries compiled this way have
absolutely zero dependance on cygwin."
Jim.
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: Seeking Windows Compiler Recommendation

Post by Ron Murawski »

Jim Ablett wrote:
Ron Murawski wrote:
jshriver wrote:What is a good free windows XP C compiler?

I'm wrapping up my cliboard application and wanted to create a windows version for distribution. I've tinkered with cygwin years ago, but didnt know what you all recommend.

Something foss friendly would be nice as I plan to release my code under an oss license.

-Josh
The problem with cygwin is that you need the correct version of the cygwin.dll flie. Some users become confused trying to decide which dll is the right one. It's easy for a user to copy the latest version into your program's directory. If your program expects an earlier version it will stop working.

It's better for users if you use MinGW because it will compile native Windows code. But it might be more difficult for you because you won't have access to all those handy Linux utilities that Cygwin provides.

You can always develop in Cygwin and do your final build using MinGW. Alternately, there's a couple of excellent C/C++ IDEs available for Windows/MinGW development or you can use Microsoft's free IDE and compiler.

Ron

"The gcc that you get under Cygwin with compiler switch -mno-cygwin is
*identical* to the mingw gcc. It's built from gcc sources downloaded
from mingw.org. It uses the exact same mingw-runtime and
w32api sources too, in fact they share the same CVS repository. For all
intents and purposes you should bit for bit identical binary output
(assuming you pick corresponding versions of
{gcc,binutils,mingw-runtime,w32api}) for cygwin's "gcc -mno-cygwin" and
the mingw gcc.

The entire point of -mno-cygwin is to provide quick and easy access to
the mingw toolchain from within cygwin. Binaries compiled this way have
absolutely zero dependance on cygwin."
Jim.
Thanks, Jim. I was not aware of that compiler switch.

Ron
Ron Murawski
Posts: 397
Joined: Sun Oct 29, 2006 4:38 am
Location: Schenectady, NY

Re: Seeking Windows Compiler Recommendation

Post by Ron Murawski »

Carey wrote:
Ron Murawski wrote:
Kempelen wrote:
jshriver wrote:What is a good free windows XP C compiler?

I'm wrapping up my cliboard application and wanted to create a windows version for distribution. I've tinkered with cygwin years ago, but didnt know what you all recommend.

Something foss friendly would be nice as I plan to release my code under an oss license.

-Josh
Try Codeblock. It is a very nice IDE with cames with MINGW. I like it and it produce very acceptable fast code.
http://www.codeblocks.org/
Like the Bloodshed IDE before it, Code::Blocks was the best IDE in its day. It hasn't been updated in a while. If you use the wx plugin it may still be the best choice.
CodeBlocks is still being updated nearly daily.

The problem is they prefer to do new features and nightly builds rather than actually produce a stable product.

It took years of nagging by new & loyal users alike before they finally released the current version. I wouldn't be surprised if its another couple years before they release a second stable build.

As for the compiler... You can install a more recent version of Mingw (such as TDM's v4.4 builds) and have codeblocks use it instead. (For anything beyond basic compiler switches, you'll have to set them yourself.)

I don't know how well CodeBlicks works with the 64 bit version of Mingw since I've never tried it. My guess would be "not too well", though.


Of course, as always, a choice of editor or IDE is very much a matter of personal taste and the size of the project you are doing.

Personally, I like Dev-C++ for the quickie small projects. Less IDE to get in the way. It's anoying to set up with a newer compiler though.
I used Dev-C++ many years ago and liked it very much. I was sorry to see it discontinued.

I found the Code::Blocks nightly builds quite buggy. The IDE crashed on me several times. When I lost some work I stopped using it. This was about a year ago and I haven't looked at it since then.

There's plenty of (almost) bug-free IDEs and editors out there that are open-source or free. It's fun trying new ones with small coding projects. Some of them are surprisingly good.

Ron