reimp creates .a for wrong library

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

reimp creates .a for wrong library

Bjørn Madsen
Hello

I am in the process of creating a JNI bridge to some software
controlling a Cypress USB-device. To use the functions of the device
cyapi.h and cyapi.lib files were supplied. The files are meant for
Visual Studio and work fine there. I am now trying to compile the
project using MinGW's gcc, and I'm having some trouble converting the
.lib file to something useful.

More specifically I've figured that
> reimp cyapi.lib
should create a libcyapi.a, which can then be used for linking the other
files. The problem is that the above command creates the following files
instead:
* cyapi.obj
* SETUPAPI.def
* libsetupapi.a

As far as I can see, Setup API is some Windows installer related
library.

What am I doing wrong? Is this something I can fix or is it a lost
cause?

I don't have a .dll with the library, but I have a .lib file for the
Borland compiler, if that's any help.

Thanks in advance

Best regards,
Bjørn Madsen
mailto:[hidden email]
RSP Systems
Denmark
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: reimp creates .a for wrong library

Tuomo Latto
Bjørn Madsen wrote:
> I am in the process of creating a JNI bridge to some software
> controlling a Cypress USB-device. To use the functions of the device
> cyapi.h and cyapi.lib files were supplied. The files are meant for
> Visual Studio and work fine there. I am now trying to compile the
> project using MinGW's gcc, and I'm having some trouble converting the
> .lib file to something useful.

Why do you need to convert it?
http://www.mingw.org/wiki/Specify_the_libraries_for_the_linker_to_use


--
Tuomo

... >> Overly uburbulous words will klologe readers if they have
    >> deblionic vocabularies
    > Come on! Those aren't even real words anymore. You're just
    > making shit up now.
    I'm sure he's anaspeptic, prasmotic - even compunctuous to have
    caused you such pericombobulation.
        -- http://thedailywtf.com/Comments/Brevity_Is_Important.aspx?pg=2


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: reimp creates .a for wrong library

Bjørn Madsen
On Sep 16, 2009 11:14 "Tuomo Latto" <[hidden email]> wrote:

