MPlayer v1.0rc1 source compile trouble shooting

Computer/Linux Tips 2007. 7. 10. 23:17
1.

http://www.mplayerhq.hu/homepage/design7/dload.html


여기서 다운받은 mplayer의 1.0 rc1 의 source를 cygwin에서 컴파일.

아..참고로 쌩은 아니고 RTP 지원을 위하여 live555 라는 라이브러리를 우선 추가적으로 build하였다.

live555 와 mplayer 관련은 다음 사이트.
http://www.live555.com/mplayer/

configure과정중에 mplayer는 live555의 존재를 자동으로 검색하였고, 성공적으로 컴파일이 되는듯 하였다. 그러나,...!!

요런 에러 발생.
libavcodec/libavcodec.a(mpegaudiodec.o):mpegaudiodec.c:(.text+0x5a0): undefined reference to `_llrint'

한참 뒤지다보니 여기서 답글대로.. "dirty trick"을 찾았다.

http://article.gmane.org/gmane.comp.video.mplayer.cygwin/2561
I have a very dirty trick for you: just change the occurrences of llrint
to lrint (e.g., add a #define llrint lrint)
Very dirty, but it works!
Cheers
Enzo

libavcodec/mpegaudiodec.c 에서
#define llrint lrint
을 해주고 나니

dirty하지만 컴파일은 된다. MPEG 코덱에 대해서 잘 돌아가는지는 테스트가 필요할 것 같다.

2.

이용하던 모종의 패치가 적용된 mplayer 소스에 대해서는 이런 에러가 발생
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x11e4): undefined reference to `_remoteServAddr'
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x11fe): undefined ref
erence to `_sd'
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x1228): undefined ref
erence to `_rc'
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x1235): undefined ref
erence to `_mfd'
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x125a): undefined ref
erence to `_rc'
libmpcodecs/libmpcodecs.a(dec_video.o):dec_video.c:(.text+0x146f): undefined ref
erence to `_sd'

해결은 못했다. -_-......

"ld: cannot find -lX11" error가 날때.

Computer/Linux Tips 2007. 7. 9. 17:01

Ref.: http://kldp.org/node/43963

X가 /usr/X11R6에 설치되어 있다면..

$ gcc -I/usr/X11R6/include -L/usr/X11R6/lib asdf.c -lX11

매번 -I, -L을 쓰는게 귀찮다면...

$ export LIBRARY_PATH=/usr/X11R6/lib:$LIBRARY_PATH
$ export C_INCLUDE_PATH=/usr/X11R6/include:$C_INCLUDE_PATH
$ gcc asdf.c -lX11

mplayer관련 메모

Computer/Linux Tips 2007. 3. 31. 15:20

VLC Compile 과 gprof Result.

Computer/Linux Tips 2007. 3. 22. 13:36
VLC 를 Cygwin에서 컴파일하기.

일단...컴파일은 아래 내용 참조함.

http://blog.naver.com/kingseft.do?Redirect=Log&logNo=140035026543


* 삽질 Report
1. make 도중 dshow.cpp 관련하여 다음과 같은 에러가 죽 떴었다.
/usr/lib/gcc/i686-pc-mingw32/3.4.4/include/c++/cwchar:146: error: `::fgetwc' has not been declared
위 에러와 비슷한 모양, 또는 include 관련하여 declare가 안되었다고 계속 삑사리 냈었는데 이때문에 대략 3일 소요. 할수 있는 짓을 다 해보았지만 해결할 수 없었다.
그런데 퍼뜩 생각난 것이 이전에 ACE Library를 설치하느라 CLUS_INCLUDE_PATH를 강제 지정했었던 것.
재빨리 .bash_profile 을 열어보았더니 아니나 다를까 지정되어 있엇다.

export ACE_ROOT="/ACE_wrappers"
#export LD_LIBRARY_PATH="$ACE_ROOT/lib:$LD_LIBRARY_PATH"
export PATH=$PATH:/usr/local/lib:./
#export CPLUS_INCLUDE_PATH=/usr/include:/usr/local/include:$CPLUS_INCLUDE_PATH

낼름 #을 이용하여 주석처리 해버리고 make를 돌리니 돌아갔다. 이런 어이없는 것 때문에 시간을 그렇게 많이 쓰다니 ㅠ
참고로 어디에도 없는 내용이었다. 나쁜 VLC 놈들 ㅠ

2. make 잘 하고, 위의 내용중에 있는 cygwin에서 window용으로 만들기 위하여
make vlc-win32-base 인가.. 아무튼 이런거 했다.
잘 되었는데, 생성된 vlc.exe 녀석이 어이없게도 실행하려 했더니
access denied 랜다. 얼어죽을!
열받아서 chmod 777 해버리고 다시 했으나 여전히 access denied.
내가 root인데 무슨 권한이 없단 말이냣!!! -_-
이걸 놓고 또 한참 삽질했다.
별다르게 손댄건 없는데 -_- 다음날 와서 다시 끼적끼적 해보니 또 실행이 되어비리신다.
이 놀라운 녀석들.

