原文:error: variable 'std::ifstream ifs' has initializer but incomplete type

main.cpp: In function bool ReadTimeInterval std::string amp :main.cpp: : error: variable std::ifstream ifs has initializer but incomplete typemain.cpp: : warning: deprecated conversion from string con ...

2014-02-19 11:07 0 3536 推薦指數:

查看詳情

variable `xxx' has initializer but incomplete type

錯誤:variable `xxx' has initializer but incomplete type 原因:xxx對應的類型沒有找到,只把xxx聲明了但是沒給出定義。編譯器無從確認你調用的構造函數是什么,在哪兒一般是沒有包含定義xxx的頭文件。 比如: 不包含頭文件的話會報 ...

Tue Aug 02 22:15:00 CST 2016 0 3233
error: invalid use of incomplete type

一. 首先,要確定自己定義的類是完整的,構造函數,析構函數都有,函數的聲明及定義分開在.h和.cpp中實現。 如果確定類是完整的,仍然出現error: invalid use of incomplete type的報錯,那么問題出現在該類的使用上,而不是類的實現上. 二. 在使用某個已經 ...

Sat Sep 02 18:19:00 CST 2017 0 4124
error: invalid use of incomplete type

一般出現這種情況都是沒有將用到的頭文件包含進來 我的情況是在頭文件中定義了一個QMenu的指針,在源文件中使用menuBar()函數來返回一個menu指針。我在源文件中包含了文件<QtGui& ...

Fri Aug 01 23:15:00 CST 2014 0 4329
error: incomplete type ‘’ used in nested name specifier

出現這個錯誤表示 在A.h中定義了一個類模版,並且在A.h中需要#include "B.h"(即,需要知道B的定義)而在B.h中又使用了A.h中定義的模版,因此也需要#include "A.h"(即 ...

Wed Feb 20 04:15:00 CST 2013 0 12852
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM