MinGW (the compiler you are using) do support *.a files just as well as
any other gcc version. It also supports Win32 *.lib files.
What language are you using? C or C++? If you use C, the linker will look
for a synbol _hypotenuse in the *.a file. If you use C++, the compiler
will name-mangle the symbol, to encode the data types and in some cases
the compilation switches. This is a common reason why a C++ program fails
to link with a C library (unless the header file says extern "C" symbol)
or why a C++ program fails to link with a C++ library compiled with too
different compiler settings or with a different version of the C++
compiler.
A quickie to look for this problem is to run the command "strings" (not in
Win32, so you have to download a copy) on your object file in your
project, and on the *.a file and check if the hypotenuse reference looks
identical.
/pwm
On Thu, 10 Apr 2008, Samuel Hulley wrote:
> Hi,
> For so long I have been using a different compiler, but now I am using
> Dev-C++, In my old compiler I was able to create a header file and place
> something like this in it:
>
> > double hypotenuse(double sidea,double sideb);
>
> Then include it into my app, set the .a file and use it, but now I get
> an error message saying:
>
> > [Linker error] undefined reference to `hypotenuse(double, double)'
>
> Any ideas?
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|