uknown type > AnsiString, BYTE and WORD

I am trying to put together a wrapper in codeblocks for Art-Net (dmx over ethernet). The include files they provide, when included in an openframeworks project, come up with the errors:

error: AnsiString' does not name a type error:BYTE’ does not name a type
error: `WORD’ does not name a type

Any ideas what I’m forgetting to include?

Thanks

do a case-sensitive find-in-files in the Art-Net folder for ‘AnsiString’, ‘BYTE’, and/or ‘WORD’. (if you’re on OSX, learn to use ‘find’ and ‘grep’. find . -exec grep -Hi AnsiString {} ; would do this nicely.)

My class includes DongleArtNet.h
at the top of this it has

  
  
#include "DongleArtNetMS.h"  
#include "DongleArtNetGlobal.h"  
  

In DongleArtNetMS it says

  
  
#define AnsiString OLECHAR FAR*  
  

The errors for the three missing types I get is in Art-Net.h which is included within DongleArtNetGlobal, after the definition of AnsiString.

There are no definitions that I can find in the files for BYTE or WORD

interesting…

what platform are you on? my guess is that OLECHAR and BYTE and WORD are Microsoft-specific things (perhaps even Microsoft Visual C - specific things), so compiling under anything else might throw a wobbly.

I am on windows using Codeblocks

that’s probably your problem then.

before you include DongleArtNet.h, trying going:

#include <windows.h>

if that doesn’t work, try going

typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef char OLECHAR;
typedef far FAR;

The developers have come back and said…

The drivers are written in Borland and we had to set up a Microsoft
Wrapper to enable developers to use Visual C. It sounds to me you have
to define the missing name and put that in your wrapper for it to work.

Unfortunately I don’t have any experience using your programming apps so
can’t give more advice.

Will give it a go later.

I realised that AnsiString wasnt being defined because of this statement:
#if _MSC_VER > 1000

So Ive tried

  
  
#include <windows.h>  
#define AnsiString OLECHAR FAR*  
#include "DongleArtNet.h"  
  

And the error comes back as:
ISO C++ forbids declaration of `OLECHAR’ with no type

then i tried

  
  
typedef unsigned char BYTE;  
typedef unsigned short WORD;  
typedef char OLECHAR;  
typedef far FAR;  
  
#define AnsiString OLECHAR FAR*  
  
#include "DongleArtNet.h"  
  

And the error is
declaration does not declare anything

error on the line
typedef far FAR;

Do you have any ideas?

it seems far is already defined in windef.h so i commented this out.

Now it all seems to compile, but when building it says

…/…/…/addons/ofxArtNet/libs/DongleArtNet.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status

So it hasnt recognised the lid file. Because it was built in Borland for MSC Visual c++, does that mean it won’t work with codeblocks?

declaration does not declare anything

that’s an awesome error message. :slight_smile:

(sorry for the noise)

…/…/…/addons/ofxArtNet/libs/DongleArtNet.lib: file not recognized

that’s because code::blocks is based on the GNU tool chain, which doesn’t recognise .lib files. you’re going to have to rebuild DongleArtNet from source, unfortunately; either that or give in and use MSVC++ Express (if they’re still doing that?). shame on the DongleArtNet folks for making Windows-specific code, i say…

also, seconded about the awesome error message.

although, my favourite has to be the DirectX (circa version 7/8) debug error messagebox, ‘An error occured.’, with an OK button.