Duplicate files in Library. 
Author Message
 Duplicate files in Library.

Hi,

        I have a main app that includes a library that I build.  For
various reasons, I include the same file in both the library and the
main app.

        I want the Linker to resolve calls to these separately - i.e..
call made from within the .lib should use the file in the .lib & calls
made within the app should use its .cpp (the two file are identical -
but preprocessor defines on the library build may be different from the
main app.)

        Currently I get a conflict if I include the file in both builds.

        I hope this is comprehensible.  Thanx in advance for any help.

        P.S. I'm not sure what newsgroups are appropriate.



Thu, 19 Dec 2002 03:00:00 GMT  
 Duplicate files in Library.
When the program is linked, there is no difference between the .lib and the
.cpp files.  They are all the same program!

What it sounds like you need is a .DLL with your .lib code in.

Or how about the preprocessor changing the name of the functions in a .lib
compilation?  So when compiled with a .lib all functions start LIB_, and
when in your program not?


Quote:
> Hi,

>         I have a main app that includes a library that I build.  For
> various reasons, I include the same file in both the library and the
> main app.

>         I want the Linker to resolve calls to these separately - i.e..
> call made from within the .lib should use the file in the .lib & calls
> made within the app should use its .cpp (the two file are identical -
> but preprocessor defines on the library build may be different from the
> main app.)

>         Currently I get a conflict if I include the file in both builds.

>         I hope this is comprehensible.  Thanx in advance for any help.

>         P.S. I'm not sure what newsgroups are appropriate.



Fri, 20 Dec 2002 03:00:00 GMT  
 Duplicate files in Library.

Quote:

> When the program is linked, there is no difference between the .lib and the
> .cpp files.  They are all the same program!

TRUE

Quote:

> What it sounds like you need is a .DLL with your .lib code in.

> Or how about the preprocessor changing the name of the functions in a .lib
> compilation?  So when compiled with a .lib all functions start LIB_, and
> when in your program not?

Sounds good. Is there a 'clean' way to do this? - I have a lot of functions
that I want resolved seperately.

Thanks!



Fri, 20 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Duplicate files in Library.

2. Duplicate Libraries in Project Options

3. Identification of the duplicate file by name

4. find duplicate in files

5. Duplicate file

6. ListCtrl on File->New Columns adding (duplicating)

7. duplicate files

8. Check for duplicate files

9. Makefiles, Libraries, Object files, Header files in TurboC++ (borland)

10. 2nd try: need a C library file for reading Windows-style .INI files

11. Differentiate LIB file for static library and LIB file for DLL

12. Remove duplicated items in an ArrayList

 

 
Powered by phpBB® Forum Software