> Bjørn Madsen wrote:
> > I am in the process of creating a JNI bridge to some software
> > controlling a Cypress USB-device. To use the functions of the device
> > cyapi.h and cyapi.lib files were supplied. The files are meant for
> > Visual Studio and work fine there. I am now trying to compile the
> > project using MinGW's gcc, and I'm having some trouble converting
> > the
> > .lib file to something useful.
>
> Why do you need to convert it?
> <http://www.mingw.org/wiki/Specify_the_libraries_for_the_linker_to_use
> >
>
Because I get a load of "undefined reference" errors when doing the final linking of .o files to a .dll.
I read through that link and tried every possible combination of arguments I could come up with, and nothing changes. All errors are for functions supplied in the library. One other thing, which might have relevance, this is C++, and the library supplies a class which exposes the needed functions (so I can't include it as extern C). I am not that clear on the details, but are there some problems with different compilers and function name mangling in C++? I think that was what lead me on to the reimp path.

Any further help would be appreciated. If I need to supply more details, just let me know.

Regards, Bjørn

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: reimp creates .a for wrong library

Tuomo Latto
Bjørn Madsen wrote:
> Because I get a load of "undefined reference" errors when doing the final linking of .o files to a .dll.
> I read through that link and tried every possible combination of arguments I could come up with, and nothing changes. All errors are for functions supplied in the library. One other thing, which might have relevance, this is C++, and the library supplies a class which exposes the needed functions (so I can't include it as extern C). I am not that clear on the details, but are there some problems with different compilers and function name mangling in C++? I think that was what lead me on to the reimp path.

Great, a single 500-character line of text...


Short answer is you can't and shouldn't mix compilers with C++.
AFAIK the problem is basically that the internal mechanisms and
conventions used by different compilers to implement
the language are, well, different and they don't mix.

If you want to see that changed, at the bare minimum
you need to get Microsoft to document the internals
and then fully commit to that, have them place that
documentation under some permissive enough public license
and then wrestle with the GCC crowd (and other compiler
makers) to get them to support that.
To do that you don't need luck, you need divine powers.

Just so you know this is a FAQ!
Considering there is quite enough written documentation
available, I am left wondering how come people don't read it.

http://www.mingw.org/wiki/MixingCompilers


--
Tuomo

... My nipples explode with delight!


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: reimp creates .a for wrong library

Bjørn Madsen
On Sep 18, 2009 13:14 "Tuomo Latto" <[hidden email]> wrote:

> Bjørn Madsen wrote:
> > Because I get a load of "undefined reference" errors when doing the
> > final linking of .o files to a .dll.
> > I read through that link and tried every possible combination of
> > arguments I could come up with, and nothing changes. All errors are
> > for functions supplied in the library. One other thing, which might
> > have relevance, this is C++, and the library supplies a class which
> > exposes the needed functions (so I can't include it as extern C). I
> > am not that clear on the details, but are there some problems with
> > different compilers and function name mangling in C++? I think that
> > was what lead me on to the reimp path.
>
> Great, a single 500-character line of text...
>
>
> Short answer is you can't and shouldn't mix compilers with C++.
> AFAIK the problem is basically that the internal mechanisms and
> conventions used by different compilers to implement
> the language are, well, different and they don't mix.
>
> If you want to see that changed, at the bare minimum
> you need to get Microsoft to document the internals
> and then fully commit to that, have them place that
> documentation under some permissive enough public license
> and then wrestle with the GCC crowd (and other compiler
> makers) to get them to support that.
> To do that you don't need luck, you need divine powers.
>
> Just so you know this is a FAQ!
> Considering there is quite enough written documentation
> available, I am left wondering how come people don't read it.
>
> <http://www.mingw.org/wiki/MixingCompilers>
>
Right. Thanks for the help.

Lose a bit of the hostility and this might have been a pleasant experience.

Regards, Bjørn

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: reimp creates .a for wrong library

Tuomo Latto
Bjørn Madsen wrote:
> Lose a bit of the hostility and this might have been a pleasant experience.

Want your money back?


--
Tuomo

... Deep Space Nine: To boldly stay where no one has stayed before


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

how does one mass-download MinGW packages?

Josh Greenland
In reply to this post by Tuomo Latto
Is there a way to mass-download MinGW packages?  Are there any ftp
servers that have all the MinGW packages, rather than just the few core
ones?  Or any other servers that would allow picking the packages one
wants and downloading them at once, rather than tortuously downloading
each one in succession, which seems the only way to do it from
sourceforge.net?


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: how does one mass-download MinGW packages?

Jonathan Marsden
Josh Greenland wrote:

> Is there a way to mass-download MinGW packages?

Yes.  It's just not very graphical, or very Windows-like.  Install wget,
and use it in a loop to download all the stuff you need.

Using the MinGW wget could be seen either as "cheating", or as being a
mild chicken and egg problem (!), so to get you started you can install
the GNUwin32 version of wget, downloadable from

  http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-bin.zip
  http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-dep.zip

Unzip these into an appropriate place (the official location is under
%ProgramFiles%\GnuWin32) and then you can download as many of the MinGW
files as you want with it.  Create a text file with the files you need
listed in it, one file per line, like this:

binutils-2.19.1-mingw32-bin.tar.gz
mingwrt-3.16-mingw32-dev.tar.gz
mingwrt-3.16-mingw32-dll.tar.gz
msysCORE-1.0.11-bin.tar.gz
w32api-3.13-mingw32-dev.tar.gz

and save that file as (say) mingw-files.txt

Then just run (as a single DOS command, all on one line):

 for /F %F in (mingw-files.txt) do "%ProgramFiles%\GnuWin32\bin\wget"
 -c <a href="http://downloads.sourceforge.net/mingw/%F">http://downloads.sourceforge.net/mingw/%F

and all the files in your list will be downloaded, with no need for
interaction with you.  Problem solved :)

If you have a working MSYS installation already, or a Linux machine, you
can generate an initial list of all the relevant files by doing
something like (as a single one line command):

  wget -q -O- http://sourceforge.net/projects/mingw/files/ |grep tar
    |grep href |sed -e 's/^.*href="//' -e 's%/download"$%%' -e
    's%^.*/%%' |grep tar |sort |uniq |egrep -v "(src|doc|lic|man)\.tar"

If you do this to create a file list, *please* check and edit your list
before downloading all those (close to 300) files -- do you need *all*
of them?  Some files are previous releases, and so should probably be
omitted for most people.

Jonathan

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.

Most annoying abuses are:
1) Top posting
2) Thread hijacking
3) HTML/MIME encoded mail
4) Improper quoting
5) Improper trimming
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
sg
Reply | Threaded
Open this post in threaded view
|

