Board index » delphi » lib file can't be linked under ide

lib file can't be linked under ide

I added a lib file to my project by the "Project->Add item" menu item under
IDE, but when I builded the project, it return a linker error:" bad object
file record in module mylib.lib". And when I used bcc, the command-line
tool, to build it with the following instruction: bcc -emyexe mycpp.cpp
mylib.lib, it could work ok.
I don't know what's the worng. I use borlandc++ 3.1 under dos.
Please tell me and thank you!
 

Re:lib file can't be linked under ide


"yuan" <chx...@21cn.com> wrote in news:3c15acd7$1_2@dnews:

Quote
> I added a lib file to my project by the "Project->Add item" menu item
> under IDE, but when I builded the project, it return a linker error:"
> bad object file record in module mylib.lib". And when I used bcc, the

You possibly have a badly built or corrupted .lib file. Try to rebuild it
from scratch (rebuild all).

Then, be sure that in your application, you are using the freshly generated
.lib (check the disk and path name etc.).

To be sure, you can add the following to your .lib

/* in the header */
char const *mylib_build_info(void);

/* in the lib source */
char const *mylib_build_info(void)
{
   return "mylib "__DATE__" "__TIME";

Quote
}

/* in the application main() */

#include <stdio.h>
#include "mylib.h"
int main (void)
{
   printf("%s\n", mylib_build_info());
   /* ... */
   return 0;

Quote
}
> command-line tool, to build it with the following instruction: bcc
> -emyexe mycpp.cpp mylib.lib, it could work ok.

This syntax sounds correct to me

Quote
> I don't know what's the wrong. I use borlandc++ 3.1 under dos.
> Please tell me and thank you!

How have you built mylib.lib?

--
-ed- emdel at noos.fr
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-library: http://www.dinkumware.com/htm_cl/index.html
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/

Other Threads