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 : 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
using namespace std;
FILE * sLogFile = 0;
class CdllreadxmpModule : public CAtlDllModuleT< CdllreadxmpModule >
public :
CdllreadxmpModule _AtlModule;
#ifdef _MANAGED
#pragma managed(push, off)
// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
//bool a;
SXMPFiles xmpFile; // this is simple instance creation of class SXMPFiles of XMP SDK 
return _AtlModule.DllMain(dwReason, lpReserved); 

#ifdef _MANAGED
#pragma managed(pop)
// 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;


/* 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)
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __XMP_Environment_h__
#define __XMP_Environment_h__ WIN_ENV
#include <stdio.h>
#include <string>
#include <stdexcept>
#include <errno.h>
#define TXMP_STRING_TYPE std::string
#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__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
/* Forward Declarations */ 
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
#ifdef __cplusplus
extern "C"{
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

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)" ([EMAIL="??1?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@UAE@XZ"]??1?$TXMPFiles@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@@UAE@XZ[/EMAIL]) 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.


This article has been dead for over six months. Start a new discussion instead.