Tom,

2008/8/26 Tom Browder <[EMAIL PROTECTED]>:
> We have been having some Windows issues with the Loki library, and
> today Ron got an error in a file that include a BRL-CAD error that was
> similar to the Loki error (something about _write not being defined).
> When we looked at the header (config_win.h) we saw:
>
> #define write _write
> ...
> // etc.

Do not include config_win.h!
That's all.

- Use a current developer package. This package doesn't contain the
config_win.h file any more.
- Do not define BRLCADBUILD or HAVE_CONFIG_H. (This would switch the
config_win.h on in common.h.)
- You might have to define USE_PROTOTYPES. This define can be set
right before a BRL-CAD header include. (You probable don't need this
with version 7.12.6. BTW, I can't recommend setting the /Za compiler
option. The MS Windows SDK won't go with it.)
- You have to define BRLCAD_DLL as before.

> Why is 'config_win.h' doing that?  We have seen earlier when debugging
> see that that conversion (user libc function names being changed to
> add an underscore in front of the name) seems to be taken care of
> automatically by MSVC++.
Look at the MSDN Libray for "_write".

A work around for this problem e.g. for other libraries may be to
redefine the function for C++:
#define write _write

#ifdef __cplusplus
#   undef write

    inline int write(~) {
        return _write(~)
    }
#endif


Regards,
    Daniel

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to