Skip to Content.
Sympa Menu

charm - Re: [charm] Can I compile and link charm++ program in VC++6.0 or VS2005?

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

Re: [charm] Can I compile and link charm++ program in VC++6.0 or VS2005?


Chronological Thread 
  • From: 倪安宁 <nianning1981 AT 163.com>
  • To: <gzheng AT illinois.edu>
  • Cc: charm AT cs.uiuc.edu
  • Subject: Re: [charm] Can I compile and link charm++ program in VC++6.0 or VS2005?
  • Date: Tue, 23 Feb 2010 11:03:06 +0800
  • List-archive: <http://lists.cs.uiuc.edu/pipermail/charm>
  • List-id: CHARM parallel programming system <charm.cs.uiuc.edu>

Gengbin :

Thanks for your help, I have added the libraries defined in LINK_POST line  of unix2nt_cc (i.e. ws2_32.lib kernel32.lib user32.lib psapi.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib) to my charm++ project(called mytest). Then I builded the project in VS2005, it can be compiled successfully, but when linking, the following errors occurred. Should I add additional libraries located in charm-6.1.3/net-win32/lib/, for example libconv-core.a libck.a etc., to my project? If yes, which libraries should be added?

 

************************************

hello.C

Linking...

hello.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z)referenced in function "public: void * __thiscall LBCommData::`vector deleting destructor'(unsigned int)" (??_ELBCommData@@QAEPAXI@Z) 中被引用

hello.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)unresolved external symbol "public: void * __thiscall LBCommData::`vector deleting destructor'(unsigned int)" (??_ELBCommData@@QAEPAXI@Z) 中被引用

hello.obj : error LNK2019: unresolved external symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))" (??_M@YGXPAXIHP6EX0@Z@Z)unresolved external symbol"public: void * __thiscall LBCommData::`vector deleting destructor'(unsigned int)" (??_ELBCommData@@QAEPAXI@Z) 中被引用

hello.obj : error LNK2019: unresolved external symbol __RTC_CheckEspunresolved external symbol"public: void * __thiscall LBCommData::`vector deleting destructor'(unsigned int)" (??_ELBCommData@@QAEPAXI@Z) 中被引用

hello.obj : error LNK2001: unresolved external symbol __RTC_Shutdown

hello.obj : error LNK2001: unresolved external symbol __RTC_InitBase

hello.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Chare::~Chare(void)" (??1Chare@@UAE@XZ)unresolved external symbol__unwindfunclet$??0main@@QAE@PAVCkArgMsg@@@Z$0

hello.obj : error LNK2019: unresolved external symbol _CkExitunresolved external symbol"public: __thiscall main::main(class CkArgMsg *)" (??0main@@QAE@PAVCkArgMsg@@@Z)

hello.obj : error LNK2019: unresolved external symbol _CmiPrintfunresolved external symbol"public: __thiscall main::main(class CkArgMsg *)" (??0main@@QAE@PAVCkArgMsg@@@Z)

hello.obj : error LNK2019: unresolved external symbol "public: __thiscall Chare::Chare(void)" (??0Chare@@QAE@XZ)unresolved external symbol"public: __thiscall main::main(class CkArgMsg *)" (??0main@@QAE@PAVCkArgMsg@@@Z)

hello.obj : error LNK2019: unresolved external symbol ___security_cookieunresolved external symbol"public: __thiscall main::main(class CkArgMsg *)" (??0main@@QAE@PAVCkArgMsg@@@Z)

hello.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3unresolved external symbol__ehhandler$??0main@@QAE@PAVCkArgMsg@@@Z

hello.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4unresolved external symbol__ehhandler$??0main@@QAE@PAVCkArgMsg@@@Z

hello.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)

hello.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Chare::pup(class PUP::er &)" (?pup@Chare@@UAEXAAVer@PUP@@@Z)

hello.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Chare::ckGetChareType(void)const " (?ckGetChareType@Chare@@UBEHXZ)

hello.obj : error LNK2001: unresolved external symbol "public: virtual char * __thiscall Chare::ckDebugChareName(void)" (?ckDebugChareName@Chare@@UAEPADXZ)

hello.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Chare::ckDebugChareID(char *,int)" (?ckDebugChareID@Chare@@UAEHPADH@Z)

hello.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Chare::ckDebugPup(class PUP::er &)" (?ckDebugPup@Chare@@UAEXAAVer@PUP@@@Z)

hello.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Chare::CkAddThreadListeners(struct CthThreadStruct *,void *)" (?CkAddThreadListeners@Chare@@UAEXPAUCthThreadStruct@@PAX@Z)

