共用方式為


component

控制瀏覽資訊或從原始程式檔中的相依性資訊的收集。

#pragma component( browser, { on | off }[, references [, name ]] )
#pragma component( minrebuild, on | off )
#pragma component( mintypeinfo, on | off )

備註

瀏覽器

您可以開啟收集,開啟或關閉,您可以指定特定的名稱,在收集資訊時被忽略。

使用開啟或關閉控制項從 pragma 向前瀏覽資訊的集合。 例如:

#pragma component(browser, off)

停止編譯器收集瀏覽資訊。

注意事項注意事項

若要開啟此 pragma,以瀏覽資訊的收集瀏覽資訊必須先啟用

參考 可使用選項,不論是否有 名稱引數。 使用參考 而不 名稱開啟或關閉收集的參考 (才能收集,但是會繼續其他的瀏覽資訊)。 例如:

#pragma component(browser, off, references)

停止編譯器收集參考資訊。

使用參考名稱防止參考 名稱出現在 [瀏覽資訊] 視窗。 略過名稱和您不感興趣的型別,並減少瀏覽資訊檔的大小,請使用此語法。 例如:

#pragma component(browser, off, references, DWORD)

會忽略參考 DWORD 從該點往前。 您可以將收集的參考DWORD上一步] 使用

#pragma component(browser, on, references, DWORD)

這是唯一能繼續收集參考名稱。 您必須明確地將任何名稱 ,您已經關閉。

為避免前置處理器擴充名稱 (例如展開 NULL0),加上其周圍的引號:

#pragma component(browser, off, references, "NULL")

最少重建

Visual C++ 最少重建功能需要編譯器建立並儲存 C++ 類別相依性資訊,該磁碟空間。 若要節省磁碟空間,您可以使用 #pragma component( minrebuild, off ) 時,您不必收集相依性資訊,舉個例說,不會變更標頭檔中。 插入 #pragma component(minrebuild, on) 上一步] 以開啟 [相依性集合不會變更類別之後。

減少型別資訊

Mintypeinfo 選項能夠減少指定的地區的偵錯資訊。 這項資訊的磁碟區是相當大,影響.pdb 和.obj 檔。 類別和結構 [mintypeinfo] 區域中的,您無法偵錯。 使用 mintypeinfo 選項可能很有幫助避免下列警告:

LINK : warning LNK4018: too many type indexes in PDB "filename", discarding subsequent type information

如需詳細資訊,請參閱啟用最少重建 (/ Gm) 編譯器選項。

請參閱

參考

Pragma 指示詞 」 和 「 __Pragma 關鍵字