c++ - vscode如何正确地link programs with library?
怪我咯
怪我咯 2017-04-17 15:39:04
0
1
514

刚刚开始用vscode,在build的过程中出现了

Undefined symbols for architecture x86_64:
  "_gsl_rng_types_setup", referenced from:
      _main in Playground-7475b2.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这样的错误,
我的代码是

#include <gsl/gsl_rng.h>
#include <iostream>
#include <stddef.h>


int main(){
    const gsl_rng_type **t, **t0;
    t0 = gsl_rng_types_setup (); 
    for (t = t0; *t != 0; t++) {
        std::cout<<(*t)->name; 
    }
}

按理我的library就在默认的位置(/usr/local/lib)不会出现这个问题吧。。
所以想求个解决方案,不胜感激!

怪我咯
怪我咯

走同样的路,发现不同的人生

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!