Re: how does one mass-download MinGW packages?

sg
Hello,

A while back on Sep 19, 2009 Jonathan Marsden wrote:
  [...]
  >
  > Create a text file with the files you need listed in it, one
  > file per line, like this:
  >
  > binutils-2.19.1-mingw32-bin.tar.gz
  > mingwrt-3.16-mingw32-dev.tar.gz
  > mingwrt-3.16-mingw32-dll.tar.gz
  > msysCORE-1.0.11-bin.tar.gz
  > w32api-3.13-mingw32-dev.tar.gz
  >
  > and save that file as (say) mingw-files.txt
  >
  > Then just run (as a single DOS command, all on one line):
  >
  >  for /F %F in (mingw-files.txt) do "%ProgramFiles%\GnuWin32\bin\wget"
  >  -c <a href="http://downloads.sourceforge.net/mingw/%F">http://downloads.sourceforge.net/mingw/%F
  >
  > and all the files in your list will be downloaded, with no
  > need for interaction with you.  Problem solved :)
  >
  > If you have a working MSYS installation already, or a Linux
  > machine, you can generate an initial list of all the
  > relevant files by doing something like (as a single one line
  > command):
  >
  >   wget -q -O- http://sourceforge.net/projects/mingw/files/ |grep tar
  >     |grep href |sed -e 's/^.*href="//' -e 's%/download"$%%' -e
  >     's%^.*/%%' |grep tar |sort |uniq |egrep -v "(src|doc|lic|man)\.tar"
  >
  > If you do this to create a file list, *please* check and
  > edit your list before downloading all those (close to 300)
  > files -- do you need *all* of them?  Some files are previous
  > releases, and so should probably be omitted for most people.

  I have found the above two commands (wget followed by
  "dos-for") very useful.  However, today the wget command finds
  just one match, viz.,
 
    x86-mingw32-build-1.0-sh.tar.bz2:  released on 2009-03-16 12:41:00 UTC"

  Please recreate the wget command.

  Thanks,

  --Suresh

Reply | Threaded
Open this post in threaded view
|

Re: how does one mass-download MinGW packages?

Earnie Boyd
sg wrote:

> Hello,
>
> A while back on Sep 19, 2009 Jonathan Marsden wrote:
>   [...]
>   >
>   > Create a text file with the files you need listed in it, one
>   > file per line, like this:
>   >
>   > binutils-2.19.1-mingw32-bin.tar.gz
>   > mingwrt-3.16-mingw32-dev.tar.gz
>   > mingwrt-3.16-mingw32-dll.tar.gz
>   > msysCORE-1.0.11-bin.tar.gz
>   > w32api-3.13-mingw32-dev.tar.gz
>   >
>   > and save that file as (say) mingw-files.txt
>   >
>   > Then just run (as a single DOS command, all on one line):
>   >

In doing this
>   >  for /F %F in (mingw-files.txt) do "%ProgramFiles%\GnuWin32\bin\wget"
>   >  -c  <a href="http://downloads.sourceforge.net/mingw/%F">http://downloads.sourceforge.net/mingw/%F
> <a href="http://downloads.sourceforge.net/mingw/%F">http://downloads.sourceforge.net/mingw/%F
>   >

or

>   >   wget -q -O- http://sourceforge.net/projects/mingw/files/ |grep tar
>   >     |grep href |sed -e 's/^.*href="//' -e 's%/download"$%%' -e
>   >     's%^.*/%%' |grep tar |sort |uniq |egrep -v "(src|doc|lic|man)\.tar"
>   >

you need to keep up with the changes to the structure of the links and
packages.

>
>   I have found the above two commands (wget followed by
>   "dos-for") very useful.  However, today the wget command finds
>   just one match, viz.,
>  
>     x86-mingw32-build-1.0-sh.tar.bz2:  released on 2009-03-16 12:41:00 UTC"
>
>   Please recreate the wget command.
>

Uh, it is up to you to make the modifications to your scripts based on
the new order of file links.  I suggest instead though that you use
mingw-get so that you can get the updates as needed automagically and
better controlled with changes to the file structures.

--
Earnie
-- http://www.for-my-kids.com

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:[hidden email]?subject=unsubscribe