Linking errors while creating dll using ATL project

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 1
Reputation: agarunk is an unknown quantity at this point 
Solved Threads: 0
agarunk agarunk is offline Offline
Newbie Poster

Linking errors while creating dll using ATL project

 
0
  #1
May 27th, 2006
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.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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,401
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1467
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Linking errors while creating dll using ATL project

 
0
  #2
May 27th, 2006
you probably should post your question on adobe's "user to user" forum.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC