← スキル一覧に戻る

autofix-multiple-def
by hyz0906
⭐ 0🍴 0📅 2026年1月19日
SKILL.md
name: autofix-multiple-def description: Fixes 'multiple definition' linker errors by removing duplicate symbols.
Multiple Definition Skill
Fixes linker errors where the same symbol is defined in multiple translation units.
Detection Patterns
multiple definition of 'X'already defined induplicate symbol
Strategy
- Identify Symbol: Extract the duplicated symbol.
- Find Definitions: Locate all places where it's defined.
- Remove Duplicates: Keep one, remove or fix others.
Instructions
Step 1: Parse Error
From: multiple definition of 'globalVar'; first defined in a.o
Step 2: Common Causes & Fixes
Global variable in header:
// Wrong: header.h
int globalVar = 0; // Defined in every .cpp that includes
// Fix Option 1: extern declaration
// header.h
extern int globalVar;
// source.cpp
int globalVar = 0;
// Fix Option 2: inline (C++17)
inline int globalVar = 0;
Function defined in header:
// Wrong
void foo() { ... } // in header
// Fix: make inline
inline void foo() { ... }
Same source compiled twice: Check build file for duplicate source file entries.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です