블로그 이미지
Kanais
Researcher & Developer 퍼즐을 완성하려면 퍼즐 조각들을 하나 둘씩 맞춰나가야 한다. 인생의 퍼즐 조각들을 하나 둘씩 맞춰나가다 보면 인생이란 퍼즐도 완성되는 날이 오려나...?

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

05-11 21:57

Recent Post

Recent Comment

Recent Trackback

Archive

2015. 5. 5. 17:58 Programming/Error Clear!


개발환경

사용툴       : Visual Studio 2013

라이브러리 : openCV library 2.4.10

                   ffmpeg - git-6ef3426 (2015-05-05)

프로젝트    : Visual C++ console application

개발날짜    : 2015-05-05



참고 : About C++ extern "C" - CProgramDevelop



#include "libswscale\swscale.h"

#include "libavformat\avformat.h"

#include "libavformat\avio.h"

#include "libavcodec\avcodec.h"

#pragma comment (lib, "avcodec.lib")

#pragma comment (lib, "avformat.lib")

#pragma comment (lib, "avutil.lib")

#pragma comment (lib, "swscale.lib") 


위와 같이 ffmpeg 라이브러리를 사용하려다가 아래와 같은 에러가 발생했다.

몇 시간동안 뭐가 잘못된건지 찾다가... 해결책을 찾았다.




아래와 같이 해주면 해결!

내 생각이지만... 아마도 ffmpeg 라이브러리의 함수들이 C로 되어있지 않나 생각해본다.

그 함수들을 C++에서 쓰려니.. 오류가 난 것인듯. 아마도?



extern "C" {

        #include "libswscale\swscale.h"

        #include "libavformat\avformat.h"

        #include "libavformat\avio.h"

        #include "libavcodec\avcodec.h"

 

        #pragma comment (lib, "avcodec.lib")

        #pragma comment (lib, "avformat.lib")

        #pragma comment (lib, "avutil.lib")

        #pragma comment (lib, "swscale.lib")

} 






posted by Kanais