www.digitalmars.com         C & C++   DMDScript  

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

reply =?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
parent reply 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
parent reply 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
next sibling parent reply 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
parent 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
prev sibling parent reply 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
parent =?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