I also have problems with code completion on MS Windows Vista 32-bit, using Mingw GCC 4.6.1 (tdm-gcc) with the 7th January 2012 C::B SVN nightly (from this thread), under various circumstances - mostly either with custom GCC features or with complex C++ template classes. Here's one test case (with custom GCC extensions) in which it won't work:
typedef struct __attribute__((packed)) _PSTRUCT
{
char a;
char b;
int c;
char d;
} PSTRUCT;
int main()
{
PSTRUCT p;
p.
After typing the last dot after p, code completion box should open up, but it doesn't.
It looks like this particular case is a problem with parsing the GCC __attribute__ tag. Excluding it from the typedef makes the code completion work.
I also had an issue with code completion not popping up for certain complex (I think template-based) class declarations in C++, but sadly I can't reproduce them at the moment, I'll post a test case if and when I'm able to reproduce it again, it happened only once to me and I didn't bother too much cause I considered it to be minor enough.
- Agetian
Cannot compile the latest svn (7725) under GNU / Linux Debian wheezy.
In file included from parser/cclogger.cpp:10:0:
parser/cclogger.h:68:23: error: 'auto_ptr' is not a template
parser/cclogger.h:68:23: error: 'auto_ptr' in namespace 'std' does not name a type
parser/cclogger.h:68:5: error: friend declaration does not name a class or function
parser/cclogger.h:69:12: error: 'auto_ptr' in namespace 'std' does not name a type
parser/cclogger.h: In static member function 'static CCLogger* CCLogger::Get()':
parser/cclogger.h:29:14: error: 's_Inst' was not declared in this scope
parser/cclogger.h:31:16: error: 's_Inst' was not declared in this scope
parser/cclogger.cpp: At global scope:
parser/cclogger.cpp:12:1: error: 'auto_ptr' in namespace 'std' does not name a type
make[4]: *** [cclogger.lo] Error 1
make[4]: Leaving directory `/home/stefanos/svn_code/CodeBlocks/src/plugins/codecompletion'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/stefanos/svn_code/CodeBlocks/src/plugins/codecompletion'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/stefanos/svn_code/CodeBlocks/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/stefanos/svn_code/CodeBlocks/src'
make: *** [all-recursive] Error 1
Can someone please fix this issue and let me know so I can compile it?
Cheers
Thanks guys, both of you.
svn-7727 has been compiled , cheers.
UPDATE:
To test that everything is OK, I opened codeblocks within terminal to get a debug-like behavior and I got this interesting message upon closing it:
*** glibc detected *** codeblocks: corrupted double-linked list: 0x09be10a8 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6aa81)[0xb5d95a81]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6aeda)[0xb5d95eda]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x6c265)[0xb5d97265]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(cfree+0x6d)[0xb5d9a39d]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x1ff24)[0xb5d4af24]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x18bb7)[0xb5d43bb7]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x18857)[0xb5d43857]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(iconv_close+0x1c)[0xb5d42dbc]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(_ZN14wxMBConv_iconvD1Ev+0x3f)[0xb6abc70f]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(+0x52854)[0xb6a6e854]
/usr/lib/i386-linux-gnu/libwx_baseu-2.8.so.0(+0xf5820)[0xb6b11820]
/lib/ld-linux.so.2(+0xe4e6)[0xb786f4e6]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x2f4bf)[0xb5d5a4bf]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x2f52f)[0xb5d5a52f]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__libc_start_main+0xee)[0xb5d41e4e]
codeblocks[0x807850d]
======= Memory map: ========
08048000-080e6000 r-xp 00000000 fe:00 754079 /usr/local/bin/codeblocks
080e6000-080ee000 rw-p 0009e000 fe:00 754079 /usr/local/bin/codeblocks
080ee000-080f0000 rw-p 00000000 00:00 0
08792000-09cdd000 rw-p 00000000 00:00 0 [heap]
aaf01000-aaf02000 ---p 00000000 00:00 0
aaf02000-ab702000 rw-p 00000000 00:00 0
ab702000-ab74f000 r--p 00000000 fe:00 11493576 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf
ab74f000-ab789000 r-xp 00000000 fe:00 876719 /usr/lib/i386-linux-gnu/libcroco-0.6.so.3.0.1
ab789000-ab78c000 rw-p 00039000 fe:00 876719 /usr/lib/i386-linux-gnu/libcroco-0.6.so.3.0.1
ab78c000-ab7c3000 r-xp 00000000 fe:00 877338 /usr/lib/i386-linux-gnu/librsvg-2.so.2.34.2
ab7c3000-ab7c4000 rw-p 00037000 fe:00 877338 /usr/lib/i386-linux-gnu/librsvg-2.so.2.34.2
ab7e6000-ab7e7000 ---p 00000000 00:00 0
ab7e7000-abfe7000 rw-p 00000000 00:00 0
abfe7000-abfe8000 ---p 00000000 00:00 0
abfe8000-ac7e8000 rw-p 00000000 00:00 0
ac7e8000-ac7fb000 r-xp 00000000 fe:00 1278452 /usr/local/lib/codeblocks/plugins/libIncrementalSearch.so
ac7fb000-ac7fc000 rw-p 00013000 fe:00 1278452 /usr/local/lib/codeblocks/plugins/libIncrementalSearch.so
ac7fc000-ac869000 r-xp 00000000 fe:00 1278447 /usr/local/lib/codeblocks/plugins/libHexEditor.so
ac869000-ac86d000 rw-p 0006c000 fe:00 1278447 /usr/local/lib/codeblocks/plugins/libHexEditor.so
ac86d000-ac8c5000 r-xp 00000000 fe:00 1278424 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
ac8c5000-ac8c7000 rw-p 00058000 fe:00 1278424 /usr/local/lib/codeblocks/plugins/libDoxyBlocks.so
ac8c7000-ac8dc000 r-xp 00000000 fe:00 1278369 /usr/local/lib/codeblocks/plugins/libdefaultmimehandler.so
ac8dc000-ac8de000 rw-p 00014000 fe:00 1278369 /usr/local/lib/codeblocks/plugins/libdefaultmimehandler.so
ac8de000-ac996000 r-xp 00000000 fe:00 1278440 /usr/local/lib/codeblocks/plugins/libheaderfixup.so
ac996000-ac999000 rw-p 000b7000 fe:00 1278440 /usr/local/lib/codeblocks/plugins/libheaderfixup.so
ac999000-ac9a4000 r-xp 00000000 fe:00 1278414 /usr/local/lib/codeblocks/plugins/libCppCheck.so
ac9a4000-ac9a5000 rw-p 0000b000 fe:00 1278414 /usr/local/lib/codeblocks/plugins/libCppCheck.so
ac9a5000-ac9cb000 r-xp 00000000 fe:00 1278382 /usr/local/lib/codeblocks/plugins/libtodo.so
ac9cb000-ac9cd000 rw-p 00026000 fe:00 1278382 /usr/local/lib/codeblocks/plugins/libtodo.so
ac9cd000-aca04000 r-xp 00000000 fe:00 1278455 /usr/local/lib/codeblocks/plugins/libkeybinder.so
aca04000-aca07000 rw-p 00036000 fe:00 1278455 /usr/local/lib/codeblocks/plugins/libkeybinder.so
aca07000-aca78000 r-xp 00000000 fe:00 1278465 /usr/local/lib/codeblocks/plugins/liblib_finder.so
aca78000-aca7c000 rw-p 00070000 fe:00 1278465 /usr/local/lib/codeblocks/plugins/liblib_finder.so
aca7c000-acab7000 r-xp 00000000 fe:00 1278388 /usr/local/lib/codeblocks/plugins/libAutoVersioning.so
acab7000-acab9000 rw-p 0003b000 fe:00 1278388 /usr/local/lib/codeblocks/plugins/libAutoVersioning.so
acab9000-acad3000 r-xp 00000000 fe:00 1278482 /usr/local/lib/codeblocks/plugins/libSymTab.so
acad3000-acad5000 rw-p 00019000 fe:00 1278482 /usr/local/lib/codeblocks/plugins/libSymTab.so
acad5000-acadc000 r-xp 00000000 fe:00 1278400 /usr/local/lib/codeblocks/plugins/libCccc.so
acadc000-acadd000 rw-p 00006000 fe:00 1278400 /usr/local/lib/codeblocks/plugins/libCccc.so
acadd000-acb04000 r-xp 00000000 fe:00 1278394 /usr/local/lib/codeblocks/plugins/libbyogames.so
acb04000-acb07000 rw-p 00027000 fe:00 1278394 /usr/local/lib/codeblocks/plugins/libbyogames.so
acb07000-acb23000 r-xp 00000000 fe:00 1278433 /usr/local/lib/codeblocks/plugins/libenvvars.so
acb23000-acb25000 rw-p 0001b000 fe:00 1278433 /usr/local/lib/codeblocks/plugins/libenvvars.so
acb25000-acbbf000 r-xp 00000000 fe:00 1278366 /usr/local/lib/codeblocks/plugins/libdebugger.so
acbbf000-acbc5000 rw-p 0009a000 fe:00 1278366 /usr/local/lib/codeblocks/plugins/libdebugger.so
acbc5000-acbc6000 rw-p 00000000 00:00 0
acbc6000-acbdb000 r-xp 00000000 fe:00 1278417 /usr/local/lib/codeblocks/plugins/libCscope.so
acbdb000-acbdc000 rw-p 00015000 fe:00 1278417 /usr/local/lib/codeblocks/plugins/libCscope.so
acbdc000-acc05000 r-xp 00000000 fe:00 1278375 /usr/local/lib/codeblocks/plugins/libprojectsimporter.so
acc05000-acc06000 rw-p 00029000 fe:00 1278375 /usr/local/lib/codeblocks/plugins/libprojectsimporter.so
acc06000-acc3d000 r-xp 00000000 fe:00 1278499 /usr/local/lib/codeblocks/plugins/libToolsPlus.so
acc3d000-acc40000 rw-p 00036000 fe:00 1278499 /usr/local/lib/codeblocks/plugins/libToolsPlus.so
acc40000-acc76000 r-xp 00000000 fe:00 1278391 /usr/local/lib/codeblocks/plugins/libBrowseTracker.so
acc76000-acc79000 rw-p 00036000 fe:00 1278391 /usr/local/lib/codeblocks/plugins/libBrowseTracker.so
acc79000-accca000 r-xp 00000000 fe:00 876788 /usr/lib/i386-linux-gnu/libhunspell-1.3.so.0.0.0
accca000-accce000 rw-p 00051000 fe:00 876788 /usr/lib/i386-linux-gnu/libhunspell-1.3.so.0.0.0
accd5000-acce1000 r-xp 00000000 fe:00 1278502 /usr/local/lib/codeblocks/plugins/libValgrind.so
acce1000-acce2000 rw-p 0000c000 fe:00 1278502 /usr/local/lib/codeblocks/plugins/libValgrind.so
acce2000-accef000 r-xp 00000000 fe:00 1278290 /usr/local/lib/codeblocks/plugins/libautosave.so
accef000-accf0000 rw-p 0000c000 fe:00 1278290 /usr/local/lib/codeblocks/plugins/libautosave.so
accf0000-acd4a000 r-xp 00000000 fe:00 1278664 /usr/local/lib/codeblocks/plugins/libSpellChecker.so
acd4a000-acd4f000 rw-p 00059000 fe:00 1278664 /usr/local/lib/codeblocks/plugins/libSpellChecker.so
acd4f000-acd62000 r-xp 00000000 fe:00 1278408 /usr/local/lib/codeblocks/plugins/libcodestat.so
acd62000-acd63000 rw-p 00013000 fe:00 1278408 /usr/local/lib/codeblocks/plugins/libcodestat.so
acd63000-acd75000 r-xp 00000000 fe:00 1278397 /usr/local/lib/codeblocks/plugins/libcb_koders.so
acd75000-acd76000 rw-p 00012000 fe:00 1278397 /usr/local/lib/codeblocks/plugins/libcb_koders.so
acd76000-acdc0000 r-xp 00000000 fe:00 1278505 /usr/local/lib/codeblocks/plugins/libwxSmithAui.so
acdc0000-acdc4000 rw-p 00049000 fe:00 1278505 /usr/local/lib/codeblocks/plugins/libwxSmithAui.so
acdc4000-acdc5000 rw-p 00000000 00:00 0
acdc5000-acdda000 r-xp 00000000 fe:00 1278385 /usr/local/lib/codeblocks/plugins/libabbreviations.so
acdda000-acddb000 rw-p 00014000 fe:00 1278385 /usr/local/lib/codeblocks/plugins/libabbreviations.so
acddb000-acde5000 r-xp 00000000 fe:00 1278468 /usr/local/lib/codeblocks/plugins/libMouseSap.so
acde5000-acde6000 rw-p 00009000 fe:00 1278468 /usr/local/lib/codeblocks/plugins/libMouseSap.so
acde6000-acdf3000 r-xp 00000000 fe:00 1278485 /usr/local/lib/codeblocks/plugins/libRegExTestbed.so
acdf3000-acdf4000 rw-p 0000c000 fe:00 1278485 /usr/local/lib/codeblocks/plugins/libRegExTestbed.so
acdf4000-ace10000 r-xp 00000000 fe:00 1278427 /usr/local/lib/codeblocks/plugins/libdragscroll.so
ace10000-ace12000 rw-p 0001c000 fe:00 1278427 /usr/local/lib/codeblocks/plugins/libdragscroll.so
ace12000-acef9000 r-xp 00000000 fe:00 1278345 /usr/local/lib/codeblocks/plugins/libcodecompletion.so
acef9000-acefe000 rw-p 000e6000 fe:00 1278345 /usr/local/lib/codeblocks/plugins/libcodecompletion.so
acefe000-aceff000 rw-p 00000000 00:00 0
aceff000-acf19000 r-xp 00000000 fe:00 1278475 /usr/local/lib/codeblocks/plugins/libProfiler.so
acf19000-acf1b000 rw-p 00019000 fe:00 1278475 /usr/local/lib/codeblocks/plugins/libProfiler.so
acf1b000-ad108000 r-xp 00000000 fe:00 1278479 /usr/local/lib/codeblocks/plugins/libexporter.so
ad108000-ad123000 rw-p 001ed000 fe:00 1278479 /usr/local/lib/codeblocks/plugins/libexporter.so
ad123000-ad124000 rw-p 00000000 00:00 0
ad124000-ad171000 r-xp 00000000 fe:00 1278372 /usr/local/lib/codeblocks/plugins/libscriptedwizard.so
ad171000-ad176000 rw-p 0004c000 fe:00 1278372 /usr/local/lib/codeblocks/plugins/libscriptedwizard.so
ad176000-ad189000 r-xp 00000000 fe:00 1278430 /usr/local/lib/codeblocks/plugins/libEditorTweaks.so
ad189000-ad18a000 rw-p 00013000 fe:00 1278430 /usr/local/lib/codeblocks/plugins/libEditorTweaks.so
ad18a000-ad1d0000 r-xp 00000000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/libastyle.so
ad1d0000-ad1d2000 rw-p 00045000 fe:00 1278648 /usr/local/lib/codeblocks/plugins/libastyle.so
ad1d2000-ad2db000 r-xp 00000000 fe:00 1278405 /usr/local/lib/codeblocks/plugins/libcodesnippets.so
ad2db000-ad2e4000 rw-p 00109000 fe:00 1278405 /usr/local/lib/codeblocks/plugins/libcodesnippets.so
ad2e4000-ad2e6000 rw-p 00000000 00:00 0
ad2e6000-ad334000 r-xp 00000000 fe:00 1278494 /usr/local/lib/codeblocks/plugins/libThreadSearch.so
ad334000-ad337000 rw-p 0004d000 fe:00 1278494 /usr/local/lib/codeblocks/plugins/libThreadSearch.so
ad337000-ad338000 rw-p 00000000 00:00 0
ad338000-ad33f000 r-xp 00000000 fe:00 746225 /usr/lib/libgamin-1.so.0.1.10
ad33f000-ad340000 rw-p 00006000 fe:00 746225 /usr/lib/libgamin-1.so.0.1.10
ad340000-ad37e000 r-xp 00000000 fe:00 1278437 /usr/local/lib/codeblocks/plugins/libFileManager.so
ad37e000-ad380000 rw-p 0003e000 fe:00 1278437 /usr/local/lib/codeblocks/plugins/libFileManager.so
ad380000-ad381000 rw-p 00000000 00:00 0
ad381000-ad410000 r-xp 00000000 fe:00 1278472 /usr/local/lib/codeblocks/plugins/libNassiShneiderman.so
ad410000-ad416000 rw-p 0008e000 fe:00 1278472 /usr/local/lib/codeblocks/plugins/libNassiShneiderman.so
ad416000-ad455000 r-xp 00000000 fe:00 1286342 /usr/local/lib/wxSmithContribItems/libwxflatnotebook.so.0.0.1
ad455000-ad459000 rw-p 0003e000 fe:00 1286342 /usr/local/lib/wxSmithContribItems/libwxflatnotebook.so.0.0.1
ad459000-ad481000 r-xp 00000000 fe:00 1286328 /usr/local/lib/wxSmithContribItems/libwxchartctrl.so.0.0.1
ad481000-ad484000 rw-p 00027000 fe:00 1286328 /usr/local/lib/wxSmithContribItems/libwxchartctrl.so.0.0.1
ad484000-ad718000 r-xp 00000000 fe:00 754140 /usr/local/lib/libwxsmithlib.so.0.0.1
ad718000-ad72d000 rw-p 00293000 fe:00 754140 /usr/local/lib/libwxsmithlib.so.0.0.1
ad72d000-ad73a000 rw-p 00000000 00:00 0
ad73d000-ad743000 r-xp 00000000 fe:00 1278411 /usr/local/lib/codeblocks/plugins/libcopystrings.so
ad743000-ad744000 rw-p 00005000 fe:00 1278411 /usr/local/lib/codeblocks/plugins/libcopystrings.so
ad744000-ad75b000 r-xp 00000000 fe:00 1278294 /usr/local/lib/codeblocks/plugins/libclasswizard.so
ad75b000-ad75c000 rw-p 00017000 fe:00 1278294 /usr/local/lib/codeblocks/plugins/libclasswizard.so
ad75c000-ad783000 r-xp 00000000 fe:00 1278462 /usr/local/lib/codeblocks/plugins/libwxsmithcontribitems.so
ad783000-ad785000 rw-p 00027000 fe:00 1278462 /usr/local/lib/codeblocks/plugins/libwxsmithcontribitems.so
ad785000-ad786000 rw-p 00000000 00:00 0
ad786000-ad8a5000 r-xp 00000000 fe:00 1278443 /usr/local/lib/codeblocks/plugins/libhelp_plugin.so
ad8a5000-ad8ac000 rw-p 0011f000 fe:00 1278443 /usr/local/lib/codeblocks/plugins/libhelp_plugin.so
ad8ac000-ad8af000 rw-p 00000000 00:00 0
ad8af000-ad9fb000 r-xp 00000000 fe:00 1278348 /usr/local/lib/codeblocks/plugins/libcompiler.so
ad9fb000-ad9ff000 rw-p 0014c000 fe:00 1278348 /usr/local/lib/codeblocks/plugins/libcompiler.so
ad9ff000-ada00000 rw-p 00000000 00:00 0
ada00000-adae2000 rw-p 00000000 00:00 0
adae2000-adb00000 ---p 00000000 00:00 0
adb00000-adb02000 r-xp 00000000 fe:00 1278458 /usr/local/lib/codeblocks/plugins/libwxsmith.so
adb02000-adb03000 rw-p 00001000 fe:00 1278458 /usr/local/lib/codeblocks/plugins/libwxsmith.so
adb03000-adb0d000 r-xp 00000000 fe:00 1286559 /usr/local/lib/wxSmithContribItems/libwxcustombutton.so.0.0.1
adb0d000-adb0e000 rw-p 0000a000 fe:00 1286559 /usr/local/lib/wxSmithContribItems/libwxcustombutton.so.0.0.1
adb0e000-adb17000 r-xp 00000000 fe:00 1278378 /usr/local/lib/codeblocks/plugins/libopenfileslist.so
adb17000-adb18000 rw-p 00009000 fe:00 1278378 /usr/local/lib/codeblocks/plugins/libopenfileslist.so
adb18000-adb2c000 r-xp 00000000 fe:00 1278488 /usr/local/lib/codeblocks/plugins/libReopenEditor.so
adb2c000-adb2e000 rw-p 00013000 fe:00 1278488 /usr/local/lib/codeblocks/plugins/libReopenEditor.so
adb2e000-adb8e000 rw-s 00000000 00:04 17203228 /SYSV00000000 (deleted)
adb8e000-adb94000 r-xp 00000000 fe:00 895181 /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
adb94000-adb95000 rw-p 00005000 fe:00 895181 /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
adb95000-adbe7000 r--p 00000000 fe:00 11493578 /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf
adbe7000-adbe8000 ---p 00000000 00:00 0
adbe8000-ae3e8000 rw-p 00000000 00:00 0
ae3e8000-ae3e9000 ---p 00000000 00:00 0
ae3e9000-aebe9000 rw-p 00000000 00:00 0
aebe9000-aebea000 ---p 00000000 00:00 0
aebea000-af3ea000 rw-p 00000000 00:00 0
af3ea000-af3eb000 ---p 00000000 00:00 0
af3eb000-afbeb000 rw-p 00000000 00:00 0
afbeb000-afc1a000 r-xp 00000000 fe:00 876793 /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
afc1a000-afc1b000 r--p 0002e000 fe:00 876793 /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
afc1b000-afc1c000 rw-p 0002f000 fe:00 876793 /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
afc1c000-afc2a000 r-xp 00000000 fe:00 13543765 /lib/i386-linux-gnu/libudev.so.0.13.0
afc2a000-afc2b000 r--p 0000d000 fe:00 13543765 /lib/i386-linux-gnu/libudev.so.0.13.0
afc2b000-afc2c000 rw-p 0000e000 fe:00 13543765 /lib/i386-linux-gnu/libudev.so.0.13.0
afc2c000-afc74000 r-xp 00000000 fe:00 13543698 /lib/i386-linux-gnu/libdbus-1.so.3.5.8
afc74000-afc75000 r--p 00048000 fe:00 13543698 /lib/i386-linux-gnu/libdbus-1.so.3.5.8Aborted
I hope it's the normal killing process and not something to worry about. I know under Windows it would create an RPT file; now, under GNU / Linux I don't know.
Maybe jens could help or explain this to me, it would help a lot.
I do no even to open a "hello world" project, I just start c::b, and close c::b, then I will receive these two errors when c::b exits.
It looks like the thread: ClassBrowserBuilderThread cause this issue.
I just add the test code:
void ClassBrowser::BuildTree()
{
if (Manager::IsAppShuttingDown() || !m_Parser)
return;
// tree shall only be created in case of a new builder thread
bool create_tree = false;
// create the thread if needed
if (!m_BuilderThread)
{
return; //***************
m_BuilderThread = new ClassBrowserBuilderThread(m_Semaphore, &m_BuilderThread);
m_BuilderThread->Create();
m_BuilderThread->Run();
create_tree = true; // new builder thread - need to create new tree
}
...
You see, I forbid to create an ClassBrowserBuilderThread instance, then I have no error report on c::b exit.
Looks like writing GUI related code in a worker thread cause this issue.
I just debug further, I change the BuildTree function like below:
void ClassBrowserBuilderThread::BuildTree()
{
return;
...
}
Thus, no UI related operation here, but c::b still report 2 errors. That's too strange. It looks like this thread can't safely be destroyed.
Ok, I find the reason, we only need Wait(). (We don't need Delete()), otherwise, we try to delete the thread twice.
// class destructor
ClassBrowser::~ClassBrowser()
{
int pos = XRCCTRL(*this, "splitterWin", wxSplitterWindow)->GetSashPosition();
Manager::Get()->GetConfigManager(_T("code_completion"))->Write(_T("/splitter_pos"), pos);
SetParser(NULL);
if (m_BuilderThread)
{
m_Semaphore.Post();
//m_BuilderThread->Delete();
m_BuilderThread->Wait();
delete m_BuilderThread;
m_BuilderThread=0;
}
}
It works OK.
This solution and my solution it's the same hierachy and compilation options. ( see the Attach 7zfile )
I use Mingw ( TDM ).
Example :
I rebuild-All :
my targets are all build.
I modified :
In Lib_Test1 -> Math.cpp
return !aResult ; -> return aResult ;
I build-all in Codeblocks :
-------------- Build: Debug in Lib_Test1 ---------------
[ 50,0%] Compiling: ..\..\..\Test\Math.cpp
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test1_d_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test1_d_CB.a
Output size is 83,50 KB
-------------- Build: Release in Lib_Test1 ---------------
[ 50,0%] Compiling: ..\..\..\Test\Math.cpp
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test1_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test1_CB.a
Output size is 80,50 KB
-------------- Build: Debug in Lib_Test2 ---------------
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test2_d_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test2_d_CB.a
Output size is 49,90 KB
-------------- Build: Release in Lib_Test2 ---------------
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test2_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test2_CB.a
Output size is 9,50 KB
-------------- Build: Debug in App_Test1 ---------------
[100,0%] Linking console executable: ..\..\..\..\Bin\Mingw\App_Test1_d_CB.exe
Output size is 976,25 KB
-------------- Build: Release in App_Test1 ---------------
[100,0%] Linking console executable: ..\..\..\..\Bin\Mingw\App_Test1_CB.exe
Output size is 461,00 KB
-------------- Build: Debug in App_Test2 ---------------
[100,0%] Linking console executable: ..\..\..\..\Bin\Mingw\App_Test2_d_CB.exe
Output size is 976,84 KB
-------------- Build: Release in App_Test2 ---------------
[100,0%] Linking console executable: ..\..\..\..\Bin\Mingw\App_Test2_CB.exe
Output size is 461,50 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings (0 minutes, 1 seconds)
Codeblocks re-link all targets.
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test2_CB.a
This is the reason.
You are linking to a static lib.
Have you tried to link directly to the dlls?
Newer TDM/Ming gcc's support this.
You have resolved my problem.
Thanks a lot.
I rename in the linker settings my libraries :
Lib_Test1_d_CB -> Lib_Test1_d_CB.dll
Lib_Test1_CB -> Lib_Test1_CB.dll
etc.
-------------- Build: Debug in Lib_Test1 ---------------
[ 50,0%] Compiling: ..\..\..\Test\Math.cpp
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test1_d_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test1_d_CB.a
Output size is 83,50 KB
-------------- Build: Release in Lib_Test1 ---------------
[ 50,0%] Compiling: ..\..\..\Test\Math.cpp
[100,0%] Linking dynamic library: ..\..\..\..\Bin\Mingw\Lib_Test1_CB.dll
Creating library file: ..\..\..\..\Bin\Mingw\libLib_Test1_CB.a
Output size is 80,50 KB
-------------- Build: Debug in Lib_Test2 ---------------
Target is up to date.
-------------- Build: Release in Lib_Test2 ---------------
Target is up to date.
-------------- Build: Debug in App_Test1 ---------------
Target is up to date.
-------------- Build: Release in App_Test1 ---------------
Target is up to date.
-------------- Build: Debug in App_Test2 ---------------
Target is up to date.
-------------- Build: Release in App_Test2 ---------------