Identifier Not Found

B

bilaribilari

Hello,
Following is a sample of the code I have:
Inside Directory 'A'
A.lib
---------
A.h
....
void func1(void*);

A.c
#include "A.h"
....
void func1(void* abc){......}

Inside Directory A_New
A_New.DLL
------------------
A.h
#include "rename_functions.h"
....
void __stdcall func1(void*);

A.c
#include "A.h"
....
void __stdcall func1(void* abc){......}

rename_functions.h
#define func1 NEW_func1

Inside Directory 'Code'
Code1.cpp
#include "A.h"
....
void * myfunction(....){
func1(.....);
}

Code2.cpp
#include "../A_New/A.h"
.....
void * myNewfunction(...){
NEW_func1(....);
}


What I am basically doing is using two versions of a library 'A'. One
is being linked statically and the new one is being used as a DLL. I
have a #define file to rename the functions of the new DLL prefixed
with NEW_ so that there are no name conflicts.
I am using Visual C++ .NET 7.1 and I am getting a compiler error
"Identifier not found, even with argument-dependent lookup".
What could possibly be the problem?
Thanks in advance.

Best regards,
B.
 
B

bilaribilari

Ok. For anyone who needs the answer:

The problem was in the fact that I was #include the old file first and
then #include the new file. In both the .h files (old and new) there
was the #ifdef __A_h__ block. So the new file never used to actually
get included and hence the #defines never used to replace the func1
with NEW_func1. So I changed the #ifdef __A_h__ to #ifdef __A2_h__ and
it worked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top