Build with MSVC 2005

2007-03-16
2012-12-01
  • Nobody/Anonymous

    Windjview is the best handdy and fast djvu viewer I have used!

    Yesterday ,I checked out the cvs and want to compiling from the source.
    When building libdjvu,cl gave some errors:

    --------------------------
    F:\Source\windjview\libdjvu> nmake "DEBUG=0" "UNICODE=0" /f makefile

    Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
    Copyright (C) Microsoft Corporation.  All rights reserved.

    cl : Command line warning D9035 : option 'GX' has been deprecated and will be re
    moved in a future release
    cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
    Arrays.cpp
    BSByteStream.cpp
    BSEncodeByteStream.cpp
    ByteStream.cpp
    DataPool.cpp
    debug.cpp
    DjVmDir.cpp
    DjVmDir0.cpp
    DjVmDoc.cpp
    DjVmNav.cpp
    DjVuAnno.cpp
    DjVuDocEditor.cpp
    f:\source\windjview\libdjvu\DjVuDocEditor.h(176) : warning C4301: 'DjVuDocEditor
    ::save_as': overriding virtual function only differs from 'DjVuDocument::save_as
    ' by const/volatile qualifier
            f:\source\windjview\libdjvu\DjVuDocument.h(758) : see declaration of 'Dj
    VuDocument::save_as'
    DjVuDocument.cpp
    DjVuDumpHelper.cpp
    DjVuErrorList.cpp
    DjVuFile.cpp
    DjVuFileCache.cpp
    DjVuGlobal.cpp
    DjVuGlobalMemory.cpp
    DjVuImage.cpp
    Generating Code...
    Compiling...
    DjVuInfo.cpp
    DjVuMessage.cpp
    DjVuMessageLite.cpp
    DjVuNavDir.cpp
    DjVuPalette.cpp
    DjVuPort.cpp
    DjVuText.cpp
    DjVuToPS.cpp
    GBitmap.cpp
    GContainer.cpp
    GException.cpp
    GIFFManager.cpp
    GMapAreas.cpp
    GOS.cpp
    GPixmap.cpp
    GRect.cpp
    GRect.cpp(276) : warning C4244: 'return' : conversion from '__int64' to 'int', p
    ossible loss of data
    GRect.cpp(278) : warning C4244: 'return' : conversion from '__int64' to 'int', p
    ossible loss of data
    GRect.cpp(287) : warning C4244: 'return' : conversion from '__int64' to 'int', p
    ossible loss of data
    GRect.cpp(289) : warning C4244: 'return' : conversion from '__int64' to 'int', p
    ossible loss of data
    GScaler.cpp
    GSmartPointer.cpp
    GString.cpp
    GThreads.cpp
    Generating Code...
    Compiling...
    GUnicode.cpp
    GURL.cpp
    IFFByteStream.cpp
    IW44EncodeCodec.cpp
    IW44Image.cpp
    JB2EncodeCodec.cpp
    JB2Image.cpp
    JPEGDecoder.cpp
    MMRDecoder.cpp
    MMX.cpp
    UnicodeByteStream.cpp
    XMLParser.cpp
    XMLTags.cpp
    ZPCodec.cpp
    Generating Code...
    debug.obj : warning LNK4221: no public symbols found; archive member will be inaccessible

    ---------------------
    Is Windjview built with MSVC 2003,and is there anybody built it successfully with MSVC 2005?

     
    • Andrew Zhezherun

      Actually, there are no errors in the attached log. :)

      To compile the cvs version with VC 2005, first run the command
      nmake "UNICODE=1" "NEWCL=1"
      in the libdjvu folder, and then the command
      nmake "UNICODE=1"
      in the WinDjView folder.
      You don't need to include arguments "DEBUG=0" and /f makefile, because these are the default.

       
    • Nobody/Anonymous

      Thanks for your reply :)

      Flowing your instruction,I got some errors:
      ----- libdjvu errors ------
      ...
      ...
      f:\source\windjview\libdjvu\DjVuDocEditor.h(176) : warning C4301: 'DjVuDocEditor
      ::save_as': overriding virtual function only differs from 'DjVuDocument::save_as
      ' by const/volatile qualifier   f:\source\windjview\libdjvu\DjVuDocument.h(758) : see declaration
      of 'DjVuDocument::save_as'
      ...
      ...
      GRect.cpp(276) : warning C4244: 'return' : conversion from '__int64' to 'int', p
      ossible loss of data
      GRect.cpp(278) : warning C4244: 'return' : conversion from '__int64' to 'int', p
      ossible loss of data
      GRect.cpp(287) : warning C4244: 'return' : conversion from '__int64' to 'int', p
      ossible loss of data
      GRect.cpp(289) : warning C4244: 'return' : conversion from '__int64' to 'int', p
      ossible loss of data
      -----------------------------

      and more errors when building windjview:

      .....
      .....
      DjVuSource.cpp(835) : warning C4244: 'initializing' : conversion from 'ULONGLONG
      ' to 'int', possible loss of data
      ....
      ....
      MyDocManager.cpp(270) : error C2678: binary '+' : no operator found which takes
      a left-hand operand of type 'const char [2]' (or there is no acceptable conversi
      on)
              D:\VS8\VC\ATLMFC\INCLUDE\atlsimpstr.h(666): could be 'ATL::CSimpleString
      T<BaseType> ATL::CSimpleStringT<BaseType>::operator +(const ATL::CSimpleStringT<
      BaseType> &,const ATL::CSimpleStringT<BaseType> &)' [found using argument-depend
      ent lookup]
              with
              [
                  BaseType=TCHAR
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\atlsimpstr.h(677): or 'ATL::CSimpleStringT<Base
      Type> ATL::CSimpleStringT<BaseType>::operator +(const ATL::CSimpleStringT<BaseTy
      pe> &,const unsigned short *)' [found using argument-dependent lookup]
              with
              [
                  BaseType=TCHAR
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\atlsimpstr.h(688): or 'ATL::CSimpleStringT<Base
      Type> ATL::CSimpleStringT<BaseType>::operator +(const unsigned short *,const ATL
      ::CSimpleStringT<BaseType> &)' [found using argument-dependent lookup]
              with
              [
                  BaseType=TCHAR
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2289): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT
      <BaseType,StringTraits> &,const ATL::CStringT<BaseType,StringTraits> &)' [found
      using argument-dependent lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2298): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT
      <BaseType,StringTraits> &,const unsigned short *)' [found using argument-depende
      nt lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2307): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const unsigned shor
      t *,const ATL::CStringT<BaseType,StringTraits> &)' [found using argument-depende
      nt lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2316): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT
      <BaseType,StringTraits> &,wchar_t)' [found using argument-dependent lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2326): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT
      <BaseType,StringTraits> &,char)' [found using argument-dependent lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2336): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(wchar_t,const ATL::
      CStringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              D:\VS8\VC\ATLMFC\INCLUDE\cstringt.h(2346): or 'ATL::CStringT<BaseType,St
      ringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(char,const ATL::CSt
      ringT<BaseType,StringTraits> &)' [found using argument-dependent lookup]
              with
              [
                  BaseType=wchar_t,
                  StringTraits=StrTraitMFC<wchar_t>
              ]
              f:\source\windjview\libdjvu\GString.h(875): or 'GUTF8String operator +(c
      onst char *,const GUTF8String &)'
              f:\source\windjview\libdjvu\GString.h(1038): or 'GNativeString operator
      +(const char *,const GNativeString &)'
              while trying to match the argument list '(const char [2], CString)'
      Compiling...
      MyDocTemplate.cpp
      MyEdit.cpp
      MyFileDialog.cpp
      MyScrollView.cpp
      MySplitterWnd.cpp
      MyStatusBar.cpp
      MyTheme.cpp
      MyToolBar.cpp
      MyTreeCtrl.cpp
      NavPane.cpp
      PageIndexWnd.cpp
      PrintDlg.cpp
      ProgressDlg.cpp
      RenderThread.cpp
      Scaling.cpp
      SearchResultsView.cpp
      SettingsAssocsPage.cpp
      SettingsDictPage.cpp
      SettingsDisplayPage.cpp
      SettingsDlg.cpp
      Compiling...
      SettingsGeneralPage.cpp
      ThumbnailsThread.cpp
      ThumbnailsView.cpp
      UpdateDlg.cpp
      WinDjView.cpp
      XMLParser.cpp
      ZoomDlg.cpp
      NMAKE : fatal error U1077: 'D:\VS8\VC\BIN\cl.EXE' : return code '0x2'
      Stop.
      ------------

      Building both libdjvu and windjview without "UNICODE=1" successfully,
      unfortunately,when I open any djvu file,windjview tell me
      " A fatal error has occurred.
      It could have been caused by a malformed djvu document.The application may not perform properly afer this error.You are strongly advised to reopen the application....."

       
      • Andrew Zhezherun

        Please don't keep writing about "warnings" as "errors" :)
        From your post I understand that libdjvu compiles successfully.

        I don't have full MSVC 2005 myself, so I cannot reliably test this. I'm currently using Visual C++ 2005 Express combined with latest Platform SDK, and MFC version 6.0 from VC6. I have also built WinDjView successfully with full MSVC 2003 some time ago.

         
      • Andrew Zhezherun

        A quick fix for line 270 in MyDocManager.cpp would be, of course, to enclose "#" into _T().

         
    • Nobody/Anonymous

      Sorry for that :),I will take some time to make it work.

      I am wondering is it possible to port windjview from MFC to wxwidgets,and  how difficult to do this?

      http://wxwidgets.org/

       
      • Andrew Zhezherun

        I have no plans to rewrite WinDjView to use wxWidgets, QT or any other toolkit. Of course it is possible, but I cannot estimate the amount of work needed. Please feel free to play with the source code of WinDjView yourself.

         
    • MCH

      MCH - 2007-03-21

      Why don't you just build a project for both libdjvu and windjview in MSVC 2005? I do that and succeed in compiling everything without any errors (except some wrannings).

      p.s. I can run the compiled windjview without any problem; however, when I try to open any djvu document, it crashes.

       
    • Nobody/Anonymous

      microsoft decided to make sizeof(iterator)==8 (2 pointers), for security reason, EVEN IN RELEASE MODE. in order to remove this security check, you need to define:

      /D"_SECURE_SCL=0"

      in release mode. windjview passes iterators via windows function LPARAM, which is only 4 bytes (1 pointer), which causes the crashing when casting back to iterator<>... (not very nice design!)

      it works in release mode. unfortunately i don't know how to deal with this in debug mode...

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks