| | |
Linking errors while creating dll using ATL project
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2006
Posts: 1
Reputation:
Solved Threads: 0
hello all,
I have to create a dll file which can be used in .NET thats why i have choosen ATL project to create dll file.
Im developing dll(using VC++.NET 2005) which inturn uses Adobe XMP SDK API's. My basic intention is to use fewer API to ensure that everything goes fine.
Im new to this and as i got the idea i have included all XMP SDK header and libraries in VC++.NET. I have to include a header "XMP.hpp" use XMP API's in project. After that i could easily access the classes and methods of XMP. Even i have succedded over compilation but as soon as i starts building the project it starts throwing 100+ linking errors in .obj file.
I dont know what is going wrong with this. I have edited only dllreadxmp.cpp and dllreadxmp.h files all others as same as generated by compiler.
dllreadxmp.cpp
dllreadxmp.h
and sample errorr looks like :
Error 1 error LNK2001: unresolved external symbol "public: virtual __thiscall TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::~TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??1?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@UAE@XZ) dllreadxmp.obj
Im getting around 104 errors like this.
Any help i would be appriciated....Please do help as Im stuck over here for a long time.
Thanking you in advance.
Regards,
Arun
I have to create a dll file which can be used in .NET thats why i have choosen ATL project to create dll file.
Im developing dll(using VC++.NET 2005) which inturn uses Adobe XMP SDK API's. My basic intention is to use fewer API to ensure that everything goes fine.
Im new to this and as i got the idea i have included all XMP SDK header and libraries in VC++.NET. I have to include a header "XMP.hpp" use XMP API's in project. After that i could easily access the classes and methods of XMP. Even i have succedded over compilation but as soon as i starts building the project it starts throwing 100+ linking errors in .obj file.
I dont know what is going wrong with this. I have edited only dllreadxmp.cpp and dllreadxmp.h files all others as same as generated by compiler.
dllreadxmp.cpp
// dllreadxmp.cpp : Implementation of DLL Exports. // // Note: COM+ 1.0 Information: // Please remember to run Microsoft Transaction Explorer to install the component(s). // Registration is not done by default. #include"stdafx.h" #include"resource.h" #include<sstream> #include"dllreadxmp.h" #define TXMP_STRING_TYPE std::string usingnamespace std; FILE * sLogFile = 0; class CdllreadxmpModule : public CAtlDllModuleT< CdllreadxmpModule > { public : DECLARE_LIBID(LIBID_dllreadxmpLib) DECLARE_REGISTRY_APPID_RESOURCEID(IDR_DLLREADXMP, "{F6D970B4-3B7C-4E32-8362-00CD088324D9}") }; CdllreadxmpModule _AtlModule; #ifdef _MANAGED #pragma managed(push, off) #endif // DLL Entry Point extern"C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { hInstance; //bool a; //a=SXMPMeta::Initialize(); SXMPFiles xmpFile; // this is simple instance creation of class SXMPFiles of XMP SDK //a=SXMPFiles::Initialize(); return _AtlModule.DllMain(dwReason, lpReserved); } #ifdef _MANAGED #pragma managed(pop) #endif // Used to determine whether the DLL can be unloaded by OLE STDAPI DllCanUnloadNow(void) { return _AtlModule.DllCanUnloadNow(); } // Returns a class factory to create an object of the requested type STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { return _AtlModule.DllGetClassObject(rclsid, riid, ppv); } // DllRegisterServer - Adds entries to the system registry STDAPI DllRegisterServer(void) { // registers object, typelib and all interfaces in typelib HRESULT hr = _AtlModule.DllRegisterServer(); return hr; } // DllUnregisterServer - Removes entries from the system registry STDAPI DllUnregisterServer(void) { HRESULT hr = _AtlModule.DllUnregisterServer(); return hr; }
dllreadxmp.h
/* this ALWAYS GENERATED file contains the definitions for the interfaces */ /* File created by MIDL compiler version 6.00.0366 */ /* at Thu May 25 10:19:46 2006 */ /* Compiler settings for .\dllreadxmp.idl: Oicf, W1, Zp8, env=Win32 (32b run) protocol : dce , ms_ext, c_ext error checks: allocation ref bounds_check enum stub_data VC __declspec() decoration level: __declspec(uuid()), __declspec(selectany), __declspec(novtable) DECLSPEC_UUID(), MIDL_INTERFACE() */ //@@MIDL_FILE_HEADING( ) #pragmawarning( disable: 4049 ) /* more than 64k source lines */ /* verify that the <rpcndr.h> version is high enough to compile this file*/ #ifndef __REQUIRED_RPCNDR_H_VERSION__ #define __REQUIRED_RPCNDR_H_VERSION__ 440 #endif #ifndef __XMP_Environment_h__ #define __XMP_Environment_h__ WIN_ENV #endif #include<stdio.h> #include<string> #include<stdexcept> #include<errno.h> #define TXMP_STRING_TYPE std::string #define XMP_INCLUDE_XMPFILES 1 #include"XMP.hpp" #include"XMP.incl_cpp"//this id required to Access the XMP File APi's #include"rpc.h" #include"rpcndr.h" #ifndef __dllreadxmp_h__ #define __dllreadxmp_h__ #ifdefined(_MSC_VER) && (_MSC_VER >= 1020) #pragmaonce #endif /* Forward Declarations */ /* header files for imported files */ #include"oaidl.h" #include"ocidl.h" #ifdef __cplusplus extern"C"{ #endif void * __RPC_USER MIDL_user_allocate(size_t); void __RPC_USER MIDL_user_free( void * ); #ifndef __dllreadxmpLib_LIBRARY_DEFINED__ #define __dllreadxmpLib_LIBRARY_DEFINED__ /* library dllreadxmpLib */ /* [helpstring][version][uuid] */ EXTERN_C const IID LIBID_dllreadxmpLib; #endif/* __dllreadxmpLib_LIBRARY_DEFINED__ */ /* Additional Prototypes for ALL interfaces */ /* end of Additional Prototypes */ #ifdef __cplusplus } #endif #endif
and sample errorr looks like :
Error 1 error LNK2001: unresolved external symbol "public: virtual __thiscall TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::~TXMPFiles<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >(void)" (??1?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@UAE@XZ) dllreadxmp.obj
Im getting around 104 errors like this.
Any help i would be appriciated....Please do help as Im stuck over here for a long time.
Thanking you in advance.
Regards,
Arun
Last edited by Dave Sinkula; May 27th, 2006 at 4:24 pm.
![]() |
Similar Threads
- Creating a VB dll (Visual Basic 4 / 5 / 6)
- Dll from C++ to C# (C++)
- Wt? "compiling and linking errors" (C++)
- Linking errors of socket functions (C)
- Using MFC in a Static Library (C++)
Other Threads in the C++ Forum
- Previous Thread: Urgent help needed over here
- Next Thread: How to read Matlab Variabls in C++
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game getline givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node output parameter pointer problem program programming project proxy python read recursion recursive reference return rpg string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






