Re: linking g95-built library from VC++
- From: "Jugoslav Dujic" <jdujic@xxxxxxxxx>
- Date: Fri, 30 Jun 2006 12:39:08 +0200
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.
.
- References:
- linking g95-built library from VC++
- From: Matthew Halfant
- Re: linking g95-built library from VC++
- From: Matthew Halfant
- linking g95-built library from VC++
- Prev by Date: Re: removing blanks from a file
- Next by Date: Re: removing blanks from a file
- Previous by thread: Re: linking g95-built library from VC++
- Next by thread: pass several filenames to the subroutine
- Index(es):
Relevant Pages
|