3. codec이랑 frame의 정보를 손을 대서 좀 만들어야 할짓이 있어서 방대한 소스에 대한 profiling이 필수적으로 필요했다.
./bootstrap && \
PKG_CONFIG_PATH=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include/freetype2 -I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -pg -mno-cygwin" CXX="g++ -pg -mno-cygwin" \
./configure \
--disable-gtk \
--enable-nls --enable-sdl --with-sdl-config-path=/usr/win32/bin \
--enable-ffmpeg --with-ffmpeg-mp3lame --with-ffmpeg-faac \
--with-ffmpeg-zlib --enable-faad --enable-flac --enable-theora \
--with-wx-config-path=/usr/win32/bin \
--with-freetype-config-path=/usr/win32/bin \
--with-fribidi-config-path=/usr/win32/bin \
--enable-livedotcom --with-livedotcom-tree=/usr/win32/live.com \
--enable-caca --with-caca-config-path=/usr/win32/bin \
--with-xml2-config-path=/usr/win32/bin \
--with-dvdnav-config-path=/usr/win32/bin \
--disable-cddax --disable-vcdx --enable-goom \
--enable-twolame --enable-dvdread \
--enable-debug --disable-mkv

위와 같이 booltstrap시에 CC와 CXX에 -pg 옵션을 추가하여 컴파일했다.
크게 문제는 없었다.
그런데, 상기 기술한 2의 문제가 발생. 실행이 되어야 gmon.out을 가지고 프로파일링을 하던 말던 할것 아니냐!!!
근데 2번 문제가 어이없이 해결이 되어버려, result를 얻어내긴 했다.
다른것 찾다가 알아낸 일이지만 VLC는 multi thread라서 gprof으로는 제대로된 profiling을 얻어내기 힘들댄다.
cygwin에선 젠장 어쩌라는거야..



4.
한참 뒤져보니 VLC configure를 할 때.
--disable-xxxxx 를 통해서 수많은 플러그인과 라이브러리와 component들을 disable시키고 제법 빠르고 가볍게 만들수 있는것 같다.
예를 들면 이런식으로.
./configure --enable-skins2 --disable-pda --enable-wxwidgets --disable-opie --disable-macosx --disable-qnx --disable-ncurses --enable-xosd --enable-visual --disable-goom --disable-slp --disable-lirc --disable-joystick --disable-corba --disable-livedotcom --disable-dvdread --enable-dvdnav --disable-dshow --enable-dvbpsi --enable-v4l --disable-pvr --disable-vcd --disable-satellite --disable-dvb --enable-ogg --disable-mkv --disable-mod --disable-libcdio --disable-vcdx --disable-cddax --disable-libcddb --enable-x11 --enable-xvideo --enable-glx --disable-fb --disable-mga --disable-sdl --enable-freetype --enable-fribidi --disable-svg --disable-qte --disable-hd1000v --disable-directx --disable-wingdi --disable-svgalib --disable-ggi --disable-glide --disable-aa --disable-caca --enable-oss --disable-esd --disable-arts --enable-alsa --disable-waveout --disable-coreaudio --disable-hd1000a --enable-mad --enable-ffmpeg --disable-faad --disable-quicktime --enable-a52 --disable-dts --disable-flac --enable-libmpeg2 --enable-vorbis --disable-tremor --disable-speex --disable-tarkin --disable-theora --disable-cmml --enable-utf8 --disable-pth --disable-st --disable-gprof --disable-cprof --disable-mozilla --disable-testsuite --disable-optimizations --disable-altivec --enable-debug --disable-release --enable-sout --enable-galaktos --enable-httpd


5. 참고한 사이트 모음
http://www.videolan.org/vlc/download-sources.html

http://wiki.videolan.org/Subversion#Projects_on_VideoLAN.27s_SVN

http://blog.naver.com/kingseft?Redirect=Log&logNo=140010302765
http://blog.naver.com/kingseft.do?Redirect=Log&logNo=140035026543
http://blog.naver.com/kingseft.do?Redirect=Log&logNo=140010325743
http://kldp.org/node/64485
http://wiki.videolan.org/Win32Compile

아 아무튼 삽질 너무 오래했다.

이제 이놈을 또 어떻게 구워삶는담.

'Computer > Linux Tips' 카테고리의 다른 글

Linux Shell programming 관련  (0) 2007.04.17
mplayer관련 메모  (0) 2007.03.31
원격에서 X-manager로 X-window 사용하기  (0) 2007.03.19
gcc로 윈도우즈 API 프로그램 만들기  (0) 2007.03.15
ftp mget 사용법  (0) 2007.03.07

