www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

c++ - linking Borland C++ 3.1 libraries in 16 bit DOS mode

↑ ↓ ← =?ISO-8859-2?Q?Micha=B3_Kandulski?= <kandul poczta.onet.pl> writes:
I can't link a Borland C++ 3.1 library to link my DOS executable.

Is it possible at all?

I use one of library functions in my "main". The linker says that it doesn't
see 
the function, although it doesn't complain about the format of .lib file.

Are there any linker (compiler) switches that make things work?

Michal
May 08 2003
↑ ↓ Jan Knepper <jan smartsoft.us> writes:
What are you trying to do? Link a Borland C++ 3.1 DOS library into a Digital
Mars
C++ generated DOS executable?
Which functions do you need???



Micha³ Kandulski wrote:

 I can't link a Borland C++ 3.1 library to link my DOS executable.

 Is it possible at all?

 I use one of library functions in my "main". The linker says that it doesn't
see
 the function, although it doesn't complain about the format of .lib file.

 Are there any linker (compiler) switches that make things work?

 Michal

-- ManiaC++ Jan Knepper
May 08 2003
↑ ↓ user domain.invalid writes:
I can't link a Borland C++ 3.1 library to link my DOS executable.

Is it possible at all?

I use one of library functions in my "main". The linker says that it doesn't see
the function, although it doesn't complain about the format of .lib file.

Are there any linker (compiler) switches that make things work?

Michal

What are you trying to do? Link a Borland C++ 3.1 DOS library into a Digital Mars C++ generated DOS executable? Which functions do you need???

This is what I'm trying to do: 1) I've got a commercial library (designed for a laser bar code scanner). It works fine with Borland C++ 3.1 compiler. 2) I need to meke an 16 bit DOS executable. 3) I'm trying to make it with Digital Mars C++ compiler (because there are some reasons why I don't want to use the Borland compiler). 4) While I link the library with an OBJ that contains a call to a certain function, the linker does not see the function, although the library contains it for sure. That's my problem. Michal
May 08 2003
Jan Knepper <jan smartsoft.us> writes:
user domain.invalid wrote:

  >>I can't link a Borland C++ 3.1 library to link my DOS executable.
  >>
  >>Is it possible at all?
  >>
  >>I use one of library functions in my "main". The linker says that it
doesn't see
  >>the function, although it doesn't complain about the format of .lib file.
  >>
  >>Are there any linker (compiler) switches that make things work?
  >>
  >>Michal
  >
 What are you trying to do? Link a Borland C++ 3.1 DOS library into a Digital
Mars
 C++ generated DOS executable?
 Which functions do you need???

This is what I'm trying to do: 1) I've got a commercial library (designed for a laser bar code scanner). It works fine with Borland C++ 3.1 compiler.

The commercial library not come with a library for Zortech/Symantec or Microsoft? If so, try to use Symantec or Zortech, than Microsoft...
 2) I need to meke an 16 bit DOS executable.
 3) I'm trying to make it with Digital Mars C++ compiler (because there
     are some reasons why I don't want to use the Borland compiler).

There are many obvious reasons for that. ;-)
 4) While I link the library with an OBJ that contains a call to a certain
     function, the linker does not see the function, although the library
     contains it for sure.

Is it C or C++? Can you list the functions in the library with tbe LIB (Digital Mars LIB.exe) command line tool? Have you confirmed the calling convention/declaration of the functions? -- ManiaC++ Jan Knepper
May 08 2003
↑ ↓ → user domain.invalid writes:
Jan Knepper wrote:

1) I've got a commercial library (designed for a laser bar code scanner).
    It works fine with Borland C++ 3.1 compiler.

The commercial library not come with a library for Zortech/Symantec or Microsoft? If so, try to use Symantec or Zortech, than Microsoft...

I would'n bother if I had such.
 [...]
 
 Is it C or C++?
 Can you list the functions in the library with tbe LIB (Digital Mars LIB.exe)
command
 line tool?
 Have you confirmed the calling convention/declaration of the functions?

It was C indeed. Thanks for help. Michal
May 09 2003
roland <nancyetroland free.fr> writes:
user domain.invalid a écrit:
.
.
.

 4) While I link the library with an OBJ that contains a call to a certain
    function, the linker does not see the function, although the library
    contains it for sure.

 That's my problem.

 Michal

check name mangling or leading underscore. generate the assembly listing (.cod) to see what is the real name of the function the compiler is calling. you can also generate a .map file. hope the functions in the .lib are pure C (no name mangling). declare the function as extern "C" example: extern "C" int myfunc(int myarg); roland
May 08 2003
↑ ↓ → =?ISO-8859-2?Q?Micha=B3_Kandulski?= <kandul poczta.onet.pl> writes:
roland wrote:


  > 4) While I link the library with an OBJ that contains a call to a 
 certain
  >    function, the linker does not see the function, although the library
  >    contains it for sure.
  >
  > That's my problem.
  >
  > Michal
  >
 
 check name mangling or leading underscore.
 generate the assembly listing (.cod) to see what is the real name of the
 function the compiler is calling.
 you can also generate a .map file.
 hope the functions in the .lib are pure C (no name mangling).
 declare the function as extern "C"
 example:
 extern "C" int myfunc(int myarg);
 
 
 roland

That was it! How could I forget?! Thanks! Michal
May 09 2003