help regarding inheritance
-
HI all! I m calling a function by a pointer of an external class & that pointer has been defined in the parent class of the class from which the already specified function is being called. The pointer's class is linked with the parent class (through its header). So, the scenario is that a function accesses the protected member of a parent class (pointer) & then uses that member to call a function. Now, when i compile the code, LNK2001/LNK1120 error is thrown. Can any body tell me y this problem occured & what about its remedy? Regards Usman Arif Usman Arif
-
HI all! I m calling a function by a pointer of an external class & that pointer has been defined in the parent class of the class from which the already specified function is being called. The pointer's class is linked with the parent class (through its header). So, the scenario is that a function accesses the protected member of a parent class (pointer) & then uses that member to call a function. Now, when i compile the code, LNK2001/LNK1120 error is thrown. Can any body tell me y this problem occured & what about its remedy? Regards Usman Arif Usman Arif
External as in not part of your project ? Have you linked to the appropriate .lib files ? Christian Graus - Microsoft MVP - C++
-
External as in not part of your project ? Have you linked to the appropriate .lib files ? Christian Graus - Microsoft MVP - C++
External means another application. infact, i m integrating the dll of my project in an application (external). Now, in the next step, i m trying to access a class from the external application. For this, i included the header in my project. It worked fine uptil now. But, when i try to access a function from that external class, the linking error was thrown. Usman Arif
-
External means another application. infact, i m integrating the dll of my project in an application (external). Now, in the next step, i m trying to access a class from the external application. For this, i included the header in my project. It worked fine uptil now. But, when i try to access a function from that external class, the linking error was thrown. Usman Arif
OK, so you need to take the .lib file from when you build that external dll, and link to it. Christian Graus - Microsoft MVP - C++
-
External means another application. infact, i m integrating the dll of my project in an application (external). Now, in the next step, i m trying to access a class from the external application. For this, i included the header in my project. It worked fine uptil now. But, when i try to access a function from that external class, the linking error was thrown. Usman Arif
Hello Mr arif, you misunderstood MR Graus. He is saying that you forget to include .lib file which contain the runtime symbol for you external class(i.e. class from DLL).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Hello Mr arif, you misunderstood MR Graus. He is saying that you forget to include .lib file which contain the runtime symbol for you external class(i.e. class from DLL).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
The external application, i m using, has an .exe file as its output file. I converted the output file to .lib file & then included it into my project, but the error is LNK1136 ,i.e. "Invalid or corrupt file". Usman Arif
-
The external application, i m using, has an .exe file as its output file. I converted the output file to .lib file & then included it into my project, but the error is LNK1136 ,i.e. "Invalid or corrupt file". Usman Arif
Usman Arif wrote: The external application, i m using, has an .exe file as its output file. Buddy I am here talking about .LIB file which will produce with the DLL (when you build it). you can find that .lib in DEBUG/RELEASE folder of DLL project
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
-
Usman Arif wrote: The external application, i m using, has an .exe file as its output file. Buddy I am here talking about .LIB file which will produce with the DLL (when you build it). you can find that .lib in DEBUG/RELEASE folder of DLL project
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta
Friend! That .lib file is already there, no problem with that. My problem is that i wanna access the external application's (in which .lib of my project was included already)function from my project. now, r u clear with my problem? if yes, suggest some remedy for it; if possible. Usman Arif