Where is libgmp-3.dll

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
harmonv
Posts: 54
Joined: Oct 19, 2007 12:44

Where is libgmp-3.dll

Post by harmonv »

When I tried to compile the "power.bas" example program it halts with
... unable to locate libgmp-3.dll
The suggested re-install did not solve the problem.

A quick search of the FreeBasic folder did not find it
The closest match was libgmp.dll.a in the \lib folder
Do i need to create this file?
dani.user
Posts: 284
Joined: Sep 30, 2006 10:41

Post by dani.user »

http://www.google.com/search?q=download ... =firefox-a

The fb package would be to big if all these dll's were included.
harmonv
Posts: 54
Joined: Oct 19, 2007 12:44

Post by harmonv »

Thanks Dani.

Is there a better multi-precision math package than GMP?
(just sort of wondering out load why it wasn't included)
integer
Posts: 408
Joined: Feb 01, 2007 16:54
Location: usa

Re: Where is libgmp-3.dll

Post by integer »

harmonv wrote:When I tried to compile the "power.bas" example program it halts with
... unable to locate libgmp-3.dll
The suggested re-install did not solve the problem.
libgmp-3.dll

The libgmp.dll.a IS in the \lib folder.

I have:
c:\Program Files\freebasic\lib\win32\libgmp.dll.a
c:\Program Files\freebasic\lib\win32\libgmp-3.dll.a
c:\Program Files\freebasic\lib\win32\libgmp-3.dll

The file is where I would expect it to be, however FB cannot find it.

I re-installed fb v.23 -- same problem
I re-installed fb v.24 -- same problem
I re-installed fb v.25 -- same problem

The system is XP SP3

i ALSO found libgmp-10.dll and tried renaming it to libgmp-3.dll & libgmp-3.dll.a
BUT still FBIDE says it cannot find the file.

I placed copies of the above in the c:\freebasic\lib\win32 directory and in the local working directory: c:\fb1\

Where should I place the libgmp-3.dll.a so that fb can file it?

I have downloaded several versions of the libgmp.dll from the GMP web site and other sites that had the library.
Apparently, I have the library -- but Freebasic (using FBIDE) cannot see it.

Code: Select all

   
    #include once "gmp.bi"    
    dim as mpz_t num
    mpz_init(@num)
    mpz_clear(@num)
    print "create init & cleared"
    sleep
The application failed to start because libgmp-3.dll was not found.
Anyone have ANY idea what I can try next?
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Where is libgmp-3.dll

Post by dkl »

*.a and *.dll.a files are used when linking, they should go into FreeBASIC/lib/win32, or into the directory from which you invoke fbc to compile your program (the current/working directory), so the linker can find them.

*.dll files are used by the program at runtime, they go next to your program.exe or into C:\Windows\system32, so the system can find them.

Note: I think if you're using FBIDE's quick-run feature it will actually create a temporary FBIDETEMP.bas file and compile and run that from inside the FBIDE installation directory, so in that case you may have to put the .dll there.
integer
Posts: 408
Joined: Feb 01, 2007 16:54
Location: usa

Re: Where is libgmp-3.dll

Post by integer »

dkl wrote:*.a and *.dll.a files are used when linking, they should go into FreeBASIC/lib/win32, or into the directory from which you invoke fbc to compile your program (the current/working directory), so the linker can find them.

*.dll files are used by the program at runtime, they go next to your program.exe or into C:\Windows\system32, so the system can find them.

Note: I think if you're using FBIDE's quick-run feature it will actually create a temporary FBIDETEMP.bas file and compile and run that from inside the FBIDE installation directory, so in that case you may have to put the .dll there.
I placed the libgmp-3.dll.a in the same directory as the FBIDE : "application failed to start because it could not find the file...
using the console & compiling, same result.
(just to make sure the setup was working, other programs compiled & ran from the console)

copied the file to c:\windows\system32\libgmp-3.dll.a
compiled ok; run: same result, could not find the file.

rename c:\windows\system32\libgmp-3.dll.a libgmp-3.dll

compiled from the console: THE PROGRAM WORKED.
compiled from within FBIDE; the program worked.

@dkl
THANKS
that's copasetic

THEREFORE:
Does that mean that on my system: xp sp3 (using fbc version 0.24)
ALL LIBRARIES need to be moved to the Windows\System32\ directory AND renamed without the suffix ".a"

That does not align with the FreeBasic documentation about the particular path order.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: Where is libgmp-3.dll

Post by dkl »

Hmm no, *.dll.a files are different from *.dll, the *.dll.a is a small fake library that's included in the program.exe, telling the system that this program.exe needs that *.dll, which is the one with the real code. Normally the two wouldn't be renamed, but only put in the proper location.
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Re: Where is libgmp-3.dll

Post by MichaelW »

My 0.24.0 installation has only libgmp.dll.a in the lib\win32\ directory. libgmp.dll.a is an “import” library for libgmp-3.dll, and if you open it in a text editor you should be able to see a bunch of __imp____gmp_… entries and the DLL name. As a test I downloaded the dynamic GMP library and header file for MinGW from here:

http://cs.nyu.edu/exact/core/gmp/

Since I try to avoid polluting my system32 directory with things like this, I extracted libgmp-3.dll and copied it to my working directory, then compiled with this batch file:

Code: Select all

"c:\program files\freebasic\fbc" -w pendantic -v -C -R -s console power.bas
pause
And everything worked as expected.
Post Reply