How to link the .dlb file created by c++ project

Now I have some questions about linking to the library file(.dlb).I have a project (just call it libproj)that builds a library,and I have a main project(call it mainproj) that builds my executable file.The mainproj wants to link the library built by libproj,in fact, it call the function inside the library.I do this in the straightforward way that add the library built by libproj to my mainproj folder.

The mainproj is consisted of c source files and head files,but the libproj is consisted of c++ source files and head files.Then there is an error:

[Error li1021] The following symbols referenced in processor 'p0' could not be resolved: 'function [_function]' referenced from '.\Debug\main.doj'

Linker finished with 1 error cc3089: fatal error: Link failed

I konw this indicate that the mainproj is unsuccessful to link to the library.If the libproj is also consisted of c source files,it could link to the library successfully.I'm stuck...

The C++ function name is abbreviated to contain additional information such parameters passed to the function as well as the return type. If you wish to make C++ symbols and functions available for calling in C or or indeed assembly language then you can declare them using extern "C" to disable the name mangling. There are a few examples of this provided in the compiler manual for the processor you are developing with. In particular see the sections about using mixed C/C++ and Assembly naming conventions.

Here is an example of how you would declare a C++ function to disable name mangling. The function name would then be resolved from C correctly as myfunc() or from assembly as _myfunc.

The C++ function name is abbreviated to contain additional information such parameters passed to the function as well as the return type. If you wish to make C++ symbols and functions available for calling in C or or indeed assembly language then you can declare them using extern "C" to disable the name mangling. There are a few examples of this provided in the compiler manual for the processor you are developing with. In particular see the sections about using mixed C/C++ and Assembly naming conventions.

Here is an example of how you would declare a C++ function to disable name mangling. The function name would then be resolved from C correctly as myfunc() or from assembly as _myfunc.