RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-253134

keddad's questions

Martin Hope
keddad
Asked: 2022-03-14 17:31:53 +0000 UTC

将项目与 GStreamer 链接时未定义的参考 [重复]

  • 0
这个问题已经在这里得到了回答:
引用未解决的外部符号(可能的原因) 5 个答案
1 年前关闭。

我有一个非常简单的 GStreamer 项目:

#include <gst/gst.h>

using namespace std;

int main(){
    GstElement *pipeline = nullptr;
    GstBus *bus = nullptr;
    GstMessage *msg = nullptr;

    // gstreamer initialization
    gst_init(nullptr, nullptr);
    
}

我想用这个 CMakeLists.txt 构建它:

cmake_minimum_required(VERSION 3.10)

project(Mgm)
find_package(PkgConfig)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)

#including GStreamer header files directory
include_directories(
        ${GLIB_INCLUDE_DIRS}
        ${GSTREAMER_INCLUDE_DIRS}
)

#linking GStreamer library directory
link_directories(
        ${GLIB_LIBRARY_DIRS}
        ${GSTREAMER_LIBRARY_DIRS}
)

add_executable(mgm src/main.cpp)

问题是在构建时,我得到一个链接器错误:

[keddad@priest mgm]$ cmake .
-- Configuring done
-- Generating done
-- Build files have been written to: /home/keddad/Documents/mgm
[keddad@priest mgm]$ make
[ 50%] Linking CXX executable mgm
/usr/bin/ld: CMakeFiles/mgm.dir/src/main.cpp.o: in function `main':
main.cpp:(.text+0x2b): undefined reference to `gst_init'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/mgm.dir/build.make:103: mgm] Error 1
make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/mgm.dir/all] Error 2
make: *** [Makefile:103: all] Error 2

gstreamer软件包已安装在系统上,因此链接库似乎存在。同时,在IDE(VS Code)中,我可以看到函数的签名,例如,从gst转到结构的定义——因此,它肯定是系统正常安装和定位的。我究竟做错了什么?

c++
  • 1 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-04-18 02:08:16 +0000 UTC

如何使用 Git 对包含多个模块的软件进行版本控制?

  • 3

我有一个抽象应用程序,它由不同语言的几个独立模块组成。我想使用 Git 子模块进行版本控制:然后我将拥有一个存储 docker-compose 文档和配置的主存储库,以及 Git 从所有存储库中提取我的应用程序的文件夹。

问题:在开发过程中,为了测试一个新特性,我将不得不通过以下路径:提交到应用程序存储库,推送,然后更新主存储库中的子模块,然后再提升。如果出现问题,我将不得不回滚提交(这在开发刚刚开始时尤其重要,并且有数百个这样的编辑)。

第二个选项是在存储库中创建子文件夹,但这会导致提交混淆。此外,它可能会破坏 IDE 和依赖管理系统(例如,Golang 模块会感觉不好,集成到 IDE 中的版本控制系统会感觉不好)。

是否有任何替代或混合方法来管理多模块应用程序依赖项?

контроль-версий
  • 1 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-03-26 18:31:36 +0000 UTC

使用来自另一个 DataFrame 的数据填充 DataFrame

  • 1

我有一个 DataFrame df_heroes和df_train,每个都有一个hero_id参数。我想遍历df_heroes,将df_heroes 框架中具有相同hero_id的角色添加到尚不存在的hero_roles列中。我正在尝试这样做:

for row in df_train.itertuples(index = False):
    row['hero_roles'] = df_heroes.loc[df_heroes["hero_id"]==row["hero_id"]].values["roles"]

但是这样做时我得到一个错误:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
   3077             try:
-> 3078                 return self._engine.get_loc(key)
   3079             except KeyError:

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'hero_id'

During handling of the above exception, another exception occurred:

KeyError                                  Traceback (most recent call last)
<ipython-input-10-2c33f244f191> in <module>
      1 for row in df_train.itertuples(index = False):
----> 2     row['hero_roles'] = df_heroes.loc[df_heroes["hero_id"]==row["hero_id"]].values["roles"]

~\Anaconda3\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
   2686             return self._getitem_multilevel(key)
   2687         else:
