Re: linking g95-built library from VC++



Matthew Halfant wrote:
| I've done a little more experimenting, and gotten it to work by the simple
| device of explicitly placing LIBC.lib on the command line in front of
| msvcrt.lib:
|
| cl caller.c fortlib.lib f95.lib gcc.lib LIBC.lib msvcrt.lib
|
| That produces the warning messages:
|
| LINK : warning LNK4089: all references to "dkxh.o" discarded by /OPT:REF
| LINK : warning LNK4089: all references to "dkxs00060.o" discarded by
| /OPT:REF
|
| but the application appears to run correctly.
|
| I noticed that msvcrt.lib can be found amoung the VC++ libraries, and that I
| can omit copying it from the GNU libararies. Either seems to work, and both
| result in the warning messages shown above.
|
| I'd still be grateful for instruction from anyone who actually knows the
| correct way to go about this.

Alas, there's no "correct way", and I'd say that you are damn lucky that
you made it to work at all (and you should hold your breath if you start
adding features). In general, you can't expect that you can link
object files made with one compiler with another. Even if the formats
are compatible (seems so), they will contain references to their own
C run-time libraries, and it's quite likely that at least some names
from those libraries will clash.

I must note that libc.lib and msvcrt.lib are two copies of MS VC++
C runtime library -- first static, second dll. In general, you should
not use both, but I can't tell you the sure way to avoid it.

--
Jugoslav
___________
www.xeffort.com

Please reply to the newsgroup.
You can find my real e-mail on my home page above.
.



Relevant Pages

  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: How do you make this Open Source work on Solaris 10?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.shell)
  • Re: Enlightnement
    ... I'm relatively new to the Linux ... >>command line and do not have a book on Linux. ... > the system know what libraries are available and where. ... though I'm running FC3. ...
    (comp.os.linux.setup)
  • Re: How do you make this Open Source work on Solaris ?
    ... After running the tar -xvf command, I logged in /bin/csh and did the ... checking for gcc... ... checking for C compiler default output... ... checking how to recognise dependent libraries... ...
    (comp.unix.programmer)
  • Re: Enlightnement
    ... I'm relatively new to the Linux ... >>command line and do not have a book on Linux. ... > the system know what libraries are available and where. ...
    (comp.os.linux.setup)