gcc로 윈도우즈 API 프로그램 만들기

Computer/Linux Tips 2007. 3. 15. 13:27

Ref. : http://blog.naver.com/namong98?Redirect=Log&logNo=15611346

이 문서에 첨부한 TextOut.cpp라는 윈도우즈 API 소스 프로그램을 TextOut.exe라는 실행 파일로 빌드하기 위해서는 아래와 같이 명령을 내려주면 됩니다. Cygwin 루트 디렉토리 아래의 bin 디렉토리가 윈도우즈 PATH에 들어가 있다면 굳이 Cygwin 안에서 다음 명령을 내릴 필요는 없습니다.


gcc -mwindows -mno-cygwin TextOut.cpp -o TextOut.exe


여기서 옵션을 간단히 설명하면,


-mwindows : 윈도우즈 API를 사용한다는 뜻입니다.


-mno-cygwin : cygwin1.dll없이도 돌아가는 프로그램을 만든다는 뜻입니다.


만들어진 TextOut.exe를 실행하면, 아래와 같은 화면이 보이고, 화면안을 클릭하면 문자열이 나타났다 사라졌다 합니다.


strip 명령을 사용하면, 실행 파일 안의 심볼을 제거해서 실행 파일의 용량을 줄일 수 있습니다. 위에서 만든 TextOut.exe 파일의 용량을 줄이려고 한다면,

strip TextOut.exe


라고 하면 됩니다. TextOut.exe 파일은 그대로 두고 다른 TextOut1.exe 라는 파일로 strip하고 싶다면,


strip TextOut.exe -o TextOut1.exe


와 같이 하면 됩니다.


제가 이 문서에 첨부한 TextOut.cpp를 컴파일 하고, strip 시켜보니 파일 크기의 변화가 아래와 같았습니다.


strip 전,
TextOut.exe : 20841

strip 후,
TextOut1.exe : 6656


윈도우즈 API 프로그램을 빌드하기 위한 옵션이 많아 입력하기 귀찮다면 윈도우즈에서는 배치 파일을 만들고 Cygwin에서는 쉘 스크립트를 만들면 편하게 작업할 수 있을 것입니다.



~끝~


좋은 하루 되세요~ ^^

'Computer > Linux Tips' 카테고리의 다른 글

VLC Compile 과 gprof Result.  (2) 2007.03.22
원격에서 X-manager로 X-window 사용하기  (0) 2007.03.19
ftp mget 사용법  (0) 2007.03.07
Linux Network Emulator  (0) 2007.03.06
Linux 방화벽 설정하기 (IPtables)  (0) 2007.02.24

Cygwin에 ACE Library 설치하기

Computer/Linux Tips 2007. 2. 24. 14:29

Versions: Cygwin CYGWIN_NT-5.1
ACE 5.5.1
g++ 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)

(cmake is available by cygwin project)

Before making ACE

  1. Get and decompress tar ball (e.g. /work/ACE_wrappers).
  2. Set an environment variable;
export $ACE_ROOT=/work/ACE_wrappers
  1. Create some symbolic links;
cd $ACE_ROOT/include/makeinclude
ln -s platform_cygwin32.GNU platform_macros.GNU
cd $ACE_ROOT/ace ln -s config-cywin32.h config.h

Setting include path

Compiling ACE generates many errors by default of cygwin. It is because the preprocessor of g++ on cygwin behaved in a strange way. It regards the lines "signal.h" or so on in /usr/include/*.h files as the same name files in ACE.

Solution: To avoid this errors, you should export an environment variable like:

export CPLUS_INCLUDE_PATH
=/usr/include:/usr/local/include:$CPLUS_INCLUDE_PATH

and

make

Then you can compile ACE without any errors. This issue is not declaired at the official homepage of ACE/TAO.

Local Installation

To install ACE to your cygwin,

 
cp -r $ACE_ROOT/ace /usr/local/include
cp $ACE_ROOT/lib/* /usr/local/lib

To tell your cygwin where is the ACE dynamic libraries,

 
export PATH=/usr/local/lib:$PATH"

cygwin cannot search the libraries without setting PATH variable properly. It's a specification of cygwin.


Additional step to test ACE:

cd $ACE_ROOT/tests
make
perl run_test.pl

'Computer > Linux Tips' 카테고리의 다른 글

gcc로 윈도우즈 API 프로그램 만들기  (0) 2007.03.15
ftp mget 사용법  (0) 2007.03.07
Linux Network Emulator  (0) 2007.03.06
Linux 방화벽 설정하기 (IPtables)  (0) 2007.02.24
Open Source Streaming Server Video Lan setting  (3) 2007.02.24