Showing posts with label gcc. Show all posts
Showing posts with label gcc. Show all posts

Monday, June 9, 2008

Link errors - Waxing the board

If XCode is to be believed I have 460 files compiling including the key file that is responsible for opening and reading the the Cello document. The next step is to wrap the "open" call in minimal snippet of cocoa and some make-shift UI. Pictured bellow is the Nib for the full FileTest UI.

The idea from here is then to surf through the link errors and, for a while, to let them drive the development. The biggest problem I can see here is that the dead-code stripping of gcc is not so good and my previous experience of the linker is that it will fail with link errors for code that is referenced but never executed.

After this my development plan is simple.
  • Once Cello links I can then work through a set of sample files testing the read.
  • When the read appears to work I can look at the file generation code and work through that.
  • When the file generation works I will work on the saving of the files. At this point I will pick up the pieces of the structured document and file compression that I have postponed.
The idea behind this approach is to get the core functionality demonstrably working and then to attack the UI.

Tuesday, May 20, 2008

typename in templates - gcc errors

Pressing on I am working through the generator files. These are a set of files that generate the output. The biggest problem I found so far in these is some template definitions that tripped up gcc which requires a typename to be specified in some circumstances where visual c++ was quite happy. The following class - when complied on XCode

template <class T>
class Foo
{
public:
  Foo(const T&);
  std::list<T*>::iterator Bar();
};
Results in error: expected ';' before 'Bar'

Adding typename fixes the problem - so the gcc friendy Bar looks like this:
  typename std::list<T*>::iterator Bar();
As with many compiler errors the error message gave me little insight into the problem. I tracked down the solution looking through the boost libraries for code that returns an iterator.