Compiling with VS, cppan and /MT

32 views
Skip to first unread message

Ben Olden-Cooligan

unread,
Sep 19, 2018, 3:06:19 AM9/19/18
to tesseract-ocr
Hi,

I'm trying to build tesseract.exe on Windows/VS2017 using the /MT flag to avoid needing the VC++ runtime library. I have modified cppan.yml as follows:

local_settings:
    use_shared_libs
: false
    short_local_names
: true
    use_cache
: false
   
#generator: Visual Studio 14 2015 Win64
    silent
: false
   
#copy_import_libs: true
    build
:
        c_flags
: /W0 /MT
        cxx_flags
: /W0 /MT

    libtesseract:
        shared_only
: true

The modifications work fine to statically link libtesseract, but adding /MT to cxx_flags seems to have no effect. When I look at the the build output from cppan.exe there is plenty of /MD but no /MT, and the output exe is unchanged.

Does anyone have any idea what the problem might be, or another approach to avoid needing the runtime library?

Egor Pugin

unread,
Sep 19, 2018, 5:38:34 PM9/19/18
to tesseract-ocr
Hi,

It's quite tricky setup, so there might be problems you see.
Sorry for that.

I'm preparing cppan2 slowly to replace current cppan v1, and hopefully the issue will go away with it.
ETA - couple of months.
Reply all
Reply to author
Forward
0 new messages