forum.alglib.net http://forum.alglib.net/ |
|
Using AMP http://forum.alglib.net/viewtopic.php?f=2&t=776 |
Page 1 of 1 |
Author: | Prog [ Wed Feb 20, 2013 12:33 pm ] |
Post subject: | Using AMP |
Hello. I'd like to use the AMP library. And I have some troubles. I use MVSC 2010 Express. To use the AMP I add gmp.h, mpfr.h, ap.h, amp.h header files into the project. Then I add amp.cpp and ap.cpp. Next I compile ap.cpp. But amp.cpp isn't compiled: "e:\cprogs\amprf\amp.h(24): fatal error C1083: Cannot open include file: gmp.h: No such file or directory" |
Author: | Sergey.Bochkanov [ Wed Feb 20, 2013 12:58 pm ] |
Post subject: | Re: Using AMP |
You have to add gmp.h into search path of your project... or store in the same directory where you store the rest of the library. |
Author: | Prog [ Wed Feb 20, 2013 1:09 pm ] |
Post subject: | Re: Using AMP |
It seems the problem is solved by changing include directories. Because amp.h includes gmp.h like #include <>. But project doesn't work. I try to compile following code Code: #include "amp.h" int i=3; amp::ampf<128> a(i); void main () { } As a result of this: Quote: 1.obj : error LNK2019: unresolved external symbol _mpfr_set_si referenced in function "private: void __thiscall amp::ampf<128>::InitializeAsSLong(long)" (?InitializeAsSLong@?$ampf@$0IA@@amp@@AAEXJ@Z) 1.obj : error LNK2019: unresolved external symbol _mpfr_set4 referenced in function "public: struct __mpfr_struct * __thiscall amp::ampf<128>::getWritePtr(void)" (?getWritePtr@?$ampf@$0IA@@amp@@QAEPAU__mpfr_struct@@XZ) amp.obj : error LNK2001: unresolved external symbol "_mpfr_set4" amp.obj : error LNK2019: unresolved external symbol _mpfr_init2 referenced in function "public: static struct amp::mpfr_record * __cdecl amp::mpfr_storage::newMpfr(unsigned int)" (?newMpfr@mpfr_storage@amp@@SAPAUmpfr_record@2@I@Z) amp.obj : error LNK2019: unresolved external symbol ___gmp_randseed_ui referenced in function"public: static struct __gmp_randstate_struct (* __cdecl amp::mpfr_storage::getRandState(void))[1]" (?getRandState@mpfr_storage@amp@@SAPAY00U__gmp_randstate_struct@@XZ) amp.obj : error LNK2019: unresolved external symbol ___gmp_randinit_default referenced in function "public: static struct __gmp_randstate_struct (* __cdecl amp::mpfr_storage::getRandState(void))[1]" (?getRandState@mpfr_storage@amp@@SAPAY00U__gmp_randstate_struct@@XZ) I think it means I make something wrong. P.S. AlgLib version 3 is more simple to use, but I need the amp. In the third version of AlgLib LNK2019 problem is solved by including all .cpp files. But in this version there are just ap.cpp and amp.cpp. Also I didn't use build.bat and I don't know how to use it. Attempt of including static libraries results in error LNK2005. |
Author: | Sergey.Bochkanov [ Wed Feb 20, 2013 3:24 pm ] |
Post subject: | Re: Using AMP |
You also need MPFR, library which supports arbitrary precision transcendent functions. |
Author: | Prog [ Fri Feb 22, 2013 5:14 am ] |
Post subject: | Re: Using AMP |
Sergey.Bochkanov wrote: You also need MPFR, library which supports arbitrary precision transcendent functions. If it's msvc-x86-mpfr.lib from "_internal" folder than I add it to the project as "Additional Dependencies". Also I add msvc-x86-gmp.lib. But : Code: 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRTD.lib(MSVCR90D.dll)
1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRTD.lib(cinitexe.obj) 1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(invarg.obj) : error LNK2005: __invalid_parameter already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in MSVCRTD.lib(crtexe.obj) 1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(strtol.obj) : error LNK2005: _strtol already defined in MSVCRTD.lib(MSVCR90D.dll) 1>LIBCMT.lib(strnicmp.obj) : error LNK2005: __strnicmp already defined in MSVCRTD.lib(MSVCR90D.dll) |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |