DLL External ref error
-
Hi All, I am trying to create a DLL plugin for my favorite non MS IDE and I am getting an "LNK 2019 unresolved external symbol error" when ever it gets to a function call to another file that came with the IDE I am trying to modify. I have included the header file that has the external function declaration in it, in my .c file but it doesn't seem to be working as expected. The code was written in C I am using VS.NET to compile it as C code. Any clues out there? This is my first attempt at writing a DLL. Thanks for the help in advance. Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
-
Hi All, I am trying to create a DLL plugin for my favorite non MS IDE and I am getting an "LNK 2019 unresolved external symbol error" when ever it gets to a function call to another file that came with the IDE I am trying to modify. I have included the header file that has the external function declaration in it, in my .c file but it doesn't seem to be working as expected. The code was written in C I am using VS.NET to compile it as C code. Any clues out there? This is my first attempt at writing a DLL. Thanks for the help in advance. Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
Usually, you must link to the .lib file that goes with the .h file, unless all functions and methods are inline. Check the documentation.
-
Usually, you must link to the .lib file that goes with the .h file, unless all functions and methods are inline. Check the documentation.
Thanks for the response. Unfortunately the documentation is virtually non existant. I have been trying to get this to work for the last three days. There is only one .lib file and I am linking to that and two .h files in different default directories that I have to include. I am kind of at a loss. I have spent most of today playing with the compile and link settings. Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
-
Hi All, I am trying to create a DLL plugin for my favorite non MS IDE and I am getting an "LNK 2019 unresolved external symbol error" when ever it gets to a function call to another file that came with the IDE I am trying to modify. I have included the header file that has the external function declaration in it, in my .c file but it doesn't seem to be working as expected. The code was written in C I am using VS.NET to compile it as C code. Any clues out there? This is my first attempt at writing a DLL. Thanks for the help in advance. Jeff Patterson Programmers speak in Code. http://www.anti-dmca.org[^]
I am afraid Michel Prévost is right. You need the right .lib. But I have some questions you need to ask you self. (1) If you are writing add-in using C++ (you did not say), then are you are you making sure you are using C linkage (non-mangled names). Example: When using Visual C/C++ or Visual C++ you need to use #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif ether in the header file or surrounding the include C header file. (2) Does the library you are attempting to use have the same name as the .dll, If not it is the wrong library and you have a major problem. (3) If you do not have the right library is there any way that a library can be created from the existing .dll file? Well I do not know for sure, but I may have seen an aticle on doing that on this site or some where else. (4) If all else fails contact the company or developers of the IDE you wish to add-in to. On second thought may be you should have tryed this first. Well I have no solution but I hope the above will give you some direction. Trust in the code Luke. Yea right!