W
wenmang
Hi,
We have the 3rd party libraries written in C. And, in every header
file from 3rd party, it has the include guarde:
#ifdef __cplusplus
#define extern "C" {
:
APIs...
:
}
#endif
:
:
To me, it is clear that the 3rd party libraries must be compiled using
C and C++ compiler should not do anything about them and linker should
take care of them at link time.
Here is my question:
Could I compile C++ program using those C APIs? What I mean here is: I
want to use aCC(HPUX) to compile everything and treat all 3rd party C
APIs as regular C functions, and I failed.
If 3rd party header files don't have extern "C" include guard, could I
succeed?
If I want to succeed, I should using C++ compiler to recompile all 3rd
party libraries(C codes), is this a correct statement?
We have the 3rd party libraries written in C. And, in every header
file from 3rd party, it has the include guarde:
#ifdef __cplusplus
#define extern "C" {
:
APIs...
:
}
#endif
:
:
To me, it is clear that the 3rd party libraries must be compiled using
C and C++ compiler should not do anything about them and linker should
take care of them at link time.
Here is my question:
Could I compile C++ program using those C APIs? What I mean here is: I
want to use aCC(HPUX) to compile everything and treat all 3rd party C
APIs as regular C functions, and I failed.
If 3rd party header files don't have extern "C" include guard, could I
succeed?
If I want to succeed, I should using C++ compiler to recompile all 3rd
party libraries(C codes), is this a correct statement?