Software Development

June 26, 2008

Link error LNK2005

Was getting this error with some legacy code when converted to VS 2008:

nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMTD.lib(new.obj)

This article provided a solution

Based on Visual C++ 6.0:

Solution One: Force Linker to Link Libraries in Correct Order

1. On the Project menu, click Settings.
2. In the Settings For view of the Project Settings dialog box, click to select the project configuration that is getting the link errors.
3. On the Link tab, click to select Input in the Category combo box.
4. In the Ignore libraries box, insert the library names (for example, Nafxcwd.lib;Libcmtd.lib).

Note The linker command-line equivalent in /NOD:<library name>.
5. In the Object/library modules box, insert the library names. You must make sure that these are listed in order and as the first two libraries in the line (for example, Nafxcwd.lib Libcmtd.lib).

June 24, 2008

This application has failed to start because the application configuration is incorrect

"This application has failed to start because the application configuration is incorrect"

Was getting this message when testing an application recently converted to VS 2008 from VS 6.0.  Depends showed that MSVCRT80.DLL was a missing dependency.

Here are a few threads on the subject:

On  MSDN Forums

Nikola's Weblog

The  programs was pretty small so I felt the easiest workaround was to link statically to the C runtime library.  I did this by making sure I selected Multi-threaded (/MT) rather than Multi-threaded DLL (/MD) in the C/C++...Code Generation options.

January 22, 2008

Using Source Safe with Visual Studio 2008

Seems Source Save 2005 is still the official version to use with VS 2008.
Go here to learn more

Cross platform development between Windows and Mac

Cocoa/Windows parallel development thread
Creating Cross-Platform Applications with Core Foundation and Open Source

Cocoa funny business with NSTextView

I couldn't hide a NSTextView control until I found this articles explaining why setHidden wasn't working.

I continue to be unimpressed by Apple's documentation and tools.

Visual Studio 2008 Install

I got my January MSDN update in the mail yesterday. In it came Visual Studio 2008. The installation did not go smoothly. I got errors that it failed. I ran the setup again in "repair" mode and it got further.

I tried creating a simple C++/MFC application and it did not compile complaining of missing windows.h and winres?.h. I can't remember the letter missing from the file but it wasn't winres.h it was looking for. It was looking in ./Microsoft Visual Studio 9.0/VC/atlmfc/include.

I tried repairing again and the files did not appear. I then ran the setup, went to add/remove components and deselected the C++ MFC component, then ran it again and selected it to reinstall it. Though the files that were "missing" did not appear, something changed and when I tried building an C++ MFC app, and Win32 app, those files were not referenced and the projects built successfully. Weird. I then tried compiling a 2005 C++ MFC project I had and it built fine as well.

Relevant Links:
What's new in Visual C++ 2008
Breaking changes in Visual C++ 2008
Visual Studio 2008 Readme


December 06, 2007

MXF References

Our value proposition at DVFilm is support of the MXF file format (Material  eXchange  Format).

Here are some references about the  format:

MXF  Primer -  Go HERE and click the  Read The Primer link in the  upper left corner (I hate frames)

MFXLIB - opensource C++ library

November 24, 2007

Visual Studio 6.0 and Vista

My new Vista laptop arrived at work and Marc tells me there are problems installing Visual Studio 6.0. The official word from Microsoft?

From FAQ: Visual Studio and Windows Vista

We are supporting Visual Basic 6.0, Visual FoxPro 9.0 and Visual Studio 2005 Service Pack 1 with the Visual Studio 2005 Service Pack 1 Update for Windows Vista. Except for the 3 products above, Microsoft does not support Visual Studio 2003 or earlier.

Apparently there is a way to install VS 6.0 on VistaSome write that you simply need to run the setup.exe as administrator.  This articles has a good overview of your options for developing on Vista.

Mike says problems installing VS 6.0/SP5 can be avoided by instead installing VS 6.0/SP6.  He also recommends uninstalling the VM

The recommendation by Microsoft is to simply upgrade to Visual Studio 2005 and SP1 with the update for Vista.

October 25, 2007

Assigning software tasks

Joel wrote an article for Inc.com titled "How Hard Could It Be?: Five Easy Ways to Fail".
The issue that I have gnashed my teeth over the most is distribution of work which Joel describes as Mistake No. 4: Divide tasks equally.    If you have the luxury of being able to find and hire what Joel desacribes as "the superstars that are 10 times more productive than even excellent developers", by all means do it.  But that is not realistic in most situations.  You can build a great team with a mixture of talent.  But if you don't use the talent effectively and find a way to get the most out of each member, then you are squandering your resources.  Writing functional specs, documenting algorithms, documenting code and writing self-documenting code is the framework for ever having a chance at
having another developer be productive with code that he did not write himself.

Joel knows how to stroke the programmer with statements like this:

"Software development takes immense intellectual effort. Even the best programmers can rarely sustain that level of effort for more than a few hours a day. Beyond that, they need to rest their brains a bit, which is why they always seem to be surfing the Internet or playing games when you barge in on them."

October 18, 2007

Graphics License Cards

Interesting take on license "keys" [via Dave Batton]