c - Visual Studio referencing header and source files -


I have a C project in Visual Studio named "Framework".

The framework project should have a common code that should be shared between different projects.

I have another project (call it A) which should use code from framework.

Let's find out the framework project has a header named DALH and there is a declaration of a function called OpenFile, this function is DALP. Implemented in

I am trying to include DALH in my project. Openfile but I am getting the following error: unknown external symbol _penfile

I understand that the compiler was unable to find the implementation of OpenFile.

My question is that there is a similar case described here?

Do I need to "add existing items" and one of my projects is DAL. (This corrects the error ..)

I tried to add the "CONTINTING" folder to the "Additional source folders" folder, but did not help it from

Many thanks, Michael.

To use the compiled code of the OpenFile function, / P>

You have two options: 1) If you want to make the compiled code as part of your binary, then you need to include the source file so it can be compiled as part of your project.

2) If you do not want to include it in your project, and by its sound you do not say that it is "normal code should be shared between different projects", " Framework project "should be compiled in the library, in that case you only need to include the DAL.h header file, and import the" Framework Project "library in your project so that your project is in the library Could link to OpenFile call for implementation.


Comments