久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

        <bdo id='Sf6vv'></bdo><ul id='Sf6vv'></ul>
        <tfoot id='Sf6vv'></tfoot>
        <i id='Sf6vv'><tr id='Sf6vv'><dt id='Sf6vv'><q id='Sf6vv'><span id='Sf6vv'><b id='Sf6vv'><form id='Sf6vv'><ins id='Sf6vv'></ins><ul id='Sf6vv'></ul><sub id='Sf6vv'></sub></form><legend id='Sf6vv'></legend><bdo id='Sf6vv'><pre id='Sf6vv'><center id='Sf6vv'></center></pre></bdo></b><th id='Sf6vv'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Sf6vv'><tfoot id='Sf6vv'></tfoot><dl id='Sf6vv'><fieldset id='Sf6vv'></fieldset></dl></div>

      1. <legend id='Sf6vv'><style id='Sf6vv'><dir id='Sf6vv'><q id='Sf6vv'></q></dir></style></legend>

      2. <small id='Sf6vv'></small><noframes id='Sf6vv'>

        如何在 Visual Studio Code 中包含編譯器標志?

        How to include compiler flags in Visual Studio Code?(如何在 Visual Studio Code 中包含編譯器標志?)

        <small id='xdehd'></small><noframes id='xdehd'>

        <legend id='xdehd'><style id='xdehd'><dir id='xdehd'><q id='xdehd'></q></dir></style></legend>

            <tbody id='xdehd'></tbody>
          <i id='xdehd'><tr id='xdehd'><dt id='xdehd'><q id='xdehd'><span id='xdehd'><b id='xdehd'><form id='xdehd'><ins id='xdehd'></ins><ul id='xdehd'></ul><sub id='xdehd'></sub></form><legend id='xdehd'></legend><bdo id='xdehd'><pre id='xdehd'><center id='xdehd'></center></pre></bdo></b><th id='xdehd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xdehd'><tfoot id='xdehd'></tfoot><dl id='xdehd'><fieldset id='xdehd'></fieldset></dl></div>
        • <tfoot id='xdehd'></tfoot>
                • <bdo id='xdehd'></bdo><ul id='xdehd'></ul>

                • 本文介紹了如何在 Visual Studio Code 中包含編譯器標志?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個程序,我試圖在使用 fftw 函數(shù)的 Visual Studio Code 調(diào)試器中運行該程序.它用命令編譯

                  I have a program that I am trying to run in the Visual Studio Code debugger that uses fftw functions. It compiles with the command

                  g++ dimer.cpp -std=c++11 -lfftw3 
                  

                  在我電腦上的終端上,沒有抱怨未定義的引用.但是,在生成 launch.json 文件后,我的程序會抱怨 fftw 庫函數(shù)和 -std=c++14 編譯器標志.

                  on the terminal on my computer without complaining about undefined references. However, after generating a launch.json file, my program complains about fftw library functions and about the -std=c++14 compiler flag.

                  我相信它只需要 -std=c++11-lfftw3 的額外標志使 Visual Studio Code 中的調(diào)試器正常工作.我正在使用 Microsoft 的 C/C++ 擴展和 Code Runner 擴展.

                  I believe that it needs just the extra flags of -std=c++11 and -lfftw3 for the debugger in Visual Studio Code to work. I am using Microsoft's C/C++ extension and the Code Runner extension.

                  我正在嘗試將 Mathematica 代碼文檔轉(zhuǎn)換為 C++.

                  I am trying to transform a Mathematica document of code into c++.

                  以下是我從輸出中得到的錯誤.

                  Below are the errors I get from the output.

                  Executing task: /usr/bin/g++ -g /home/msammartino/Documents/twochain/dimer.cpp -o /home/msammartino/Documents/twochain/dimer <
                  
                  In file included from /usr/include/armadillo:54:0,
                               from /home/msammartino/Documents/twochain/dimer.cpp:6:
                  /usr/include/armadillo_bits/compiler_setup.hpp:530:108: note: #pragma message: NOTE: suggest to enable C++14 mode for faster code; add -std=c++14 to compiler flags
                   #pragma message ("NOTE: suggest to enable C++14 mode for faster code; add -std=c++14 to compiler flags")
                                                                                                                          ^
                  /tmp/ccgb7Xsv.o: In function `r2r_dsine_fftw_forward_dimer(int, double*, double*, Eigen::Matrix<double, 2, 2, 0, 2, 2> (&) [2048], Eigen::Matrix<double, 2, 2, 0, 2, 2> (&) [2048])':
                  /home/msammartino/Documents/twochain/dimer.cpp:99: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:100: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:101: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:102: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:103: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:104: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:105: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:106: undefined reference to `fftw_execute'
                  /tmp/ccgb7Xsv.o: In function `r2r_dsine_fftw_backward_dimer(int, double*, double*, Eigen::Matrix<double, 2, 2, 0, 2, 2> (&) [2048], Eigen::Matrix<double, 2, 2, 0, 2, 2> (&) [2048])':
                  /home/msammartino/Documents/twochain/dimer.cpp:166: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:167: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:168: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:169: undefined reference to `fftw_plan_r2r_1d'
                  /home/msammartino/Documents/twochain/dimer.cpp:170: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:171: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:172: undefined reference to `fftw_execute'
                  /home/msammartino/Documents/twochain/dimer.cpp:173: undefined reference to `fftw_execute'
                  collect2: error: ld returned 1 exit status
                  The terminal process terminated with exit code: 1
                  
                  Terminal will be reused by tasks, press any key to close it.
                  

                  如果我提出這個問題的方式有任何問題,請告訴我.

                  Please let me know about any problems with the way I have asked this question.

                  推薦答案

                  簡單的選擇是 在 tasks.json 配置中將它們作為 args 傳遞:

                  The easy option is to pass them as args in your tasks.json configuration:

                  {
                    "version": "2.0.0",
                    "tasks": [
                      {
                        "label": "build-all",
                        "type": "shell",
                        "args": [
                            "-std=c++11",
                            "-lfftw3",
                            "-L",
                            "/path/to/libs",
                            "/path/to/file.cpp"
                        ],
                        "command": "g++",
                      }
                    ]
                  }
                  

                  更易于維護和共享的選項是創(chuàng)建一個 Makefile 并將它們?nèi)吭O(shè)置在那里:

                  The more maintainable, shareable option is to create a Makefile and set them all there:

                  # Specify compiler to be used
                  CXX = g++
                  CXXFLAGS += -g -std=c++11 -fPIC -march=x86-64
                  
                  # Specify paths to headers
                  INCLUDES += -I include
                  
                  # Specify paths to the libraries
                  LDFLAGS  += -L /path/to/libs
                  
                  # Specify the link libraries
                  LLIBS    += -lfftw3
                  
                  # ... add other configs ...
                  
                  $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)
                      $(CXX) -c $(CXXFLAGS) $(INCLUDES) $< -o $@
                  
                  $(OBJ_DIR)/$(PROGRAM): $(OBJS)
                      $(CXX) $(LDFLAGS) $^ $(LLIBS) -o $@
                  

                  然后在您的任務(wù)配置中,只需調(diào)用make:

                  Then in your task configuration, just call make:

                  {
                    "version": "2.0.0",
                    "tasks": [
                      {
                        "label": "build-all",
                        "type": "shell",
                        "options": {
                            "cwd": "${workspaceFolder}",
                            "env": {
                              ...
                            }
                        },
                        "command": "make -f Makefile.x86_64",
                      }
                    ]
                  }
                  

                  如果你有依賴于 env 的路徑,你可以在你的 Makefile 中指定一個變量(例如 MY_LIBS),然后在任務(wù)配置的 env 塊中設(shè)置它們(例如,MY_LIBS":/path/to/libs").

                  If you have env-dependent paths, you can specify a variable in your Makefile (ex. MY_LIBS) and then set them in the env block of the task configuration (ex. "MY_LIBS": "/path/to/libs").

                  Makefile 選項的優(yōu)點在于:

                  The advantage of the Makefile option is that:

                  • 不使用 VS Code 的人仍然可以編譯您的代碼(從控制臺或其他 IDE).
                  • 如果您使用的是 CI/CD 管道,則不需要單獨的配置.您可以使用相同的 Makefile 使用 VS Code 在本地進行構(gòu)建,也可以使用 CI/CD 進行構(gòu)建.
                  • 您可以將 Makefile 提交到存儲庫,然后只需在本地 tasks.json 配置中使用環(huán)境變量來指定特定于環(huán)境的設(shè)置.

                  這篇關(guān)于如何在 Visual Studio Code 中包含編譯器標志?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應(yīng)該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)
                • <legend id='EzMed'><style id='EzMed'><dir id='EzMed'><q id='EzMed'></q></dir></style></legend>
                      1. <i id='EzMed'><tr id='EzMed'><dt id='EzMed'><q id='EzMed'><span id='EzMed'><b id='EzMed'><form id='EzMed'><ins id='EzMed'></ins><ul id='EzMed'></ul><sub id='EzMed'></sub></form><legend id='EzMed'></legend><bdo id='EzMed'><pre id='EzMed'><center id='EzMed'></center></pre></bdo></b><th id='EzMed'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EzMed'><tfoot id='EzMed'></tfoot><dl id='EzMed'><fieldset id='EzMed'></fieldset></dl></div>
                          <tbody id='EzMed'></tbody>

                          <small id='EzMed'></small><noframes id='EzMed'>

                          • <bdo id='EzMed'></bdo><ul id='EzMed'></ul>

                            <tfoot id='EzMed'></tfoot>
                            主站蜘蛛池模板: 黄色网址在线免费播放 | 久久久www成人免费精品 | 一区在线播放 | 国产午夜精品久久久久 | 美女拍拍拍网站 | 国产一区二 | 久久精品国产一区二区三区不卡 | 欧美日韩一区二区三区四区 | 久久一| www.国产一区 | 人妖av | 日本三级网站在线 | 久久丁香| 亚洲三区在线播放 | 在线一区二区观看 | 性一交一乱一伦视频免费观看 | 九九亚洲| 欧美国产精品一区二区 | 国产一级在线观看 | 精品不卡 | 天色综合网| 欧美性猛交一区二区三区精品 | 国产激情一区二区三区 | 国产激情片在线观看 | 影视一区| 九九久久精品 | 久久手机在线视频 | 日韩在线综合网 | 欧美日韩成人在线 | 97精品超碰一区二区三区 | 亚洲欧美中文日韩在线v日本 | 久久久久久久久久久久久久国产 | 久久精品天堂 | 中文字幕不卡在线观看 | 国产色播av在线 | 亚洲天堂999 | 老外几下就让我高潮了 | 91综合在线观看 | 国产精品久久久久久久久久尿 | 中文字幕一区二区三区在线观看 | 日韩久久精品 |