On 12/09/2013 10:55, yuanyuan zhou wrote:
> Hi,
> I wanna improve the performance of my application based on MPIR lib, I can 
> use the 32-bit lib to run the app smoothly. I built the 64-bit static lib 
> "mpir.lib" with "lib_mpir_sandybridge" option via visual studio 2012, and 
> also the 64-bit static lib "mpirxx.lib" for C++ interface in accordance with 
> the guidance 
> "http://www.exploringbinary.com/how-to-install-and-run-gmp-on-windows-using-mpir/";,
>  thanks Rick. 
> 
> Then I copied the "mpir.h" and "mpirxx.h" from "..\\lib\x64\Release" folder 
> into "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include", and 
> "mpir.lib", "mpir.pdb", "mpirxx.lib", "mpirxx.pdb" into from 
> "..\\lib\x64\Release" folder into "C:\Program Files (x86)\Microsoft Visual 
> Studio 11.0\VC\lib". 

Hi Ryan,

These locations are really intended for the C/C++ standard library and
library headers.   You can, of course, use them as you are doing but I
would advise against this as it might interfere with the Visual Studio
installation.

> After that, I compiled the 64 bit release version of my application but got 
> the error "LINK : fatal error LNK1181: cannot open input file 'mpirxx.lib'", 
> what's wrong?

In order to link with mpir.lib and mpirxx.lib, the compiler has to be
able to find the headers and linker has to be able to find the
libraries.  It hence seems that you may not have set up these locations
in your projects property sheets.

Using msieve as an example of an mpir application, the way I set up the
mpir and msieve directories for Visual Studio 2012 is as follows:

   mpir
     lib
       x64
         release
           mpir.h
           mpirxx.h
           mpir.lib
           mpirxx.lib

   msieve
       build.vc11
         msieve
           msieve.vcxproj

To navigate to the header files I then set the msieve property sheet
item (C/C++|General|Additional Include Directories) item to:

 ..\..\..\mpir\lib\x64\release\

and the msieve property sheet item (Linker|Input|Additional
Dependencies) to:

..\..\..\mpir\lib\x64\release\mpir.lib;
..\..\..\mpir\lib\x64\release\mpirxx.lib

To get to the property sheets you have to right click on your project in
Visual Studio and then click on 'Properties'.  This opens a dialogue
that then allows you to select and set the properties I have described
above.

Once you have set up the locations of the include and the library files,
you should be able to build your application.

Of course you can use any locations you want, the important thing is to
set the locations you choose in the property sheet for your project:

include files: C/C++|General|Additional Include Directories
libraries:     Linker|Input|Additional Dependencies

Remember also to add both mpir.lib and mpirxx.lib.

I hope this helps - if not I will try and help further.

    Brian







As you can see from thye directory layout








> 
> Thanks in advance.
> BR,
> Ryan
> 

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to