Mar 5, 2011

When Good Libraries Go Bad

While writing some unit test code, I accidentally munged up my core library. All of a sudden I got an error that it couldn't find UserMain which is the main entry point for a C++ NetBurner Device application. However, this was supposed to be a device library. I noticed the Build Artifact settings were set as if this were now a device executable. The Artifact name actually had the name of another project and the Artifact extension was .s19 instead of .a. I changed these back and rebuilt but no luck. (Notice I also had to remove the Output prefix too, since this is for a release build and the uses of the library are looking for SyncorLibarary.a not DBSyncorLibrary.a).
Eventually, (a long time later) I happened upon the Tool Chain Editor page. Not a page you normally ever need to visit. Sure enough, the Current toolchain was set to NetBurner Device and the Current builder was set to Release ELF builder (MINGW).  Even worse, the option for NetBurner Device Library wasn't in the list. Luckily unchecking the Display compatible toolchains only brought that option (and others) back. I was able to reset it to a Device Library and after a rebuild my library built once again without problems. Whew.
I'm actually pretty confident about what caused the problem. On a separate application I had gone into the Properties, Paths and Symbols and on the References tab checked a couple of libraries that the application depended upon. I was hoping this would make it rebuild the application when I hit the Build icon when the dependent libraries had been changed. It didn't work( although it's supposed to) so I unchecked the libraries, naively assuming all would return to how it was. Didn't happen and it cost me an hour. UPDATE : Note there are two ways to get to this same References panel.You can get there as shown in the image below but you can also go there directly with the Project References tab. Both methods cause the heartache described above.

About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.