Reputation: 27
I think this is a basic question, however I can not find any adequate posts about this topic or maybe I am just too stupid searching properly...
I have two projects in two different solutions. Project A is an application (.exe) using third party libs like ffmpeg (native C) and Project B is a DLL, which wants to use code of Project A (Purpose: A C# project is suppose to use funktionality of Project A via Project B). From my point of view I just have to add include path to Project A in order to include source files of it and set the linker input to the Project B .obj. However, when compiling Project B MSVS can not find the header file "libavutil/opt.h" of a ffmpeg Header:
#pragma once
extern "C"
{
#include <libavutil/opt.h>
#include <libavcodec/avcodec.h>
#include <libavutil/channel_layout.h>
#include <libavutil/common.h>
#include <libavutil/imgutils.h>
#include <libavutil/mathematics.h>
#include <libavutil/samplefmt.h>
}
fatal error C1083: Cannot open include file: 'libavutil/opt.h': No such file or directory.
Do I really have to set include paths to those ffmpeg libs? If doing so I get many LNK2001, 2005 and 2019 errors. Any Ideas?
Upvotes: 0
Views: 187
Reputation: 25518
Sorry, there is no way around setting up the include paths for your project. Possibly, you might facilitate this task, however, have a look at here.
You might consider a complete redesign: If project B uses code from Project A, you might want to move all the code to project B and let project A use the DLL, too. If you find it easier making an EXE project a DLL than setting up the include path, you could switch the roles of A and B, renaming them and changing their types appropriately and moving the code not remaining in the DLL to Project B, using Project A as DLL.
Edit (in response to your comment):
Upvotes: 1