Hi!
I am working with Visual C++ 6.0 on NT4.0 SP6a.
I am trying to 'integrate' Apache Xerces for C++ (xerces-c.lib) with
another tested library (another.lib).
I've got no problem working with 'xerces-c.lib' alone: I setup the environment
by going Project>Settings>Link>xerces-c.lib, creating DOMCount.cpp, compiling, ...
I've got no problem working with 'another.lib' alone: I setup the environment
by going Project>Settings>Link>another.lib, creating another.c, compiling, ...
The problem comes when mixing both. I cut&paste pieces from another.c to
another.c. I include every header files (xxx.h):
/*Includes from DOMCount.cpp*/
#include <util/PlatformUtils.hpp>
#include <sax/SAXException.hpp>
#include <sax/SAXParseException.hpp>
#include <parsers/DOMParser.hpp>
#include <dom/DOM_DOMException.hpp>
#include "DOMCount.hpp"
#include <string.h>
#include <stdlib.h>
#include <dom/DOM_NodeList.hpp>
#include <dom/DOM.hpp>
/*Standard Includes*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <fcntl.h>
#include <fstream.h>
#include <iostream.h>
/*includes from another.c*/
#include <yyy.h>
#include <xxx.h>
...but I bump into this errors:
Compiling...
DOMCount.cpp
c:\xxx.h(19) : error C2664: 'fopen' : cannot convert parameter 1 from 'void *' to 'const char *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\xxx.h(192) : error C2065: 'min' : undeclared identifier
c:\xxx.h(357) : error C2664: 'open' : cannot convert parameter 1 from 'void *' to 'const char *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Where xxx.h is a header file of 'another.lib':
line
15 void *mywrite_fopen (void *path,char *accessmodes)
...
19 if ((tfile=fopen(path,accessmodes))==NULL) return(NULL);
192 short odioreadbufs=min(8,MAXODIOBLOCKS);
350 void *myread_fopen(void *path)
...
357 if ((f->handle=open(path,READFLAGS))==-1) {
If you look at C++ specifications:
FILE *fopen(const char *name, const char *mode)
It's clear: you can not convert path from void* (in the declaration of
mywrite_fopen) to char* (in the common 'fopen' use). But WHY this error
does not happen when compiling separately? HOW can I solve it?
Any suggestion? Thanx.
I am working with Visual C++ 6.0 on NT4.0 SP6a.
I am trying to 'integrate' Apache Xerces for C++ (xerces-c.lib) with
another tested library (another.lib).
I've got no problem working with 'xerces-c.lib' alone: I setup the environment
by going Project>Settings>Link>xerces-c.lib, creating DOMCount.cpp, compiling, ...
I've got no problem working with 'another.lib' alone: I setup the environment
by going Project>Settings>Link>another.lib, creating another.c, compiling, ...
The problem comes when mixing both. I cut&paste pieces from another.c to
another.c. I include every header files (xxx.h):
/*Includes from DOMCount.cpp*/
#include <util/PlatformUtils.hpp>
#include <sax/SAXException.hpp>
#include <sax/SAXParseException.hpp>
#include <parsers/DOMParser.hpp>
#include <dom/DOM_DOMException.hpp>
#include "DOMCount.hpp"
#include <string.h>
#include <stdlib.h>
#include <dom/DOM_NodeList.hpp>
#include <dom/DOM.hpp>
/*Standard Includes*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <fcntl.h>
#include <fstream.h>
#include <iostream.h>
/*includes from another.c*/
#include <yyy.h>
#include <xxx.h>
...but I bump into this errors:
Compiling...
DOMCount.cpp
c:\xxx.h(19) : error C2664: 'fopen' : cannot convert parameter 1 from 'void *' to 'const char *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
c:\xxx.h(192) : error C2065: 'min' : undeclared identifier
c:\xxx.h(357) : error C2664: 'open' : cannot convert parameter 1 from 'void *' to 'const char *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
Where xxx.h is a header file of 'another.lib':
line
15 void *mywrite_fopen (void *path,char *accessmodes)
...
19 if ((tfile=fopen(path,accessmodes))==NULL) return(NULL);
192 short odioreadbufs=min(8,MAXODIOBLOCKS);
350 void *myread_fopen(void *path)
...
357 if ((f->handle=open(path,READFLAGS))==-1) {
If you look at C++ specifications:
FILE *fopen(const char *name, const char *mode)
It's clear: you can not convert path from void* (in the declaration of
mywrite_fopen) to char* (in the common 'fopen' use). But WHY this error
does not happen when compiling separately? HOW can I solve it?
Any suggestion? Thanx.