---
title: "undefined reference to `std::ios_base::Init::Init()的解决"
author: "james23dier"
date: "2010-12-24T10:25:05Z"
tags: ["C", "C++", "GCC", "Linux", "iOS"]
categories: ["操作系统"]
slug: "undefined-reference-to-std-ios-base-init-init"
draft: false
lastmod: "2010-12-24T10:25:05Z"
id: 850885
url: "https://james23dier.iteye.com/blog/850885"
---

在linux下编译c程序使用gcc，然而编译c++程序却需要使用g++，使用gcc编译c++程序会产生错误：undefined reference to \`std::ios\_base::Init::Init()。使用gcc -lstdc++编译选项就好。或者改用g++。