-> 2688             return self._getitem_column(key)
   2689 
   2690     def _getitem_column(self, key):

~\Anaconda3\lib\site-packages\pandas\core\frame.py in _getitem_column(self, key)
   2693         # get column
   2694         if self.columns.is_unique:
-> 2695             return self._get_item_cache(key)
   2696 
   2697         # duplicate columns & possible reduce dimensionality

~\Anaconda3\lib\site-packages\pandas\core\generic.py in _get_item_cache(self, item)
   2487         res = cache.get(item)
   2488         if res is None:
-> 2489             values = self._data.get(item)
   2490             res = self._box_item_values(item, values)
   2491             cache[item] = res

~\Anaconda3\lib\site-packages\pandas\core\internals.py in get(self, item, fastpath)
   4113 
   4114             if not isna(item):
-> 4115                 loc = self.items.get_loc(item)
   4116             else:
   4117                 indexer = np.arange(len(self.items))[isna(self.items)]

~\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
   3078                 return self._engine.get_loc(key)
   3079             except KeyError:
-> 3080                 return self._engine.get_loc(self._maybe_cast_indexer(key))
   3081 
   3082         indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'hero_id'

我怎样才能使我的代码工作?

样本数据链接:https ://yadi.sk/d/ZAzQifMGwZphHg

python
  • 1 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-11-25 03:39:30 +0000 UTC

熊猫中的read_csv错误

  • 1

当我打开数据集时,它会引发错误,尽管我没有看到任何问题。我怎样才能解决这个问题?

ParserError                               Traceback (most recent call last)
<ipython-input-5-76a26ffa0a27> in <module>()
----> 1 df = pd.read_csv("data.csv")## подключим файл

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, doublequote, delim_whitespace, low_memory, memory_map, float_precision)
    676                     skip_blank_lines=skip_blank_lines)
    677 
--> 678         return _read(filepath_or_buffer, kwds)
    679 
    680     parser_f.__name__ = name

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
    444 
    445     try:
--> 446         data = parser.read(nrows)
    447     finally:
    448         parser.close()

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in read(self, nrows)
   1034                 raise ValueError('skipfooter not supported for iteration')
   1035 
-> 1036         ret = self._engine.read(nrows)
   1037 
   1038         # May alter columns / col_dict

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in read(self, nrows)
   1846     def read(self, nrows=None):
   1847         try:
-> 1848             data = self._reader.read(nrows)
   1849         except StopIteration:
   1850             if self._first_chunk:

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.read()

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._read_low_memory()

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._read_rows()

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows()

pandas\_libs\parsers.pyx in pandas._libs.parsers.raise_parser_error()

ParserError: Error tokenizing data. C error: Expected 6 fields in line 396, saw 7

数据集似乎完好无损,并且取自可信来源。链接到 .csv

python
  • 1 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-11-11 19:37:42 +0000 UTC

如何从peewee中同一行的另一列获取数据

  • 0

我有一个模型:

class token(Model):
token = CharField() 
is_teacher = BooleanField() 
class Meta:
    database = db 

我需要通过 token 的值找到is_teacher的值。我正在尝试这样做:

def CheckTokenTeacher(token_name):
tokens = token.select().where(token.token==token_name)
if len(tokens) is 1:
    return tokens[0].is_teacher
else:
    return 0

但是 VS Code 这么说

分配给不返回的函数调用

如何解决此错误并获取is_teacher for token的值?

python
  • 1 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-06-06 01:03:50 +0000 UTC

计算点后的数字

  • 0

计算数字后的数字的实现选项是什么.?

例如,输入1.89结果8。

python
  • 3 个回答
  • 10 Views
Martin Hope
keddad
Asked: 2020-06-05 00:44:45 +0000 UTC

Phyton 中打印功能的问题

  • 0
a = input()
print("The next number for the number " a "is" a+1)

执行时出错

回溯(最近调用最后):文件“python”,第 3 行打印(“数字的下一个数字”a“是”a+1)SyntaxError:语法无效

但我没有看到任何语法问题。门框在哪里,是否可以提供有关此问题的详细文献?

python
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5