在把这个
玩玩DirectShow--(1)Sample: Texture3D9 改成Unicode版本的时候,总是链接不过,居然好长时间都没想到是链接的strmbasd.lib不是unicode的,我靠!憋着没问别人,终于解决了。培养独立解决问题的能力!
在目录C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\里
自己建个新文件叫makefile_unicode,把makefile的内容拷过来,改几个地方
1)粗体的部分加了个u
!IFDEF NODEBUG
STRMBASE=strmbaseu
!else
STRMBASE=strmbasud
!endif
2) 编译选项增加了
/D "_UNICODE" /D "UNICODE"看下面的粗体部分就是改变的部分
#----- Include the PSDK's WIN32.MAK to pick up defines-------------------
!include <win32.mak>
LINK32_OBJS= \
$(OUTDIR)\amextra.obj \
$(OUTDIR)\amfilter.obj \
$(OUTDIR)\amvideo.obj \
$(OUTDIR)\combase.obj \
$(OUTDIR)\cprop.obj \
$(OUTDIR)\ctlutil.obj \
$(OUTDIR)\ddmm.obj \
$(OUTDIR)\dllentry.obj \
$(OUTDIR)\dllsetup.obj \
$(OUTDIR)\mtype.obj \
$(OUTDIR)\outputq.obj \
$(OUTDIR)\pstream.obj \
$(OUTDIR)\pullpin.obj \
$(OUTDIR)\refclock.obj \
$(OUTDIR)\renbase.obj \
$(OUTDIR)\schedule.obj \
$(OUTDIR)\seekpt.obj \
$(OUTDIR)\source.obj \
$(OUTDIR)\strmctl.obj \
$(OUTDIR)\sysclock.obj \
$(OUTDIR)\transfrm.obj \
$(OUTDIR)\transip.obj \
$(OUTDIR)\videoctl.obj \
$(OUTDIR)\vtrans.obj \
$(OUTDIR)\winctrl.obj \
$(OUTDIR)\winutil.obj \
$(OUTDIR)\wxdebug.obj \
$(OUTDIR)\wxlist.obj \
$(OUTDIR)\wxutil.obj
!IFDEF NODEBUG
STRMBASE=strmbaseu
!else
STRMBASE=strmbasud
!endif
all: $(OUTDIR) $(OUTDIR)\$(STRMBASE).lib
$(OUTDIR)\$(STRMBASE).lib: $(LINK32_OBJS)
$(link) -lib /OUT:$(OUTDIR)\$(STRMBASE).lib /MACHINE:$(CPU) /NODEFAULTLIB $(LINK32_OBJS) strmiids.lib
$(OUTDIR)\amextra.obj:
$(cc) $(cflags) $(cdebug) $(cvarsmt) /EHsc /Yc"streams.h" /Fp$(OUTDIR)\streams.pch /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\" /D_MBCS /I "." /I"$(DXSDK_DIR)\Include" /D_LIB /D_WIN32_DCOM /D "_UNICODE" /D "UNICODE" amextra.cpp
.cpp{$(OUTDIR)}.obj:
$(cc) $(cflags) $(cdebug) $(cvarsmt) /EHsc /Yu"streams.h" /Fp$(OUTDIR)\streams.pch /Fo"$(OUTDIR)\\" /Fd"$(OUTDIR)\\" /D_MBCS /I "." /I"$(DXSDK_DIR)\Include" /D_LIB /D_WIN32_DCOM /D "_UNICODE" /D "UNICODE" $**
#----- If OUTDIR does not exist, then create directory
$(OUTDIR) :
if not exist "$(OUTDIR)/$(NULL)" mkdir $(OUTDIR)
clean:
$(CLEANUP)
好了,开始生成吧
C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multi
media\DirectShow\BaseClasses>nmake /f makefile_unicode