hello.obj : error LNK2019: unresolved external symbol _CkFreeMsgunresolved external symbol"public: static void __cdecl CkMessage::operator delete(void *)" (??3CkMessage@@SAXPAX@Z)

hello.obj : error LNK2019: unresolved external symbol _freeunresolved external symbol"public: static void __cdecl Chare::operator delete(void *)" (??3Chare@@SAXPAX@Z)

hello.obj : error LNK2019: unresolved external symbol _CkCreateChareunresolved external symbol"public: static struct CkChareID __cdecl CProxy_main::ckNew(class CkArgMsg *,int)" (?ckNew@CProxy_main@@SA?AUCkChareID@@PAVCkArgMsg@@H@Z)

hello.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8unresolved external symbol"public: static struct CkChareID __cdecl CProxy_main::ckNew(class CkArgMsg *,int)" (?ckNew@CProxy_main@@SA?AUCkChareID@@PAVCkArgMsg@@H@Z)

hello.obj : error LNK2019: unresolved external symbol _CkRegisterMainChareunresolved external symbol"public: static void __cdecl CkIndex_main::__register(char const *,unsigned int)" (?__register@CkIndex_main@@SAXPBDI@Z)

hello.obj : error LNK2019: unresolved external symbol _CkRegisterEpunresolved external symbol"public: static void __cdecl CkIndex_main::__register(char const *,unsigned int)" (?__register@CkIndex_main@@SAXPBDI@Z)

hello.obj : error LNK2001: unresolved external symbol "public: static int CMessage_CkArgMsg::__idx" (?__idx@CMessage_CkArgMsg@@2HA)

hello.obj : error LNK2019: unresolved external symbol _CkRegisterBaseunresolved external symbol"public: static void __cdecl CkIndex_main::__register(char const *,unsigned int)" (?__register@CkIndex_main@@SAXPBDI@Z)

hello.obj : error LNK2001: unresolved external symbol "public: static int CkIndex_Chare::__idx" (?__idx@CkIndex_Chare@@2HA)

hello.obj : error LNK2019: unresolved external symbol _CkRegisterChareunresolved external symbol"public: static void __cdecl CkIndex_main::__register(char const *,unsigned int)" (?__register@CkIndex_main@@SAXPBDI@Z)

LINK : error LNK2001: unresolved external symbol _mainCRTStartup

.\Debug/mytest.exe : fatal error LNK1120: 31 unresolved externals

Project: warning PRJ0018 : The following environment variables were not found:

$(INC)

***********************************************************************************

 

My project simply includes three files: “hello.h”, “hello.C” and “hello.ci”.

 

//////////////////////////////////////

//

//  hello.h 

//

//////////////////////////////////////

 

#include "hello.decl.h"

 

class main : public Chare {

public:

  main(CkMigrateMessage *m) {}

  main(CkArgMsg *m);

};

 

////////////////////////////////////

//

//  hello.C

//

////////////////////////////////////

 

#include "hello.h"

 

main::main(CkArgMsg *m)

{

  CkPrintf("Hello World \n");

  delete m;

  CkExit();

}

 

#include "hello.def.h"

 

////////////////////////////////////////////////

//

//  hello.ci

//

//  Interface file for hello

//

////////////////////////////////////////////////

 

mainmodule hello {

  mainchare main {

    entry main();

  };

};

 

 

By the way, I could not compile my project successfully in VC++6.0, while it can in VS2005. In VC++6.0, the following errors occure:

 

Compiling...

hello.C

d:\cygwin\usr\include\sys\_types.h(15) : error C2632: 'long' followed by 'long' is illegal

d:\cygwin\usr\include\sys\_types.h(15) : error C2144: syntax error : missing ';' before type 'long'

d:\cygwin\usr\include\sys\_types.h(15) : error C2501: '__extension__' : missing storage-class or type specifiers

d:\cygwin\usr\include\sys\_types.h(15) : fatal error C1004: unexpected end of file found

Error executing cl.exe.

 

 

 


 

 

 


Hi,

 We use cygwin to compile and link. However, since charm++ has been compiled as a VC++ library, you should be use anyway you want with the visual studio IDE.
The libraries you need are defined in a script called unix2nt_cc (see the LINK_POST line) , you can find it at charm/src/arch/win32

Gengbin

2010/2/21 Ni Anning <nianning1981 AT 163.com> write:

Hi, All:

   I have just downloaded the charm-6.1.3, but my existing project which I want to parallelize with charm++ has been developed in VC++ 6.0. Can I directly add charm codes to my project and compile and link it in VC++6.0/’VS2005 If can, how should I do and set which libs to link with the project?

Thanks

Anning


_______________________________________________
charm mailing list
charm AT cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/charm






Archive powered by MHonArc 2.6.16.

Top of Page