gpt4 book ai didi

windows - 如何在Windows上使用makefile创建libjson.lib?

转载 作者:行者123 更新时间:2023-12-02 10:46:09 29 4
gpt4 key购买 nike

我从以下链接下载了C++ libJSON:https://sourceforge.net/projects/libjson/
如何使用他们提供的代码创建一个库?

我安装了MinGW,将其添加到环境变量的路径中,并使用cd到目录中,该目录中有makefile,并尝试使用mingw32-make.exe。
但是我得到这个错误:

enter image description here

我知道我需要添加参数,但是我不知道要添加什么。
你能帮忙吗?
谢谢!

最佳答案

我正在研究v 7.6.1 (目前最新)。从[SourceForge]: ninja9578/libjson - libjson_7.6.1.zip下载了它。

起初,我认为这是一个半小时的问题(由于Win的mkdir默认情况下会创建嵌套的目录,并且不接受-p参数,因此makefile中的更改很小)。

为了清楚起见,我尝试从Win的cmd窗口运行MinGW的mingw32-make(不涉及其他包装器)。

因此,我开始(在makefile中)插入条件命令(基于OS),但这还不够。与获得的 yield 相比,原始makefile所需的更改似乎太大了(使文件更难理解):在一个很少有人在意的环境中工作,因此合理的解决方案是创建一个单独的makefile (称为 Makefile.mak )

不过,官方文档(“$ {LIBJSON_SRC_DIR}/Documentation.pdf”)指出:

MinGW (Windows) - Supported, partially tested



