This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How to compile a .LIB with cygwin for use in MS Visual C


Hi all,

I am trying to compile library using cygwin. This library compiles
perfectly with gcc on various unix platforms and with the cygwin version
on gcc on a MS-windows machine. Also usage of this library is
working perfectly on all these platforms.

Now the problem:

I would like to use the compiles library as a .LIB under MS Visual C.

So why don't I just distribute source code of my library so that it
can be compiled with Visual C.
Reason: I rely on automatic source code generation, which works
with a combination of makefiles and standard unix tools. This is
difficult to port to Visual C.

What did I try:

I tried including my library (it's called  libcpfspd.a) at the linking stage
of Visual C by just adding this to the line "Object/library modules"

I get the following linking error:

--------------------Configuration: cpfspd_test2 - Win32 Release--------------------
Linking...
libcpfspd.a(cpfspd_hdr.o) : error LNK2001: unresolved external symbol __impure_ptr
libcpfspd.a(cpfspd_low.o) : error LNK2001: unresolved external symbol __impure_ptr
libcpfspd.a(cpfspd_low.o) : error LNK2001: unresolved external symbol __alloca
libcpfspd.a(cpfspd_low.o) : error LNK2001: unresolved external symbol ___errno
Release/cpfspd_test2.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

cpfspd_test2.exe - 5 error(s), 0 warning(s)

Next try: compile the library with -mno-cygwin:
Following result:

--------------------Configuration: cpfspd_test2 - Win32 Release--------------------
Linking...
libcpfspd-mno-cygwin.a(
) : error LNK2001: unresolved external symbol ___imp__iob
libcpfspd-mno-cygwin.a(
) : error LNK2001: unresolved external symbol ___imp__iob
libcpfspd-mno-cygwin.a(
) : error LNK2001: unresolved external symbol __alloca
Release/cpfspd_test2.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

cpfspd_test2.exe - 4 error(s), 0 warning(s)


So, is it possible to compile with cygwin and use the result with Visual C, 
or am I asking for the impossible?


--
With kind regards,
     Robert Jan Schutten (Robert.Jan.Schutten@philips.com)
  - "Imagination is more important than knowledge" - Einstein -
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]