Incidencia #16444

once.h でmultiple definition (フォーラムメッセージ #43446 からの引用)

Abrir Fecha: 2009-04-29 11:52 Última actualización: 2009-05-27 14:36

Informador:
Propietario:
Tipo:
Estado:
Cerrado
Componente:
(Ninguno)
Hito:
(Ninguno)
Prioridad:
6
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
Ninguno

Details

以下の修正完了. 次リリースで対応予定.

[forum: 43446]

複数の.cppファイルでthread.hをincludeしているとmultiple definition の リンクエラーになります。 /tmp/ccIiR5ho.o:(.data+0x0): multiple definition of clx::detail::once_global_epoch' /tmp/ccHB39Ej.o:(.data+0x0): first defined here : : スマートな解決方法は無いでしょうか? とりあえず#ifdefで初期化は特定のファイルだけにして他はexternにしましたが まちがっているような気もするので正しいのかもお教えください。 #ifdef MAINFILE   once_flag once_global_epoch = ULONG_MAX; :        #else extern once_flag once_global_epoch; : #endif

Ticket History (2/2 Histories)

2009-04-29 11:52 Updated by: cielquis
  • New Ticket "once.h でmultiple definition (フォーラムメッセージ #43446 からの引用)" created
2009-05-27 14:36 Updated by: cielquis
  • Details Updated
  • Resolución Update from Ninguno to Fixed
  • Estado Update from Open to Cerrado
  • Ticket Close date is changed to 2009-05-27 14:36
Comentario

cielquis への返信

フォーラム 公開討議 [#43446] からの引用 [forum: 43446]

複数の.cppファイルでthread.hをincludeしているとmultiple definition の リンクエラーになります。 /tmp/ccIiR5ho.o:(.data+0x0): multiple definition of clx::detail::once_global_epoch' /tmp/ccHB39Ej.o:(.data+0x0): first defined here : : スマートな解決方法は無いでしょうか? とりあえず#ifdefで初期化は特定のファイルだけにして他はexternにしましたが まちがっているような気もするので正しいのかもお教えください。 #ifdef MAINFILE   once_flag once_global_epoch = ULONG_MAX; :        #else extern once_flag once_global_epoch; : #endif

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Entrar