我没有遍历整个.pdf来了解发生此情况的必要条件,但是(除了它不起作用-因此存在此问题),查看makefile时,有些事情没有看起来不对:
  • Shell(Nix(sh,bash,...)与Win(batch(cmd),PS,VBS,...))命令(在GNU makefile中限定为可用的)差异(rm -fdel /Q /S)
  • 生成文件命令的方式(每个命令的CreateProcess:包括 cd -不会改变环境(cwd),不会导致下一个命令失败),还包括命令分隔符(; ),不能按预期工作
  • 由上述命令
  • 处理的FS路径分隔符( / \ )

    考虑到应该在Win上保留当前的Nix(Lnx)行为,因此我“转换了” makefile,并且我还发现了一些(语法上的)错误(因此,显然 Nix版本在中均不起作用-很好地建立了库,就是这样)。修复了错误,然后将答案发布在 官方网站上(以便以前关注它的任何人都应该知道更改)。

    简短地看了一下,发现最后一个 Action 是从180622开始的(该日期附近还有更多)。但是仔细观察时,似乎最后的实际工作是 5年前完成的(2013),所以我不确定是否要维护(也可以快速浏览 GitHub,但没有找到它)。

    无论如何,由于没有开放票证(提交补丁程序)的权限,所以我联系了作者,但没有得到任何回复,因此我启动了一个线程: [SourceForge]: ninja9578/libjson - Request for permissions to submit a patch。我将提交补丁(前提是将向我授予权限)。

    长话短说

    无论如何,这是Win make文件(主要是从原始文件中复制的):

    Makefile.mak:

    ###############################################################################
    #
    # Copyright 2010 Jonathan Wallace. All rights reserved.
    #
    # Redistribution and use in source and binary forms, with or without
    # modification, are permitted provided that the following conditions are met:
    #
    # 1. Redistributions of source code must retain the above copyright
    # notice, this list of conditions and the following disclaimer.
    #
    # 2. Redistributions in binary form must reproduce the above copyright
    # notice, this list of conditions and the following disclaimer in the
    # documentation and/or other materials provided with the distribution.
    #
    # THIS SOFTWARE IS PROVIDED BY JONATHAN WALLACE ``AS IS'' AND ANY
    # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JONATHAN WALLACE OR
    # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
    # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
    # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
    # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
    # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
    # DAMAGE.
    #
    # The views and conclusions contained in the software and documentation are
    # those of the authors and should not be interpreted as representing official
    # policies, either expressed or implied, of Jonathan Wallace....
    #
    #
    # Author Bernhard Fluehmann
    #
    # bernhard.fluehmann@patton-inalp.com
    #
    #
    # Adapted for Windows (MinGW) by Cristi Fati (fati_utcluj@yahoo.com)
    #
    #
    # TARGETS
    # all
    # Builds either a shared or a static library, depending of the value
    # of the SHARED variable.
    # Default: static
    #
    # banner
    # Displays the library version and the target
    #
    # install
    # Installs either the shared of the static library, depending of the value
    # of the SHARED variable. Installs the header files as well.
    # Builds the library before installing if it does not exist already.
    # Ececutes ldconfig in case of the shared library.
    # Default locations:
    # library: $(exec_prefix)/$(libdir) => /usr/lib
    # headers: $(prefix)/$(includedir) => /usr/include
    #
    # install_headers
    # Installs the header files.
    # Default location: $(prefix)/$(includedir) => /usr/include
    #
    # clean
    # Removes the shared or the static library, depending of the value
    # of the SHARED variable, from this folder and all the folders and objects
    # which were created to build it.
    #
    # uninstall
    # Removes the shared or the static library, depending of the value
    # of the SHARED variable from the system. In case of the shared library,
    # removes the symbolic links as well and executes ldconfig.
    #
    # uninstall_headers
    # Remove the headers from the system.
    #
    # Variables
    # prefix
    # The general installation root directory. Default: /usr
    #
    # exec_prefix
    # The installation root directory to place executables and libraries.
    # Default: prefix
    #
    # libdir
    # The directory where the libraries are installed, as a subdirectory of
    # exec_prefix. Default: lib
    #
    # includedir
    # The directory where the header files are installed, as a subdirectory of
    # prefix. Default: include
    #
    # srcdir
    # The directory where the object source files are located.
    # Default: _internal/Source
    #
    # CXX
    # The compiler to be used. Default: c++
    #
    # CXXFLAGS
    # The compiler flags used to compile the object files.
    # Default:
    # cxxflags_default for default
    # cxxflags_small for BUILD_TYPE=small
    # cxxflags_debug for BUILD_TYPE=debug
    #
    # AR
    # The archiver to be used. Default: ar
    #
    # PIC
    # The PIC to be used. Default: PIC
    #
    # BUILD_TYPE
    # Used to select a specific set of predefined configuration parameters.
    # Default: undefined: The default settings are used
    # Options:
    # small
    # debug
    #
    # SHARED
    # Used to select if the library is a shared or a dynamic one
    # Default: undefined: static
    # Options:
    # 0: static
    # 1: shared
    #
    #
    #

    # Shell (cmd) commands
    movefile = move /Y
    copyfile = copy /Y
    removefile = del /Q /S
    makedirs = -mkdir
    copydir = xcopy /B /E /H /K /Y
    removedir = -rmdir /Q /S
    makelink = mklink


    # JSON source files to build
    objects = internalJSONNode.o JSONAllocator.o JSONChildren.o \
    JSONDebug.o JSONIterators.o JSONMemory.o JSONNode.o \
    JSONNode_Mutex.o JSONPreparse.o JSONStream.o JSONValidator.o \
    JSONWorker.o JSONWriter.o libjson.o

    # Defaults
    cxxflags_default = -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
    cxxflags_small = -Os -ffast-math -DJSON_LESS_MEMORY -DNDEBUG
    cxxflags_debug = -g -DJSON_SAFE -DJSON_DEBUG
    cxxflags_shared = -f$(PIC)
    libname = libjson
    libname_hdr := $(libname)
    libname_debug = $(libname)_dbg
    suffix_shared = so
    suffix_static = a
    major_version = 7
    minor_version = 6.1
    objdir = Objects


    # Variables
    prefix ?= ../install_libjson
    exec_prefix ?= $(prefix)
    libdir ?= lib
    includedir ?= include
    intdir ?= _internal
    srcdir ?= $(intdir)/Source
    CXX ?= c++
    AR ?= ar
    PIC ?= PIC
    BUILD_TYPE ?= "default"
    SHARED ?= "1"


    # Internal Variables
    inst_path = $(exec_prefix)/$(libdir)
    include_path = $(prefix)/$(includedir)

    install_include_lib_dir = $(include_path)/$(libname_hdr)
    install_include_lib_src_dir = $(install_include_lib_dir)/$(srcdir)

    # Usage check
    ifdef CXXFLAGS
    ifdef BUILD_TYPE
    $(error CXXFLAGS and BUILD_TYPE are mutually exclusive)
    endif
    endif

    # BUILD_TYPE specific settings
    ifeq ($(BUILD_TYPE),small)
    CXXFLAGS = $(cxxflags_small)
    else ifeq ($(BUILD_TYPE),debug)
    CXXFLAGS = $(cxxflags_debug)
    libname := $(libname_debug)
    else
    CXXFLAGS ?= $(cxxflags_default)
    endif

    # SHARED specific settings
    ifeq ($(SHARED),1)
    libname_shared = $(libname).$(suffix_shared)
    libname_shared_major_version = $(libname_shared).$(major_version)
    lib_target = $(libname_shared_major_version).$(minor_version)
    objdir := $(objdir)_shared
    CXXFLAGS := $(CXXFLAGS) $(cxxflags_shared)
    else
    lib_target = $(libname).$(suffix_static)
    objdir := $(objdir)_static
    endif

    # Win styple paths - to be used by shell commands
    objdir_win = $(subst /,\,$(objdir))
    inst_path_win = $(subst /,\,$(inst_path))
    intdir_win = $(subst /,\,$(intdir))
    srcdir_win = $(subst /,\,$(srcdir))
    install_include_lib_dir_win = $(subst /,\,$(install_include_lib_dir))
    install_include_lib_src_dir_win = $(subst /,\,$(install_include_lib_src_dir))


    # Phony targets
    .PHONY: all banner installdirs install install_headers clean uninstall uninstall_headers

    # Targets
    all: $(lib_target)
    @echo "============================================================"
    @echo "Done"
    @echo "============================================================"

    banner:
    @echo "============================================================"
    @echo "libjson version: "$(major_version).$(minor_version) "target: "$(target) "OS: "Windows
    @echo "============================================================"

    installdirs: banner
    $(makedirs) $(objdir_win)

    # Libraries
    ifeq ($(SHARED),1)
    $(lib_target): banner installdirs $(addprefix $(objdir)/, $(objects))
    @echo "Link "
    cd $(objdir_win) && \
    $(CXX) -shared -Wl,-soname,$(libname_shared_major_version) -o $@ $(objects) && \
    $(movefile) $@ ..
    @echo "Link: Done"
    else
    $(lib_target): banner installdirs $(addprefix $(objdir)/, $(objects))
    @echo "Archive"
    cd $(objdir_win) && \
    $(AR) -cvq $@ $(objects) && \
    $(movefile) $@ ..
    @echo "Archive: Done"
    endif

    # Compile object files
    $(objdir)/%.o: $(srcdir)/%.cpp
    $(CXX) $< -o $@ -c $(CXXFLAGS)

    ifeq ($(SHARED),1)
    install: banner install_headers $(lib_target)
    @echo "Install shared library"
    $(makedirs) $(inst_path_win)
    $(copyfile) $(lib_target) $(inst_path_win)
    cd $(inst_path_win) && \
    $(removefile) $(libname_shared_major_version) && $(makelink) $(libname_shared_major_version) $(lib_target) && \
    $(removefile) $(libname_shared) && $(makelink) $(libname_shared) $(libname_shared_major_version)
    @echo ldconfig
    @echo "Install shared library: Done."
    else
    install: banner install_headers $(lib_target)
    @echo "Install static library"
    $(makedirs) $(inst_path_win)
    $(copyfile) .\$(lib_target) $(inst_path_win)
    @echo "Install static library: Done."
    endif

    install_headers: banner
    @echo "Install header files"
    $(makedirs) $(install_include_lib_src_dir_win)\JSONDefs
    $(makedirs) $(install_include_lib_src_dir_win)\Dependencies
    $(copyfile) .\*.h $(install_include_lib_dir_win)
    -$(removefile) $(install_include_lib_dir_win)\.*.h
    $(copyfile) .\$(srcdir_win)\*.h $(install_include_lib_src_dir_win)
    -$(removefile) $(install_include_lib_src_dir_win)\.*.h
    $(copydir) .\$(srcdir_win)\JSONDefs $(install_include_lib_src_dir_win)\JSONDefs
    $(copydir) $(intdir_win)\Dependencies $(install_include_lib_src_dir_win)\Dependencies
    @echo "Install header files: Done."

    clean: banner
    @echo "Clean library and object folder"
    $(removedir) $(objdir_win)
    -$(removefile) $(lib_target)
    @echo "Clean library and object folder: Done"

    ifeq ($(SHARED),1)
    uninstall: banner uninstall_headers
    @echo "Uninstall shared library"
    -$(removefile) $(inst_path_win)\$(libname)*
    @echo ldconfig
    @echo "Uninstall shared library: Done"
    else
    uninstall: banner uninstall_headers
    @echo "Uninstall static library"
    -$(removefile) $(inst_path_win)\$(lib_target)
    @echo "Uninstall static library: Done"
    endif

    uninstall_headers: banner
    @echo "Uninstall header files"
    $(removedir) $(install_include_lib_dir_win)
    @echo "Uninstall header files: Done"

    test:
    $(CXX) _internal/TestSuite/main.cpp _internal/TestSuite/TestAssign.cpp _internal/TestSuite/TestChildren.cpp \
    _internal/TestSuite/TestComments.cpp _internal/TestSuite/TestConverters.cpp _internal/TestSuite/TestCtors.cpp \
    _internal/TestSuite/TestEquality.cpp _internal/TestSuite/TestFunctions.cpp _internal/TestSuite/TestInequality.cpp \
    _internal/TestSuite/TestInspectors.cpp _internal/TestSuite/TestIterators.cpp _internal/TestSuite/TestMutex.cpp \
    _internal/TestSuite/TestNamespace.cpp _internal/TestSuite/TestRefCounting.cpp _internal/TestSuite/TestSuite.cpp \
    _internal/TestSuite/TestWriter.cpp _internal/TestSuite/TestString.cpp _internal/TestSuite/UnitTest.cpp \
    _internal/TestSuite/TestValidator.cpp _internal/TestSuite/TestStreams.cpp _internal/TestSuite/TestBinary.cpp \
    _internal/TestSuite/RunTestSuite2.cpp _internal/TestSuite/TestSharedString.cpp \
    _internal/Source/internalJSONNode.cpp _internal/Source/JSONPreparse.cpp _internal/Source/JSONChildren.cpp \
    _internal/Source/JSONDebug.cpp _internal/Source/JSONIterators.cpp _internal/Source/JSONMemory.cpp \
    _internal/Source/JSONNode_Mutex.cpp _internal/Source/JSONNode.cpp _internal/Source/JSONWorker.cpp \
    _internal/Source/JSONWriter.cpp _internal/Source/libjson.cpp _internal/Source/JSONValidator.cpp \
    _internal/Source/JSONStream.cpp _internal/Source/JSONAllocator.cpp \
    _internal/TestSuite2/JSON_Base64/json_decode64.cpp \
    _internal/TestSuite2/JSON_Base64/json_encode64.cpp \
    _internal/TestSuite2/JSONDebug/JSON_ASSERT_SAFE.cpp \
    _internal/TestSuite2/JSONDebug/JSON_ASSERT.cpp \
    _internal/TestSuite2/JSONDebug/JSON_FAIL_SAFE.cpp \
    _internal/TestSuite2/JSONDebug/JSON_FAIL.cpp \
    _internal/TestSuite2/JSONGlobals/jsonSingleton.cpp \
    _internal/TestSuite2/JSONValidator/isValidArray.cpp \
    _internal/TestSuite2/JSONValidator/isValidMember.cpp \
    _internal/TestSuite2/JSONValidator/isValidNamedObject.cpp \
    _internal/TestSuite2/JSONValidator/isValidNumber.cpp \
    _internal/TestSuite2/JSONValidator/isValidObject.cpp \
    _internal/TestSuite2/JSONValidator/isValidPartialRoot.cpp \
    _internal/TestSuite2/JSONValidator/isValidRoot.cpp \
    _internal/TestSuite2/JSONValidator/isValidString.cpp \
    _internal/TestSuite2/JSONValidator/securityTest.cpp \
    _internal/TestSuite2/NumberToString/_areFloatsEqual.cpp \
    _internal/TestSuite2/NumberToString/_atof.cpp \
    _internal/TestSuite2/NumberToString/_ftoa.cpp \
    _internal/TestSuite2/NumberToString/_itoa.cpp \
    _internal/TestSuite2/NumberToString/_uitoa.cpp \
    _internal/TestSuite2/NumberToString/getLenSize.cpp \
    _internal/TestSuite2/NumberToString/isNumeric.cpp \
    $(CXXFLAGS) -o ./testapp
    ./testapp

    脚步:
  • 解压源存档(我将它们放在名为libjson的目录中)
  • 复制该目录中的Makefile.mak
  • 从目录内部,针对此文件(mingw32-make -f Makefile.mak)调用(在 cmd 窗口中)mingw32-make
  • 为了使一切正常运行,mingw32-make的目录必须位于%PATH%(您已经知道)中
  • 如果要使用动态版本(.so-实际上是.dll),则在调用mingw32-make
  • 之前必须先使用 set SHARED=1
  • 由于使用了mklink,安装目标无法在较早的Win版本(例如XP)上运行

  • 构建lib时,我遇到了一个奇怪的事情,您应该意识到。以下是我工作过的工具版本/环境:

    Win上的
  • g++ 5.3.0-MinGW的一部分(由Qt安装)
  • Lnx(Ubtu)上的
  • g++ 5.4.0
  • Win上的
  • g++ 7.2.0-MinGW的一部分(由我构建)
  • Cygwin上的
  • g++ 7.3.0

  • 其中3个工作正常,但适用于 #3。 ,我得到了:

    _internal/Source/JSONWorker.cpp:297:26: error: cast from 'const char*' to 'long int' loses precision [-fpermissive]
    JSON_ASSERT_SAFE(((long)end - (long)pos) > 4, JSON_TEXT("UTF will go out of bounds"), return JSON_TEXT('\0'););
    ^


    我不知道为什么会发生这种情况(可能是g++配置问题?),但是为了解决这个问题,您应该在 行中将 -fpermissive 编译标志(按照错误消息的指示)添加到cxxflags_default变量中。 146 :
    cxxflags_default = -O3 -ffast-math -fexpensive-optimizations -fpermissive -DNDEBUG

    这是默认版本,如果您选择其他变体(调试,较小),则必须修改适当的变量。

    尽管这不是必需的,但我还发布了Nix部分的修复程序(它们以某种方式相关,因为我在研究此答案时已发现它们)。

    libjson-7.6.1-nix_makefile.patch:

    --- libjson/makefile.orig   2012-05-30 05:15:42.000000000 +0300
    +++ libjson/makefile 2018-08-31 01:09:57.484855300 +0300
    @@ -131,7 +131,7 @@
    OS=$(shell uname)

    # Defaults
    -ifeq ($(OS), Darwin)
    +ifeq ($(OS),Darwin)
    cxxflags_default = -fast -ffast-math -fexpensive-optimizations -DNDEBUG
    else
    cxxflags_default = -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
    @@ -154,7 +154,8 @@
    exec_prefix ?= $(prefix)
    libdir ?= lib
    includedir ?= include
    -srcdir ?= _internal/Source
    +intdir ?= _internal
    +srcdir ?= $(intdir)/Source
    CXX ?= c++
    AR ?= ar
    PIC ?= PIC
    @@ -175,9 +176,9 @@
    endif

    # BUILD_TYPE specific settings
    -ifeq ($(BUILD_TYPE), small)
    +ifeq ($(BUILD_TYPE),small)
    CXXFLAGS = $(cxxflags_small)
    -else ifeq ($(BUILD_TYPE), debug)
    +else ifeq ($(BUILD_TYPE),debug)
    CXXFLAGS = $(cxxflags_debug)
    libname := $(libname_debug)
    else
    @@ -185,7 +186,7 @@
    endif

    # SHARED specific settings
    -ifeq ($(SHARED), 1)
    +ifeq ($(SHARED),1)
    libname_shared = $(libname).$(suffix_shared)
    libname_shared_major_version = $(libname_shared).$(major_version)
    lib_target = $(libname_shared_major_version).$(minor_version)
    @@ -242,6 +243,7 @@
    ifeq ($(SHARED),1)
    install: banner install_headers $(lib_target)
    @echo "Install shared library"
    + mkdir -p $(inst_path)
    cp -f ./$(lib_target) $(inst_path)
    cd $(inst_path) ; \
    ln -sf $(lib_target) $(libname_shared_major_version) ; \
    @@ -253,6 +255,7 @@
    else
    install: banner install_headers $(lib_target)
    @echo "Install static library"
    + mkdir -p $(inst_path)
    cp -f ./$(lib_target) $(inst_path)
    @echo "Install static library: Done."
    endif
    @@ -265,8 +268,8 @@
    cp -f ./$(srcdir)/*.h $(include_path)/$(libname_hdr)/$(srcdir)
    cp -r ./$(srcdir)/JSONDefs $(include_path)/$(libname_hdr)/$(srcdir)
    chmod -R a+r $(include_path)/$(libname_hdr)
    - find $(include_path)/$(libname_hdr) -type d -exec chmod a+x {} \;
    - cp -rv $(srcdir)/Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)
    + find $(include_path)/$(libname_hdr) -type d -exec chmod a+x {} \;
    + cp -rv $(intdir)/Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)
    @echo "Install header files: Done."

    clean: banner
    @@ -311,28 +314,28 @@
    _internal/Source/JSONNode_Mutex.cpp _internal/Source/JSONNode.cpp _internal/Source/JSONWorker.cpp \
    _internal/Source/JSONWriter.cpp _internal/Source/libjson.cpp _internal/Source/JSONValidator.cpp \
    _internal/Source/JSONStream.cpp _internal/Source/JSONAllocator.cpp \
    - _internal/TestSuite/TestSuite2/JSON_Base64/json_decode64.cpp \
    - _internal/TestSuite/TestSuite2/JSON_Base64/json_encode64.cpp \
    - _internal/TestSuite/TestSuite2/JSONDebug/JSON_ASSERT_SAFE.cpp \
    - _internal/TestSuite/TestSuite2/JSONDebug/JSON_ASSERT.cpp \
    - _internal/TestSuite/TestSuite2/JSONDebug/JSON_FAIL_SAFE.cpp \
    - _internal/TestSuite/TestSuite2/JSONDebug/JSON_FAIL.cpp \
    - _internal/TestSuite/TestSuite2/JSONGlobals/jsonSingleton.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidArray.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidMember.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidNamedObject.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidNumber.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidObject.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidPartialRoot.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidRoot.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/isValidString.cpp \
    - _internal/TestSuite/TestSuite2/JSONValidator/securityTest.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/_areFloatsEqual.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/_atof.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/_ftoa.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/_itoa.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/_uitoa.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/getLenSize.cpp \
    - _internal/TestSuite/TestSuite2/NumberToString/isNumeric.cpp \
    + _internal/TestSuite2/JSON_Base64/json_decode64.cpp \
    + _internal/TestSuite2/JSON_Base64/json_encode64.cpp \
    + _internal/TestSuite2/JSONDebug/JSON_ASSERT_SAFE.cpp \
    + _internal/TestSuite2/JSONDebug/JSON_ASSERT.cpp \
    + _internal/TestSuite2/JSONDebug/JSON_FAIL_SAFE.cpp \
    + _internal/TestSuite2/JSONDebug/JSON_FAIL.cpp \
    + _internal/TestSuite2/JSONGlobals/jsonSingleton.cpp \
    + _internal/TestSuite2/JSONValidator/isValidArray.cpp \
    + _internal/TestSuite2/JSONValidator/isValidMember.cpp \
    + _internal/TestSuite2/JSONValidator/isValidNamedObject.cpp \
    + _internal/TestSuite2/JSONValidator/isValidNumber.cpp \
    + _internal/TestSuite2/JSONValidator/isValidObject.cpp \
    + _internal/TestSuite2/JSONValidator/isValidPartialRoot.cpp \
    + _internal/TestSuite2/JSONValidator/isValidRoot.cpp \
    + _internal/TestSuite2/JSONValidator/isValidString.cpp \
    + _internal/TestSuite2/JSONValidator/securityTest.cpp \
    + _internal/TestSuite2/NumberToString/_areFloatsEqual.cpp \
    + _internal/TestSuite2/NumberToString/_atof.cpp \
    + _internal/TestSuite2/NumberToString/_ftoa.cpp \
    + _internal/TestSuite2/NumberToString/_itoa.cpp \
    + _internal/TestSuite2/NumberToString/_uitoa.cpp \
    + _internal/TestSuite2/NumberToString/getLenSize.cpp \
    + _internal/TestSuite2/NumberToString/isNumeric.cpp \
    $(CXXFLAGS) -o ./testapp
    ./testapp

    以上是差异。有关如何在Win上应用修补程序的信息,请参见 [SO]: Run/Debug a Django application's UnitTests from the mouse right click context menu in PyCharm Community Edition? (@CristiFati's answer)( 修补utrunner 部分)(基本上,每行以 开头的一个“+” 符号进入,而每行以 开头的一个行以“-” 符号退出) 。我正在使用Cygwin,顺便说一句。

    关于windows - 如何在Windows上使用makefile创建libjson.lib?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52090348/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com