...
ranlib ..\..\lib\gcc_dll\libwxscintilla.a
g++ -c -o gcc_mswudll\monodll_dummy.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL -Wno-ctor-dtor-privacy -fno-keep-inline-dllexport -MTgcc_mswudll\monodll_dummy.o -MFgcc_mswudll\monodll_dummy.o.d -MD -MP ../../src/common/dummy.cpp
g++ -c -o gcc_mswudll\monodll_any.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL -Wno-ctor-dtor-privacy -fno-keep-inline-dllexport -MTgcc_mswudll\monodll_any.o -MFgcc_mswudll\monodll_any.o.d -MD -MP ../../src/common/any.cpp
In file included from E:/code/gcc/i686-5.2.0-release-posix-dwarf-rt_v4-rev0/mingw32/i686-w64-mingw32/include/c++/type_traits:35:0,
from ..\..\include/wx/strvararg.h:25,
from ..\..\include/wx/string.h:46,
from ..\..\include/wx/any.h:19,
from ../../src/common/any.cpp:18:
E:/code/gcc/i686-5.2.0-release-posix-dwarf-rt_v4-rev0/mingw32/i686-w64-mingw32/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from ..\..\include/wx/string.h:46:0,
from ..\..\include/wx/any.h:19,
from ../../src/common/any.cpp:18:
..\..\include/wx/strvararg.h:350:18: error: 'is_enum' in namespace 'std' does not name a template type
typedef std::is_enum<T> is_enum;
^
..\..\include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this scope
enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
^
..\..\include/wx/strvararg.h:354:68: error: template argument 1 is invalid
enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
^
makefile.gcc:6428: recipe for target 'gcc_mswudll\monodll_any.o' failed
mingw32-make: *** [gcc_mswudll\monodll_any.o] Error 1
-Wno-deprecated-declarations
-------------- Build: sdk in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 0.8%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c include\sdk_precomp.h -o .objs30\include\sdk_precomp.h.gch
In file included from include\cbauibook.h:13:0,
from include\sdk_common.h:133,
from include\sdk_precomp.h:13:
D:\wx3\include/wx/aui/auibook.h:349:18: warning: 'virtual bool wxAuiNotebook::AddPage(wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
^
In file included from include\sdk_common.h:133:0,
from include\sdk_precomp.h:13:
include\cbauibook.h:141:14: warning: by 'bool cbAuiNotebook::AddPage(wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
bool AddPage(wxWindow* page,
^
In file included from include\cbauibook.h:13:0,
from include\sdk_common.h:133,
from include\sdk_precomp.h:13:
D:\wx3\include/wx/aui/auibook.h:352:18: warning: 'virtual bool wxAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
^
In file included from include\sdk_common.h:133:0,
from include\sdk_precomp.h:13:
include\cbauibook.h:156:14: warning: by 'bool cbAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
bool InsertPage(size_t page_idx,
^
15:23:36: Resource files must have same version number.I think I have reported some where in this forum, but it is lost...
15:23:38: Resource files must have same version number.
[debug]Program received signal SIGSEGV, Segmentation fault.
[debug]0x6474c5e5 in wxWindow::FindItemByHWND(HWND__*, bool) const () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]>>>>>>cb_gdb:
Program received signal SIGSEGV, Segmentation fault.
In wxWindow::FindItemByHWND(HWND__*, bool) const () (D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll)
[debug]> bt 30
[debug]#0 0x6474c5e5 in wxWindow::FindItemByHWND(HWND__*, bool) const () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#1 0x6474dc28 in wxWindow::HandleCtlColor(HBRUSH__**, HDC__*, HWND__*) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#2 0x6475911b in wxWindow::MSWHandleMessage(long*, unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#3 0x647497a0 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#4 0x64741f96 in wxTopLevelWindowMSW::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#5 0x647a8046 in wxFrame::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#6 0x64751223 in wxWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#7 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#8 0x001d0a82 in ?? ()
[debug]#9 0x00000133 in ?? ()
[debug]#10 0x86011c8a in ?? ()
[debug]#11 0x00140eb6 in ?? ()
[debug]#12 0x647511b0 in wxWindow::SubclassWin(HWND__*) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#13 0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#14 0x647511b0 in wxWindow::SubclassWin(HWND__*) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#15 0x7e42927b in USER32!GetParent () from C:\WINDOWS\system32\user32.dll
[debug]#16 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0 0x6474c5e5 in wxWindow::FindItemByHWND(HWND__*, bool) const () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#1 0x6474dc28 in wxWindow::HandleCtlColor(HBRUSH__**, HDC__*, HWND__*) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#2 0x6475911b in wxWindow::MSWHandleMessage(long*, unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#3 0x647497a0 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#4 0x64741f96 in wxTopLevelWindowMSW::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#5 0x647a8046 in wxFrame::MSWWindowProc(unsigned int, unsigned int, long) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#6 0x64751223 in wxWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#7 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#8 0x001401da in ?? ()
[debug]#9 0x00000133 in ?? ()
[debug]#10 0xf3011d42 in ?? ()
[debug]#11 0x00410eea in BreakpointsDlg::OnOpen (this=0xffffffff, event=...) at F:\cb_sf_git\trunk\src\src\breakpointsdlg.cpp:338
[debug]#12 0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#13 0x647511b0 in wxWindow::SubclassWin(HWND__*) () from D:\wx3\lib\gcc_dll\wxmsw30u_gcc_cb.dll
[debug]#14 0x7e42927b in USER32!GetParent () from C:\WINDOWS\system32\user32.dll
[debug]#15 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
void OpenFilesListPlugin::OnAttach()
{
m_ViewMenu = 0;
m_EditorArray.Clear();
// create tree
m_pTree = new wxTreeCtrl(Manager::Get()->GetAppWindow(), idOpenFilesTree,wxDefaultPosition,wxSize(150, 100),
wxTR_HAS_BUTTONS | wxNO_BORDER | wxTR_HIDE_ROOT);
// load bitmaps
wxBitmap bmp;
m_pImages = new wxImageList(16, 16);
wxString prefix = ConfigManager::GetDataFolder() + _T("/images/");
bmp = cbLoadBitmap(prefix + _T("folder_open.png"), wxBITMAP_TYPE_PNG); // folder
m_pImages->Add(bmp);
bmp = cbLoadBitmap(prefix + _T("ascii.png"), wxBITMAP_TYPE_PNG); // file
m_pImages->Add(bmp);
...
Edit: Are you doing 32 bit or 64 bit windows builds? I can test either one.I'm on an old 32 bit windows XP system. :)
Edit: Are you doing 32 bit or 64 bit windows builds? I can test either one.I'm on an old 32 bit windows XP system. :)
My guess is that your build is totally broken.
Because this kind of backtrace can happen only if you right or double click in the breakpoints dialog.
So if you're not doing so and you're getting this, then your build is totally broken.
The cause might be mixing old and new dlls, broken compiler, pch problems, etc.
So if I were you I start with deleting everything in .objs30, devel30 and output30.
[debug]#8 0x001401da in ?? ()
[debug]#9 0x00000133 in ?? ()
[debug]#10 0xf3011d42 in ?? ()
[debug]#11 0x00410eea in BreakpointsDlg::OnOpen (this=0xffffffff, event=...)
@set PATH=E:\code\common_bin;D:\wx3\lib\gcc_dll;E:\code\gcc\i686-5.2.0-release-posix-dwarf-rt_v4-rev0\mingw32\bin
start cblauncher.exe --debug-log
cd C:\SourceCode\OpenSourceCode\Apps\IDEs\CodeBlocks\codeblocks_windows-git\src\output30_64
set path=C:\SourceCode\OpenSourceCode\Apps\IDEs\CodeBlocks\codeblocks_windows-git\src\output30_64
codeblocks
-p clean-configure
Program received signal SIGSEGV, Segmentation fault.
In wxWindow::FindItemByHWND(HWND__*, bool) const () (F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll)
[debug]> bt 30
[debug]#0 0x6474c5e5 in wxWindow::FindItemByHWND(HWND__*, bool) const () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#1 0x6474dc28 in wxWindow::HandleCtlColor(HBRUSH__**, HDC__*, HWND__*) () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#2 0x6475911b in wxWindow::MSWHandleMessage(long*, unsigned int, unsigned int, long) () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#3 0x647497a0 in wxWindow::MSWWindowProc(unsigned int, unsigned int, long) () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#4 0x64751223 in wxWndProc(HWND__*, unsigned int, unsigned int, long)@16 () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#5 0x7e418734 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#6 0x0004087e in ?? ()
[debug]#7 0x00000133 in ?? ()
[debug]#8 0x8601148d in ?? ()
[debug]#9 0x00070a62 in ?? ()
[debug]#10 0x647511b0 in wxWindow::SubclassWin(HWND__*) () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#11 0x7e418816 in USER32!GetDC () from C:\WINDOWS\system32\user32.dll
[debug]#12 0x647511b0 in wxWindow::SubclassWin(HWND__*) () from F:\cb_sf_git\trunk\src\devel30\wxmsw30u_gcc_cb.dll
[debug]#13 0x7e42927b in USER32!GetParent () from C:\WINDOWS\system32\user32.dll
[debug]#14 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
Just noticed that the SVN I am using is 10474 and it did NOT have your problem.OK, but I'll wait to see the result from your result of 32 bit mingw gcc 5.2. ;)
Edit: This is using Git and it sometimes does NOT report the correct SVN under windows for me.
Tim S.
void OpenFilesListPlugin::OnRelease(bool appShutDown)
{
if (appShutDown)
return;
// remove registered event sinks
Manager::Get()->RemoveAllEventSinksFor(this);
// remove tree from docking system
CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
evt.pWindow = m_pTree;
Manager::Get()->ProcessEvent(evt);
// finally destroy the tree
m_pTree->Destroy();
m_pTree = nullptr;
}
if (appShutDown)
return;
/** Any descendent plugin should override this virtual method and
* perform any necessary de-initialization. This method is called by
* Code::Blocks (PluginManager actually) when the plugin has been
* loaded, attached and should de-attach from Code::Blocks.\n
* Think of this method as the actual destructor...
* @param appShutDown If true, the application is shutting down. In this
* case *don't* use Manager::Get()->Get...() functions or the
* behaviour is undefined...
*/
virtual void OnRelease(cb_optional bool appShutDown){}
void CompilerGCC::OnRelease(bool appShutDown)
{
// disable script functions
ScriptBindings::gBuildLogId = -1;
SaveOptions();
Manager::Get()->GetConfigManager(_T("compiler"))->Write(_T("/default_compiler"), CompilerFactory::GetDefaultCompilerID());
if (Manager::Get()->GetLogManager())
{
// for batch builds, the log is deleted by the manager
if (!Manager::IsBatchBuild())
{
CodeBlocksLogEvent evt(cbEVT_REMOVE_LOG_WINDOW, m_pLog);
Manager::Get()->ProcessEvent(evt);
}
m_pLog = 0;
CodeBlocksLogEvent evt(cbEVT_REMOVE_LOG_WINDOW, m_pListLog);
m_pListLog->DestroyControls();
Manager::Get()->ProcessEvent(evt);
m_pListLog = 0;
}
// let wx handle this on shutdown ( if we return here Valgrind will be sad :'( )
if (!appShutDown)
DoClearTargetMenu();
m_timerIdleWakeUp.Stop();
FreeProcesses();
CompilerFactory::UnregisterCompilers();
}
void DefaultMimeHandler::OnRelease(cb_unused bool appShutDown)
{
CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
evt.pWindow = m_Html;
Manager::Get()->ProcessEvent(evt);
m_Html->Destroy();
m_Html = 0;
// save configuration
ConfigManager* conf = Manager::Get()->GetConfigManager(_T("mime_types"));
wxArrayString list = conf->EnumerateKeys(_T("/"));
for (unsigned int i = 0; i < list.GetCount(); ++i)
{
conf->UnSet(list[i]);
}
for (unsigned int i = 0; i < m_MimeTypes.GetCount(); ++i)
{
cbMimeType* mt = m_MimeTypes[i];
wxString txt;
txt << (mt->useEditor ? _T("true") : _T("false")) << _T(";");
txt << (mt->useAssoc ? _T("true") : _T("false")) << _T(";");
txt << (mt->programIsModal ? _T("true") : _T("false")) << _T(";");
txt << mt->wildcard << _T(";");
txt << mt->program << _T(' ');
wxString key;
key.Printf(_T("MimeType%u"), i);
conf->Write(key, txt);
}
WX_CLEAR_ARRAY(m_MimeTypes);
}
Still did NOT see the problem; using SVN 10507 the last one was likely 10506 reported wrong by Git.Thanks for the test.
I am using wx3.0.2 with no patches and the compiler is i686-5.2.0-release-posix-dwarf-rt_v4-rev0
This last time I used an SVN repo with all old stuff deleted.
Edit: I still had to copy 3 DLLs to get CB to run; if you did NOT then you did something very different from me.I did the same thing as you did.
libgcc_s_dw2-1.dll
libstdc++-6.dll
libwinpthread-1.dll
OS Windows 7 32 Bit Ultimate.This is the only difference(I'm on winXP 32bit), maybe, my OS is broken? :(
wxWidgets built with my new normal options ofI use different workaround to handle this issue, but I don't think this cause the crash issue.
CPPFLAGS="-DHAVE_TR1_TYPE_TRAITS"
CXXFLAGS="-Wno-unused-local-typedefs -fno-keep-inline-dllexport"
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport" >log-debug.txt 2>&1
src/CodeBlocks_wx30.cbp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 2b6a679..43c4e9b 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -700,7 +700,7 @@
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
- <Variable name="WX_SUFFIX" value="u" />
+ <Variable name="WX_SUFFIX" value="ud" />
<Variable name="WX_VERSION" value="30" />
</Environment>
</Build>
@@ -725,6 +725,7 @@
<Add option="-DCB_PRECOMP" />
<Add option="-DWX_PRECOMP" />
<Add option="-DwxUSE_UNICODE" />
+ <Add option="-D__WXDEBUG__" />
<Add directory="$(#WX30.include)" />
<Add directory="$(#WX30.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
<Add directory="sdk/wxscintilla/include" />
I think I may meet a GCC issue which cause the crash I reported in this thread.
Now, I have just finishing building the wx3 library in debug mode with the command line:
After that, when testing the built C::B, I don't have any crash when disable or enable plugins. I even strip all the debug information(both the C::B related binaries and the wx3 library dll), it also works fine. So, I believe the crash bug comes from the mingw-build gcc 5.2.
Another issue I encountered is that after running the "update30.bat", I can't start codeblocks.exe from the output30 folder. I check the codeblocks.exe in output30 folder by dependency walker tool, it said the "dbghelp.dll" file is broken. How would that happen? (I think I use a wrong strip.exe?, because I put a strip.exe in a common folder, the strip.exe is quite old, the build time of the strip.exe was 2011-03-20, so maybe, I need to use the strip.exe come from the newer gcc suite), to solve the issue, I just copy the "dbghelp.dll" from the devel30 folder to output30 folder, and now, codeblocks.exe works fine. :)
I also have no Compilers in my PATH, but I have put an old "strip.exe" in my PATH.I think I may meet a GCC issue which cause the crash I reported in this thread.
Now, I have just finishing building the wx3 library in debug mode with the command line:
After that, when testing the built C::B, I don't have any crash when disable or enable plugins. I even strip all the debug information(both the C::B related binaries and the wx3 library dll), it also works fine. So, I believe the crash bug comes from the mingw-build gcc 5.2.
Another issue I encountered is that after running the "update30.bat", I can't start codeblocks.exe from the output30 folder. I check the codeblocks.exe in output30 folder by dependency walker tool, it said the "dbghelp.dll" file is broken. How would that happen? (I think I use a wrong strip.exe?, because I put a strip.exe in a common folder, the strip.exe is quite old, the build time of the strip.exe was 2011-03-20, so maybe, I need to use the strip.exe come from the newer gcc suite), to solve the issue, I just copy the "dbghelp.dll" from the devel30 folder to output30 folder, and now, codeblocks.exe works fine. :)
I do NOT strip the DLLs put into output30 because no Compilers are in my path.
Do you still want the Zipped Binary of my CB build?Yes, I need that, I want to see whether your built binary crashes in my system. Thanks.
I am uploading it right now. I am guessing 30 minutes to finish uploading.
Tim S.
Yes, I need that, I want to see whether your built binary crashes in my system. Thanks.
EDIT:I use '-o3' for my x32 and x64 builds all the time and I don't have such a crash issue. My version for mingw-builds is 4.9.2 though. I used your method to overcome the pch issue to be able to compile 64-bit cb. Maybe you should try '-o3'.
When using the BUILD=debug option to build wxWidgets 3.0.2, it actually use the "-O0" option for the G++ compiler, while BUILD=release uses the "-O2" option instead, thus I believe the "-O2" cause the crash issue.
Yes, I need that, I want to see whether your built binary crashes in my system. Thanks.
PMed link to you.
Please confirm you received it; and it unzips good; I hope to delete that old location today.
Tim S.
codeblocks.exe caused an Access Violation at location 69E8C5E5 in module wxmsw30u_gcc_mingw_builds.dll Reading from location 00000010.
Registers:
eax=6abc9220 ebx=00000000 ecx=00000000 edx=00000000 esi=00000000 edi=00040be8
eip=69e8c5e5 esp=0022d684 ebp=0a365f18 iopl=0 nv up ei pl zr na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
AddrPC Params
69E8C5E5 00040BE8 00000001 00000016 wxmsw30u_gcc_mingw_builds.dll!wxWindow::FindItemByHWND(HWND__*, bool) const
69E8DC28 0022D830 00000133 4E01187C wxmsw30u_gcc_mingw_builds.dll!wxWindow::HandleCtlColor(HBRUSH__**, HDC__*, HWND__*)
69E897A0 77F1E10B 0301112F 00000133 wxmsw30u_gcc_mingw_builds.dll!wxWindow::MSWWindowProc(unsigned int, unsigned int, long)
codeblocks.exe 13.12.0.0
ntdll.dll 5.1.2600.6055
kernel32.dll 5.1.2600.6532
COMCTL32.DLL 5.82.2900.6028
ADVAPI32.dll 5.1.2600.5755
RPCRT4.dll 5.1.2600.6477
Secur32.dll 5.1.2600.5834
GDI32.dll 5.1.2600.6460
USER32.dll 5.1.2600.5512
libgcc_s_dw2-1.dll
msvcrt.dll 7.0.2600.5512
libwinpthread-1.dll 1.0.0.0
SHELL32.dll 6.0.2900.6242
SHLWAPI.dll 6.0.2900.5912
SHFOLDER.DLL 6.0.2900.5512
libstdc++-6.dll
wxmsw30u_gcc_mingw_builds.dll 3.0.2.0
...
...
src\plugins\contrib\wxSmith\wxwidgets\defitems\wxsfontpickerctrl.cpp|70|warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]|
if(!sFnt.Len() > 0){
sFntName = wxT("wxNullFont");
}
New warning that looks like a real problem to me.Good catch, so it should be "if(sFnt.Len() == 0)", right?
MSys2 32 bit MinGW GCC 5.2 compiler.
Tim S.CodeLine 70 to 72 belowsrc\plugins\contrib\wxSmith\wxwidgets\defitems\wxsfontpickerctrl.cpp|70|warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]|
Codeif(!sFnt.Len() > 0){
sFntName = wxT("wxNullFont");
}
New warning that looks like a real problem to me.Good catch, so it should be "if(sFnt.Len() == 0)", right?
MSys2 32 bit MinGW GCC 5.2 compiler.
Tim S.CodeLine 70 to 72 belowsrc\plugins\contrib\wxSmith\wxwidgets\defitems\wxsfontpickerctrl.cpp|70|warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]|
Codeif(!sFnt.Len() > 0){
sFntName = wxT("wxNullFont");
}
CodeBlocksDockEvent evt(cbEVT_ADD_DOCK_WINDOW);
....
Manager::Get()->ProcessEvent(evt);
// remove tree from docking system
CodeBlocksDockEvent evt(cbEVT_REMOVE_DOCK_WINDOW);
evt.pWindow = m_pTree;
Manager::Get()->ProcessEvent(evt);
// finally destroy the tree
m_pTree->Destroy();
m_pTree = nullptr;
m_pTree = new wxTreeCtrl();
...
m_pImages = new wxImageList(16, 16);
....
m_pTree->SetImageList(m_pImages);
Currently, I would still suggest using -O0 option to build both wxWidgets 3.0.2 and C::B trunk, at least it don't crash on my windows XP.EDIT:I use '-o3' for my x32 and x64 builds all the time and I don't have such a crash issue. My version for mingw-builds is 4.9.2 though. I used your method to overcome the pch issue to be able to compile 64-bit cb. Maybe you should try '-o3'.
When using the BUILD=debug option to build wxWidgets 3.0.2, it actually use the "-O0" option for the G++ compiler, while BUILD=release uses the "-O2" option instead, thus I believe the "-O2" cause the crash issue.
src/CodeBlocks_wx30.cbp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 61c6659..7b04c37 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -700,7 +700,7 @@
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
- <Variable name="WX_SUFFIX" value="u" />
+ <Variable name="WX_SUFFIX" value="ud" />
<Variable name="WX_VERSION" value="30" />
</Environment>
After finishing building CodeBlocks_wx30.cbp and running update30.bat, I just start C::B inside C::B.It is here: warning message about resource version number incorrect (http://forums.codeblocks.org/index.php/topic,20198.msg137722.html#msg137722), and the two warning above was caused by local patch files which does not belong to C::B trunk. :)
The first thing I see is a dialog from wx, saysQuote15:23:36: Resource files must have same version number.I think I have reported some where in this forum, but it is lost...
15:23:38: Resource files must have same version number.
Good catch, so it should be "if(sFnt.Len() == 0)", right?Yes.
It is here: warning message about resource version number incorrect (http://forums.codeblocks.org/index.php/topic,20198.msg137722.html#msg137722), and the two warning above was caused by local patch files which does not belong to C::B trunk. :)I've answered in the other thread.
Hmm, I think my comment caused a confusion, my apologies. I'm not using cb with wx3.0, I'm still using it with wx2.8. I just wanted to emphasize that using '-o3' doesn't make my build crash or behave abnormal in some way. It's just as stable as a normal nightly if not more. I also built wx2.8 with default release option, I think it is '-o2' and I didn't change it. Sorry for the confusion again. I'm very busy currently to make any wx3.0 build but I think I have a ready to use wx3.0 build so I may try building cb when and if I can find some time. Do you require an xp or a win7 build? I'll pm you a link if I success (again if I can find some time, no promises ;)). Lastly be aware I'm using mingw-builds compiler not tdm if that matters.I use '-o3' for my x32 and x64 builds all the time and I don't have such a crash issue. My version for mingw-builds is 4.9.2 though. I used your method to overcome the pch issue to be able to compile 64-bit cb. Maybe you should try '-o3'.Currently, I would still suggest using -O0 option to build both wxWidgets 3.0.2 and C::B trunk, at least it don't crash on my windows XP.
Do you have a 32 bit C::B (include the wx 3.0.2 library)which you build with '-o3' option? If you don't have a Windows XP system, You can upload some where, and PM the link, I'd like to test it, thanks.
Do you have issue with CB locking up when you run ProjectOptionsManipulator wx3.0 compiled with gcc 5.2 under windows?I just build this plugin, and I can enable or disable this plugin in C::B's plugin manager, no crash here. I'm also using rev10515, wxWidgts and C::B are all build with "-O0".
I am testing a modified version of SVN rev 10515 and once I try to bring up the ProjectOptionsManipulator CB stops responding.
wxWidgets 3.02
Windows 7 64 bit
MSys2 MinGW64 GCC 5.2 64 bit
Edit: I am going to try upgrading to a newer SVN rev to see if that fixes the problem.
Tim S.
-------------- Build: default in ProjectOptionsManipulator wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 25.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DBUILDING_PLUGIN -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DwxUSE_UNICODE -I..\..\..\include -I..\..\..\sdk\wxscintilla\include -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -c ProjectOptionsManipulator.cpp -o ..\..\..\.objs30\plugins\contrib\ProjectOptionsManipulator\ProjectOptionsManipulator.o
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryValidator(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
^
In file included from D:\wx3\include/wx/string.h:24:0,
from ProjectOptionsManipulator.h:9,
from ProjectOptionsManipulator.cpp:10:
D:\wx3\include/wx/event.h:3683:22: note: declared here
virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; )
^
D:\wx3\include/wx/defs.h:641:43: note: in definition of macro 'wxDEPRECATED'
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
^
D:\wx3\include/wx/event.h:3682:5: note: in expansion of macro 'wxDEPRECATED_BUT_USED_INTERNALLY_INLINE'
wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
^
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryParent(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
^
In file included from D:\wx3\include/wx/string.h:24:0,
from ProjectOptionsManipulator.h:9,
from ProjectOptionsManipulator.cpp:10:
D:\wx3\include/wx/event.h:3686:22: note: declared here
virtual bool TryParent(wxEvent& event), return DoTryApp(event); )
^
D:\wx3\include/wx/defs.h:641:43: note: in definition of macro 'wxDEPRECATED'
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
^
D:\wx3\include/wx/event.h:3685:5: note: in expansion of macro 'wxDEPRECATED_BUT_USED_INTERNALLY_INLINE'
wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
^
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryValidator(wxEvent&)' is deprecated [-Wdeprecated-declarations]
...
...I mean if you build a 32 bit binary C::B, I can test it on my 32bit winXP. Thanks.
Do you require an xp or a win7 build? I'll pm you a link if I success (again if I can find some time, no promises ;)). Lastly be aware I'm using mingw-builds compiler not tdm if that matters.
#if defined(NOPCH)
#undef CB_PRECOMP
#endif // NOPCH
#if ( defined(CB_PRECOMP) && !defined(WX_PRECOMP) )
#define WX_PRECOMP
#endif // CB_PRECOMP
// basic wxWidgets headers : this one itself will check for precompiled headers
// and if so will include a list of wx headers, at the bottom we add some more headers
// in the case of precompilation (note : some headers are in both lists)
// so even if NO CB_PRECOMP we can still have WX_PRECOMP turned on in this "wxprec" header
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "prep.h" // this is deliberately not inside the #ifdef block
#ifdef CB_PRECOMP
// some common wxWidgets headers
#include <wx/arrstr.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/checklst.h>
#include <wx/choice.h>
#include <wx/colordlg.h>
#include <wx/combobox.h>
#include <wx/confbase.h>
#include <wx/datetime.h>
#include <wx/dialog.h>
#include <wx/dir.h>
#include <wx/dynarray.h>
#include <wx/event.h>
#include <wx/file.h>
#include <wx/filename.h>
#include <wx/font.h>
#include <wx/frame.h>
#include <wx/fs_zip.h>
#include <wx/hashmap.h>
#include <wx/image.h>
#include <wx/imaglist.h>
#include <wx/intl.h>
#include <wx/list.h>
#include <wx/listbox.h>
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/msgdlg.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/print.h>
#include <wx/process.h>
#include <wx/radiobox.h>
#include <wx/radiobut.h>
#include <wx/regex.h>
#include <wx/sizer.h>
#include <wx/socket.h>
#include <wx/spinctrl.h>
#include <wx/splitter.h>
#include <wx/stattext.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/thread.h>
#include <wx/timer.h>
#include <wx/toolbar.h>
#include <wx/treectrl.h>
#include <wx/txtstrm.h>
#include <wx/utils.h>
#include <wx/wfstream.h>
#include <wx/wxscintilla.h>
#include <wx/xrc/xmlres.h>
// basic headers
#include "settings.h"
#include "globals.h"
#include "sdk_events.h"
#include "cbexception.h"
// absolute base classes
#include "logger.h"
#include "editorbase.h"
#include "cbeditor.h"
#include "compileoptionsbase.h"
#include "compiletargetbase.h"
#include "projectbuildtarget.h"
#include "projectfile.h"
#include "cbplugin.h"
#include "cbproject.h"
#include "cbtool.h"
#include "cbworkspace.h"
#include "compilerfactory.h"
#include "compiler.h"
#include "workspaceloader.h"
#include "editorcolourset.h"
#include "pipedprocess.h"
#include "scrollingdialog.h"
#include "cbauibook.h"
// managers
#include "manager.h"
#include "configmanager.h"
#include "editormanager.h"
#include "logmanager.h"
#include "projectmanager.h"
#include "menuitemsmanager.h"
#include "scriptingmanager.h"
#include "toolsmanager.h"
#include "templatemanager.h"
#include "macrosmanager.h"
#include "pluginmanager.h"
#include "personalitymanager.h"
#include "uservarmanager.h"
#include "filemanager.h"
// other base files
#include "xtra_res.h"
#include "safedelete.h"
#include "infowindow.h"
#include "licenses.h"
#endif // CB_PRECOMP
#ifdef CB_PRECOMP
// some common wxWidgets headers
#include <wx/arrstr.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/checklst.h>
...
Hi, Tim, I just looked at the PCH relate topic, and I see that "WX_PRECOMP" is not needed in the codeblocks.cbp or codeblocks_w30.cbp, since we don't need a wx/wxprec.h in our C::B project, also we don't need to generate a single wxprec.h.gch. Since sdk.h already includes all the wx/xxx.h C::B needed, See our discussion here: patch to build C::B against wx 3.0 with PCH enabled (http://forums.codeblocks.org/index.php/topic,18821.msg128936.html#msg128936)
EDIT:
In the sdk_common.h, we have such codeCode#if defined(NOPCH)
#undef CB_PRECOMP
#endif // NOPCH
#if ( defined(CB_PRECOMP) && !defined(WX_PRECOMP) )
#define WX_PRECOMP
#endif // CB_PRECOMP
// basic wxWidgets headers : this one itself will check for precompiled headers
// and if so will include a list of wx headers, at the bottom we add some more headers
// in the case of precompilation (note : some headers are in both lists)
// so even if NO CB_PRECOMP we can still have WX_PRECOMP turned on in this "wxprec" header
#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "prep.h" // this is deliberately not inside the #ifdef block
#ifdef CB_PRECOMP
// some common wxWidgets headers
#include <wx/arrstr.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/checklst.h>
#include <wx/choice.h>
#include <wx/colordlg.h>
#include <wx/combobox.h>
#include <wx/confbase.h>
#include <wx/datetime.h>
#include <wx/dialog.h>
#include <wx/dir.h>
#include <wx/dynarray.h>
#include <wx/event.h>
#include <wx/file.h>
#include <wx/filename.h>
#include <wx/font.h>
#include <wx/frame.h>
#include <wx/fs_zip.h>
#include <wx/hashmap.h>
#include <wx/image.h>
#include <wx/imaglist.h>
#include <wx/intl.h>
#include <wx/list.h>
#include <wx/listbox.h>
#include <wx/listctrl.h>
#include <wx/log.h>
#include <wx/menu.h>
#include <wx/menuitem.h>
#include <wx/msgdlg.h>
#include <wx/notebook.h>
#include <wx/panel.h>
#include <wx/print.h>
#include <wx/process.h>
#include <wx/radiobox.h>
#include <wx/radiobut.h>
#include <wx/regex.h>
#include <wx/sizer.h>
#include <wx/socket.h>
#include <wx/spinctrl.h>
#include <wx/splitter.h>
#include <wx/stattext.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/thread.h>
#include <wx/timer.h>
#include <wx/toolbar.h>
#include <wx/treectrl.h>
#include <wx/txtstrm.h>
#include <wx/utils.h>
#include <wx/wfstream.h>
#include <wx/wxscintilla.h>
#include <wx/xrc/xmlres.h>
// basic headers
#include "settings.h"
#include "globals.h"
#include "sdk_events.h"
#include "cbexception.h"
// absolute base classes
#include "logger.h"
#include "editorbase.h"
#include "cbeditor.h"
#include "compileoptionsbase.h"
#include "compiletargetbase.h"
#include "projectbuildtarget.h"
#include "projectfile.h"
#include "cbplugin.h"
#include "cbproject.h"
#include "cbtool.h"
#include "cbworkspace.h"
#include "compilerfactory.h"
#include "compiler.h"
#include "workspaceloader.h"
#include "editorcolourset.h"
#include "pipedprocess.h"
#include "scrollingdialog.h"
#include "cbauibook.h"
// managers
#include "manager.h"
#include "configmanager.h"
#include "editormanager.h"
#include "logmanager.h"
#include "projectmanager.h"
#include "menuitemsmanager.h"
#include "scriptingmanager.h"
#include "toolsmanager.h"
#include "templatemanager.h"
#include "macrosmanager.h"
#include "pluginmanager.h"
#include "personalitymanager.h"
#include "uservarmanager.h"
#include "filemanager.h"
// other base files
#include "xtra_res.h"
#include "safedelete.h"
#include "infowindow.h"
#include "licenses.h"
#endif // CB_PRECOMP
So, if wx/wxprec.h contains some extra header files we don't needed. Such as the ones not in below #ifdefCode#ifdef CB_PRECOMP
// some common wxWidgets headers
#include <wx/arrstr.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/checklst.h>
...
Do you have issue with CB locking up when you run ProjectOptionsManipulator wx3.0 compiled with gcc 5.2 under windows?I just build this plugin, and I can enable or disable this plugin in C::B's plugin manager, no crash here. I'm also using rev10515, wxWidgts and C::B are all build with "-O0".
I am testing a modified version of SVN rev 10515 and once I try to bring up the ProjectOptionsManipulator CB stops responding.
wxWidgets 3.02
Windows 7 64 bit
MSys2 MinGW64 GCC 5.2 64 bit
Edit: I am going to try upgrading to a newer SVN rev to see if that fixes the problem.
Tim S.
EDIT: I can use this plugin to search something in a C::B project, works fine here. :)
EDIT2 I get wired compiler warnings which point to a "}" in the cpp file:Code-------------- Build: default in ProjectOptionsManipulator wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 25.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -DBUILDING_PLUGIN -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DwxUSE_UNICODE -I..\..\..\include -I..\..\..\sdk\wxscintilla\include -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -c ProjectOptionsManipulator.cpp -o ..\..\..\.objs30\plugins\contrib\ProjectOptionsManipulator\ProjectOptionsManipulator.o
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryValidator(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
^
In file included from D:\wx3\include/wx/string.h:24:0,
from ProjectOptionsManipulator.h:9,
from ProjectOptionsManipulator.cpp:10:
D:\wx3\include/wx/event.h:3683:22: note: declared here
virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; )
^
D:\wx3\include/wx/defs.h:641:43: note: in definition of macro 'wxDEPRECATED'
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
^
D:\wx3\include/wx/event.h:3682:5: note: in expansion of macro 'wxDEPRECATED_BUT_USED_INTERNALLY_INLINE'
wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
^
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryParent(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
^
In file included from D:\wx3\include/wx/string.h:24:0,
from ProjectOptionsManipulator.h:9,
from ProjectOptionsManipulator.cpp:10:
D:\wx3\include/wx/event.h:3686:22: note: declared here
virtual bool TryParent(wxEvent& event), return DoTryApp(event); )
^
D:\wx3\include/wx/defs.h:641:43: note: in definition of macro 'wxDEPRECATED'
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
^
D:\wx3\include/wx/event.h:3685:5: note: in expansion of macro 'wxDEPRECATED_BUT_USED_INTERNALLY_INLINE'
wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
^
ProjectOptionsManipulator.cpp:1178:1: warning: 'virtual bool wxEvtHandler::TryValidator(wxEvent&)' is deprecated [-Wdeprecated-declarations]
...
I agree that setting WX_PRECOMP in any cbp files is NOT needed or wanted. But, remember for Windows we still need both headers sdk.h and sdk_precomp.h (might have misspelled the second one).Yes, there are still two gch files (sdk.h.gch and sdk_precomp.h.gch), and I think they are used to handle the __declspec (dllimport) and __declspec (dllexport) differences.
Edit: I think you are asking if we must include the wx PCH header inside sdk_common.h header; the answer is no; but, it tends to result in a few weird errors at times when Compiling CB against 3.0.x branch and 3.1.x master branch.OK, I understand, currently it looks like we still need to put "wx/wx.h" or "wx/wxprec.h" in c::b headers. seePrecompiled Headers - WxWiki (https://wiki.wxwidgets.org/Precompiled_Headers)
Most of the errors go away if we include wx/defs.h before any wx header inside the sdk_common.h header.
The rest would likely need to be fixed on a case by case basis.
If you want to do me a favour then please never use wx/wx.h at least. This is for the lazy bones that can't manage to properly include the minimal set of files really needed. I don't know why is there at all to be honest because it leads to bad behaviour.I agree that setting WX_PRECOMP in any cbp files is NOT needed or wanted. But, remember for Windows we still need both headers sdk.h and sdk_precomp.h (might have misspelled the second one).Yes, there are still two gch files (sdk.h.gch and sdk_precomp.h.gch), and I think they are used to handle the __declspec (dllimport) and __declspec (dllexport) differences.
But do we really need that? WIN32 - ld (https://sourceware.org/binutils/docs-2.17/ld/WIN32.html) says that we don't need to specify those import or export attribute.
1, I see that when bulding the sdk, we already have an option: "-Wl,--export-all-symbols", from the above document, this means all the symbols will be exported (whenever the symbol have dllexport or not)
2, I see that all target(either sdk or src or other plugins) have "-Wl,--enable-auto-import", this means the "ld" can handle the symbol import quit well
3, maybe, we need to add another linker option: "--enable-runtime-pseudo-relocs" to handle the import issue, as also statement in the ld document.
I haven't tried it yet, It's great if we can keep only one pch file.QuoteEdit: I think you are asking if we must include the wx PCH header inside sdk_common.h header; the answer is no; but, it tends to result in a few weird errors at times when Compiling CB against 3.0.x branch and 3.1.x master branch.OK, I understand, currently it looks like we still need to put "wx/wx.h" or "wx/wxprec.h" in c::b headers. seePrecompiled Headers - WxWiki (https://wiki.wxwidgets.org/Precompiled_Headers)
Most of the errors go away if we include wx/defs.h before any wx header inside the sdk_common.h header.
The rest would likely need to be fixed on a case by case basis.
QuoteEdit: I think you are asking if we must include the wx PCH header inside sdk_common.h header; the answer is no; but, it tends to result in a few weird errors at times when Compiling CB against 3.0.x branch and 3.1.x master branch.OK, I understand, currently it looks like we still need to put "wx/wx.h" or "wx/wxprec.h" in c::b headers. seePrecompiled Headers - WxWiki (https://wiki.wxwidgets.org/Precompiled_Headers)
Most of the errors go away if we include wx/defs.h before any wx header inside the sdk_common.h header.
The rest would likely need to be fixed on a case by case basis.
I don't see it is an issue, what I mean is that wxprec.h may contains a lot of wx related headers(actually all the wx related headers are in wx.h included in wxprec.h) which we do not need in C::B, so we can directly include those wx related headers in C::B header. That's what you said below:QuoteEdit: I think you are asking if we must include the wx PCH header inside sdk_common.h header; the answer is no; but, it tends to result in a few weird errors at times when Compiling CB against 3.0.x branch and 3.1.x master branch.OK, I understand, currently it looks like we still need to put "wx/wx.h" or "wx/wxprec.h" in c::b headers. seePrecompiled Headers - WxWiki (https://wiki.wxwidgets.org/Precompiled_Headers)
Most of the errors go away if we include wx/defs.h before any wx header inside the sdk_common.h header.
The rest would likely need to be fixed on a case by case basis.
I read the stuff on the Link twice; I have no idea why you think it relates to this issue.
We in Code::Blocks under windows are never using a real PCH version of wxprec.h.
We do use a real PCH version of sdk.h and sdk_precomp.h; but, not as often as we should be.
Edit: I have already about a year ago removed the wxprec.h from sdk_common.h and I needed to add wx/defs.h as the first wx header in sdk_common.h. I then needed to fix about an dozen places building under Windows that resulted in compiling or linking errors.Agree, if we remove wxprec.h from sdk_common.h, we should also NOT put wx/wx.h in sdk_common.h.
Edit2: Remember to NOT define WX_PRECOMP in either the CB Projects or sdk_common.h.
Edit3: If you do NOT wish to fix the dozen places; you could just make a header based on wxprec.h from wx2.8 and wx3.0.
It would be a blend of the two headers; but, it would NOT include wx/wx.h and be included in sdk_common.h before including any wx headers.
Tim S.
/////////////////////////////////////////////////////////////////////////////
// Name: wx_wrap_win_headers.h
// Purpose: Includes the appropriate headers to avoid errors
// Based on the wx/wxprec.h header created by Julian Smart
// Author: Tim S.
// Modified by:
// Created: 2015-10-05
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_WRAP_WIN_HEADERS_H
#define WX_WRAP_WIN_HEADERS_H
#include <wx/defs.h> // Multiple wx headers error out without this include before them.
#include <wx/version.h> // Needed for wxCHECK_VERSION
// include the header that defines UNICODE macro correctly
// _before_ including <windows.h>
#if wxCHECK_VERSION(2, 9, 0)
#include <wx/chartype.h>
#else
#include <wx/wxchar.h>
#endif
// include standard Windows headers
#if defined(__WINDOWS__)
#include <wx/msw/wrapwin.h>
#include <wx/msw/private.h>
#endif
#if defined(__WXMSW__)
#include <wx/msw/wrapcctl.h>
#include <wx/msw/wrapcdlg.h>
#include <wx/msw/missing.h>
#endif
#endif // WX_WRAP_WIN_HEADERS_H
I agree that setting WX_PRECOMP in any cbp files is NOT needed or wanted. But, remember for Windows we still need both headers sdk.h and sdk_precomp.h (might have misspelled the second one).Yes, there are still two gch files (sdk.h.gch and sdk_precomp.h.gch), and I think they are used to handle the __declspec (dllimport) and __declspec (dllexport) differences.
But do we really need that? WIN32 - ld (https://sourceware.org/binutils/docs-2.17/ld/WIN32.html) says that we don't need to specify those import or export attribute.
1, I see that when bulding the sdk, we already have an option: "-Wl,--export-all-symbols", from the above document, this means all the symbols will be exported (whenever the symbol have dllexport or not)
2, I see that all target(either sdk or src or other plugins) have "-Wl,--enable-auto-import", this means the "ld" can handle the symbol import quit well
3, maybe, we need to add another linker option: "--enable-runtime-pseudo-relocs" to handle the import issue, as also statement in the ld document.
I haven't tried it yet, It's great if we can keep only one pch file.
#ifndef EXAMPLE_DLL_H
#define EXAMPLE_DLL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef NOPORT
#define EXAMPLE_DLL
#else
#ifdef BUILDING_EXAMPLE_DLL
#define EXAMPLE_DLL __declspec(dllexport)
#else
#define EXAMPLE_DLL __declspec(dllimport)
#endif
#endif
void __stdcall EXAMPLE_DLL hello(const char *s);
int EXAMPLE_DLL Double(int x);
#ifdef __cplusplus
}
#endif
// NOTE: this function is not declared extern "C"
void EXAMPLE_DLL CppFunc(void);
// NOTE: this class must not be declared extern "C"
class EXAMPLE_DLL MyClass
{
public:
MyClass() {};
virtual ~MyClass() {};
void func(void);
};
#endif // EXAMPLE_DLL_H
#include <stdio.h>
#include "example_dll.h"
__stdcall void hello(const char *s)
{
printf("Hello %s\n", s);
}
int Double(int x)
{
return 2 * x;
}
void CppFunc(void)
{
puts("CppFunc");
}
void MyClass::func(void)
{
puts("MyClass.func()");
}
#include <stdio.h>
#include "example_dll.h"
int main(void)
{
hello("World");
printf("%d\n", Double(333));
CppFunc();
MyClass a;
a.func();
return 0;
}
D:\test\test-dll>g++ -c -DNOPORT example_dll.cpp
D:\test\test-dll>g++ -shared -o example_dll.dll example_dll.o -Wl,--export-all-symbols
D:\test\test-dll>g++ -c -DNOPORT example_exe.cpp
D:\test\test-dll>g++ -o example_exe.exe example_exe.o -L. -lexample_dll
D:\test\test-dll>example_exe.exe
Hello World
666
CppFunc
MyClass.func()
D:\test\test-dll>
#ifndef SDK_H
#define SDK_H
#include <stdio.h>
#include "example_dll.h"
#endif // SDK_H
#include "sdk.h"
D:\test\test-dll>g++ -c -DNOPORT sdk.h
D:\test\test-dll>g++ -c -DNOPORT example_dll.cpp -Winvalid-pch -include sdk.h
D:\test\test-dll>g++ -shared -o example_dll.dll example_dll.o -Wl,--export-all-symbols
D:\test\test-dll>g++ -c -DNOPORT example_dll.cpp -Winvalid-pch -include sdk.h
D:\test\test-dll>g++ -o example_exe.exe example_exe.o -L. -lexample_dll
D:\test\test-dll>example_exe.exe
Hello World
666
CppFunc
MyClass.func()
D:\test\test-dll>dir
Volume in drive D has no label.
Volume Serial Number is 0006-7EF2
Directory of D:\test\test-dll
2015-10-06 10:23 <DIR> .
2015-10-06 10:23 <DIR> ..
2015-09-27 09:52 89 env.bat
2015-10-06 10:16 260 example_dll.cpp
2015-10-06 10:23 41,773 example_dll.dll
2015-10-06 09:44 718 example_dll.h
2015-10-06 10:23 1,157 example_dll.o
2015-10-06 10:16 185 example_exe.cpp
2015-10-06 10:23 50,196 example_exe.exe
2015-10-06 09:48 3,197 example_exe.o
2015-10-06 10:17 91 sdk.h
2015-10-06 10:20 1,577,668 sdk.h.gch
10 File(s) 1,675,334 bytes
2 Dir(s) 23,734,190,080 bytes free
D:\test\test-dll>
EXPORT_LIB
EXPORT_EVENTS
WXMAKINGDLL_SCI
Now, I did some test in codeblocks_wx30.cbp
1, I remove the "src\.objs30\include\sdk.h.gch", so the folder only contains "sdk_precomp.h.gch", note that the first one was create when we build the src target(codeblocks.exe), and the later one is generated when we build the sdk target(codeblocks.dll).
2, select the "sdk.h" from the project manager panel, and right click to open the "property" dialog, and uncheck the "compile file" option.
3, copy the build option from sdk to src, that is: remove the "BUILDING_PLUGIN", and add those:CodeEXPORT_LIB
EXPORT_EVENTS
WXMAKINGDLL_SCI
4, rebuild the target src(codeblocks.exe), and I see it build successfully, great! This means both the codeblocks.exe and codeblocks.dll now share the same pch file "sdk_precomp.h.gch".
I will see I can built any plugin dll later. :)
EDIT:
Good, with the same change to other C::B plugin target, I can also build them successfully, also the build C::B runs OK.
1. Did you make sure the warning "-Winvalid-pch" is set?Yes, this option is on the project level.
2. Is the include of the PCH the first include in the file?I think I have made some mistakes, it looks like the "non pch version of the header file" is used here, but "-Winvalid-pch" never show a warning about this, I will look into it.
3. Is the path to the PCH header include before the NON PCH version of the header.
#error "non pch file is used!!!"
/*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*/
/** Code::Blocks SDK precompiled headers support for plugins.
* This is precompiled with -DBUILDING_PLUGIN
*/
#ifndef SDK_H
#define SDK_H
//#ifdef __WXMSW__
// #include "sdk_common.h"
//#else
// for non-windows platforms, one PCH is enough
#include "sdk_precomp.h"
//#endif
#endif // SDK_H
A precompiled header can't be used once the first C token is seen. You can have preprocessor directives before a precompiled header; you cannot include a precompiled header from inside another header.The strange thing is: if I move the "sdk_precomp.h.gch" from the ".objs30/include" folder, and leave the dummy "sdk_precomp.h" in that folder, then rebuild a plugin, I see the build success. I think it should report an error from the dummy header.
-------------- Clean: Autosave in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
Cleaned "Code::Blocks wx3.0.x - Autosave"
-------------- Build: Autosave in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 50.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -c plugins\autosave\autosave.cpp -o .objs30\plugins\autosave\autosave.o
[100.0%] g++.exe -shared -Wl,--dll -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 .objs30\plugins\autosave\autosave.o -o devel30\share\CodeBlocks\plugins\autosave.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -mthreads -lcodeblocks -lwxmsw30ud
Output file is devel30\share\CodeBlocks\plugins\autosave.dll with size 798.93 KB
[ 50.0%] Running target post-build steps
[100.0%] cmd /c if not exist devel30\share\CodeBlocks mkdir devel30\share\CodeBlocks
zip -jq9 devel30\share\CodeBlocks\autosave.zip plugins\autosave\manifest.xml plugins\autosave\*.xrc
Process terminated with status 0 (0 minute(s), 6 second(s))
0 error(s), 0 warning(s) (0 minute(s), 6 second(s))
-include "sdk_precomp.h"
-------------- Clean: Autosave in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
Cleaned "Code::Blocks wx3.0.x - Autosave"
-------------- Build: Autosave in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 50.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -include "sdk_precomp.h" -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -c plugins\autosave\autosave.cpp -o .objs30\plugins\autosave\autosave.o
In file included from <command-line>:0:0:
.objs30\include/sdk_precomp.h:1:2: error: #error "non pch file is used!!!"
#error "non pch file is used!!!"
^
Process terminated with status 1 (0 minute(s), 4 second(s))
1 error(s), 0 warning(s) (0 minute(s), 4 second(s))
-------------- Build: Autosave in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 50.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -include "sdk_precomp.h" -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -c plugins\autosave\autosave.cpp -o .objs30\plugins\autosave\autosave.o
[100.0%] g++.exe -shared -Wl,--dll -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 .objs30\plugins\autosave\autosave.o -o devel30\share\CodeBlocks\plugins\autosave.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -mthreads -lcodeblocks -lwxmsw30ud
Output file is devel30\share\CodeBlocks\plugins\autosave.dll with size 798.93 KB
[ 50.0%] Running target post-build steps
[100.0%] cmd /c if not exist devel30\share\CodeBlocks mkdir devel30\share\CodeBlocks
zip -jq9 devel30\share\CodeBlocks\autosave.zip plugins\autosave\manifest.xml plugins\autosave\*.xrc
Process terminated with status 0 (0 minute(s), 2 second(s))
0 error(s), 0 warning(s) (0 minute(s), 2 second(s))
<Unit filename="include/sdk.h">
<Option compile="1" />
<Option weight="1" />
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk_common.h">
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk_events.h">
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk_precomp.h">
<Option compile="1" />
<Option weight="0" />
<Option target="sdk" />
</Unit>
FYI: In Windows MinGW GCC a PCH only works inside of a real source file (headers files do NOT count).I didn't see the weird error till now. :)
In other words, a header can never include a real PCH file.
Edit: If on the command line you include a real PCH file like doing [-incude "sdk.h"] you will get a error normally if a header file in the project also includes that same PCH header of "sdk.h"; it a weird error message that I forgot what it says.
Edit2: You will have to put guards around the includes inside some source files around includes of the PCH; never tried the guards around the includes in header files since they needed to be removed I just removed them.As I said, the modified "sdk.h" I use was like below:
Tim S.
#ifndef SDK_H
#define SDK_H
#include "sdk_precomp.h"
#endif // SDK_H
#ifndef SDK_H
#define SDK_H
#ifndef SDK_PRECOMP_H
#include "sdk_precomp.h"
#endif
#endif // SDK_H
FYI: In Windows MinGW GCC a PCH only works inside of a real source file (headers files do NOT count).I didn't see the weird error till now. :)
In other words, a header can never include a real PCH file.
Edit: If on the command line you include a real PCH file like doing [-incude "sdk.h"] you will get a error normally if a header file in the project also includes that same PCH header of "sdk.h"; it a weird error message that I forgot what it says.QuoteEdit2: You will have to put guards around the includes inside some source files around includes of the PCH; never tried the guards around the includes in header files since they needed to be removed I just removed them.As I said, the modified "sdk.h" I use was like below:
Tim S.CodeDo you mean, I should wrote something like:#ifndef SDK_H
#define SDK_H
#include "sdk_precomp.h"
#endif // SDK_HCode#ifndef SDK_H
#define SDK_H
#ifndef SDK_PRECOMP_H
#include "sdk_precomp.h"
#endif
#endif // SDK_H
Ideally, if we share a single pch file for all dlls and exes, we need only one header file(which is included in source files for all sdk, dll targets), such as "sdk.h", "sdk_precomp.h" is not needed here.
Hi, Tim, I am using "-include "sdk_precomp.h"", not using "-include "sdk.h"", since I have only one pch file named "sdk_precomp.h.gch".
Sent from my phone.(sorry I cannot enter too much words)
Glad to hear, and this is the patch I made to use single PCH files. Please note that if you use a release version of wxWidgets 3, you do not need to change the Variable WX_SUFFIX from u to ud.Hi, Tim, I am using "-include "sdk_precomp.h"", not using "-include "sdk.h"", since I have only one pch file named "sdk_precomp.h.gch".
Sent from my phone.(sorry I cannot enter too much words)
Good, that means you will only need to fix the code in the SDK folders instead of all the plugins.
I might try doing the same and see what errors I get when I have the time and energy.
Tim S.
src/CodeBlocks_wx30.cbp | 83 +++++++++++++++++++++++++++++++++++++++----------
src/include/sdk.h | 8 ++---
2 files changed, 70 insertions(+), 21 deletions(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 3f63122..ac09ab1 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -168,7 +168,10 @@
<Option parameters="--debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen --verbose -p debug" />
<Option projectLinkerOptionsRelation="2" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/scripting/include" />
<Add directory="include/scripting/sqplus" />
@@ -226,7 +229,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/scripting/include" />
<Add directory="include/scripting/sqplus" />
@@ -260,7 +266,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add option="-DASTYLE_LIB" />
<Add directory="include" />
<Add directory="plugins/astyle/astyle" />
@@ -293,7 +302,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -338,7 +350,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="plugins/compilergcc/depslib/src" />
<Add directory="include/scripting/include" />
@@ -377,7 +392,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/scripting/include" />
<Add directory="include/scripting/sqplus" />
@@ -410,7 +428,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add option="-DCC_NO_COLLAPSE_ITEM" />
<Add directory="include" />
<Add directory="include/mozilla_chardet" />
@@ -448,7 +469,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -479,7 +503,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -510,7 +537,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -541,7 +571,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -572,7 +605,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/mozilla_chardet" />
<Add directory="include/mozilla_chardet/mfbt" />
@@ -609,7 +645,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/scripting/include" />
<Add directory="include/scripting/sqplus" />
@@ -642,7 +681,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
<Add directory="include/mozilla_chardet" />
<Add directory="include/mozilla_chardet/mfbt" />
@@ -679,7 +721,10 @@
<Option run_host_application_in_terminal="0" />
<Option projectLinkerOptionsRelation="1" />
<Compiler>
- <Add option="-DBUILDING_PLUGIN" />
+ <Add option='-include "sdk_precomp.h"' />
+ <Add option="-DEXPORT_LIB" />
+ <Add option="-DEXPORT_EVENTS" />
+ <Add option="-DWXMAKINGDLL_SCI" />
<Add directory="include" />
</Compiler>
<Linker>
@@ -700,7 +745,7 @@
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
- <Variable name="WX_SUFFIX" value="u" />
+ <Variable name="WX_SUFFIX" value="ud" />
<Variable name="WX_VERSION" value="30" />
</Environment>
</Build>
@@ -716,11 +761,14 @@
<Add option="-mthreads" />
<Add option="-fmessage-length=0" />
<Add option="-fexceptions" />
+ <Add option="-Winvalid-pch" />
+ <Add option="-Wno-deprecated-declarations" />
<Add option="-DHAVE_W32API_H" />
<Add option="-D__WXMSW__" />
<Add option="-DWXUSINGDLL" />
<Add option="-DcbDEBUG" />
- <Add option="-DNOPCH" />
+ <Add option="-DCB_PRECOMP" />
+ <Add option="-DWX_PRECOMP" />
<Add option="-DwxUSE_UNICODE" />
<Add directory="$(#WX30.include)" />
<Add directory="$(#WX30.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
@@ -1272,6 +1320,7 @@
<Option target="sdk" />
</Unit>
<Unit filename="include/sdk_precomp.h">
+ <Option compile="1" />
<Option weight="0" />
<Option target="sdk" />
</Unit>
diff --git a/src/include/sdk.h b/src/include/sdk.h
index 46361c7..bfff9f6 100644
--- a/src/include/sdk.h
+++ b/src/include/sdk.h
@@ -10,11 +10,11 @@
#ifndef SDK_H
#define SDK_H
-#ifdef __WXMSW__
- #include "sdk_common.h"
-#else
+//#ifdef __WXMSW__
+// #include "sdk_common.h"
+//#else
// for non-windows platforms, one PCH is enough
#include "sdk_precomp.h"
-#endif
+//#endif
#endif // SDK_H
I am NOT going to use your patch; because the CBP changes is too complex for what I think you are trying to do.Yes, I agree, if all the symbols which need to be exported are marked as "__declspec(dllexport)", we can safely remove the "-Wl,--export-all-symbols" linker option.
I think the use of "-Wl,--export-all-symbols" is a bad idea; but, it does have tradeoffs that are worth trying.
So, I am going to make a patch that does what I think you wish to do; and you can look at it and test it.
The bad effects that I think go along with using "-Wl,--export-all-symbols" are:
1. It can increase code coupling by accident. It can result is code you wish to be private/protected being more exposed.
2. It increases the size of the DLL file.
3. It likely results in greater ABI changes than are needed.
The good effect
1. It can make it simpler to make windows DLL.
Tim S.
What are the link errors and why does it work with 2.8?1, undefined reference to some symbol name.
src/CodeBlocks_wx30.cbp | 1 -
src/include/cbexception.h | 2 +-
src/include/cbstyledtextctrl.h | 2 +-
src/include/editorcolourset.h | 2 +-
src/include/filemanager.h | 4 ++--
src/include/manager.h | 2 +-
src/include/scrollingdialog.h | 2 +-
src/include/xtra_res.h | 4 ++--
src/sdk/scrollingdialog.cpp | 3 ++-
9 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index ac09ab1..5a304dd 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -136,7 +136,6 @@
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base" />
- <Add option="-Wl,--export-all-symbols" />
<Add option="-Wl,--add-stdcall-alias" />
<Add option="-Wl,--enable-auto-import" />
<Add option="-Wl,--no-undefined" />
diff --git a/src/include/cbexception.h b/src/include/cbexception.h
index 2044dd9..bfa91bc 100644
--- a/src/include/cbexception.h
+++ b/src/include/cbexception.h
@@ -20,7 +20,7 @@ cbThrow() and cbAssert().
*/
/** @brief The base Code::Blocks exception object. */
-class cbException
+class DLLIMPORT cbException
{
public:
cbException(const wxString& msg, const wxString& file, int line);
diff --git a/src/include/cbstyledtextctrl.h b/src/include/cbstyledtextctrl.h
index 55835a3..77c3d78 100644
--- a/src/include/cbstyledtextctrl.h
+++ b/src/include/cbstyledtextctrl.h
@@ -17,7 +17,7 @@ class wxFocusEvent;
class wxMouseEvent;
class wxPoint;
-class cbStyledTextCtrl : public wxScintilla
+class DLLIMPORT cbStyledTextCtrl : public wxScintilla
{
public:
cbStyledTextCtrl(wxWindow* pParent, int id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
diff --git a/src/include/editorcolourset.h b/src/include/editorcolourset.h
index a6573bd..e79ddac 100644
--- a/src/include/editorcolourset.h
+++ b/src/include/editorcolourset.h
@@ -73,7 +73,7 @@ struct OptionSet
};
WX_DECLARE_STRING_HASH_MAP(OptionSet, OptionSetsMap);
-class EditorColourSet
+class DLLIMPORT EditorColourSet
{
public:
EditorColourSet(const wxString& setName = COLORSET_DEFAULT);
diff --git a/src/include/filemanager.h b/src/include/filemanager.h
index 343c087..6d80f04 100644
--- a/src/include/filemanager.h
+++ b/src/include/filemanager.h
@@ -28,7 +28,7 @@ namespace TinyXML{ bool SaveDocument(const wxString&, TiXmlDocument*); }
// ***** class: LoaderBase *****
-class LoaderBase : public AbstractJob
+class DLLIMPORT LoaderBase : public AbstractJob
{
wxSemaphore sem;
bool wait;
@@ -109,7 +109,7 @@ public:
};
// ***** class: FileManager *****
-class FileManager : public Mgr<FileManager>
+class DLLIMPORT FileManager : public Mgr<FileManager>
{
BackgroundThread fileLoaderThread;
BackgroundThread uncLoaderThread;
diff --git a/src/include/manager.h b/src/include/manager.h
index 7dfe827..cd0cb30 100644
--- a/src/include/manager.h
+++ b/src/include/manager.h
@@ -179,7 +179,7 @@ private:
cbSearchResultsLog *m_SearchResultLog;
};
-template <class MgrT> class Mgr
+template <class MgrT> class DLLIMPORT Mgr
{
static MgrT *instance;
static bool isShutdown;
diff --git a/src/include/scrollingdialog.h b/src/include/scrollingdialog.h
index 33725fe..072d578 100644
--- a/src/include/scrollingdialog.h
+++ b/src/include/scrollingdialog.h
@@ -159,7 +159,7 @@ protected:
* A class that makes its content scroll if necessary
*/
-class wxScrollingDialog: public wxDialog
+class DLLIMPORT wxScrollingDialog: public wxDialog
#if !wxCHECK_VERSION(2,9,0)
, public wxDialogHelper
#endif
diff --git a/src/include/xtra_res.h b/src/include/xtra_res.h
index b8848d5..35494e3 100644
--- a/src/include/xtra_res.h
+++ b/src/include/xtra_res.h
@@ -13,7 +13,7 @@
class wxXmlResourceHandler;
-class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
+class DLLIMPORT wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
{
public:
wxToolBarAddOnXmlHandler();
@@ -30,7 +30,7 @@ class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
wxSize size = wxDefaultSize);
};
-class wxScrollingDialogXmlHandler : public wxDialogXmlHandler
+class DLLIMPORT wxScrollingDialogXmlHandler : public wxDialogXmlHandler
{
DECLARE_DYNAMIC_CLASS(wxScrollingDialogXmlHandler)
diff --git a/src/sdk/scrollingdialog.cpp b/src/sdk/scrollingdialog.cpp
index e847775..cef22e8 100644
--- a/src/sdk/scrollingdialog.cpp
+++ b/src/sdk/scrollingdialog.cpp
@@ -8,8 +8,9 @@
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////
+#include "sdk_precomp.h"
+
-#include "wx/wx.h"
#include "wx/module.h"
#include "wx/display.h"
#include "wx/bookctrl.h"
[100.0%] g++.exe -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 -Lexchndl\win32\lib -o devel30\codeblocks.exe .objs30\src\app.o .objs30\src\appglobals.o .objs30\src\associations.o .objs30\src\backtracedlg.o .objs30\src\breakpointsdlg.o .objs30\src\compilersettingsdlg.o .objs30\src\cpuregistersdlg.o .objs30\src\crashhandler.o .objs30\src\debugger_interface_creator.o .objs30\src\debuggermenu.o .objs30\src\debuggersettingscommonpanel.o .objs30\src\debuggersettingsdlg.o .objs30\src\debuggersettingspanel.o .objs30\src\disassemblydlg.o .objs30\src\dlgabout.o .objs30\src\dlgaboutplugin.o .objs30\src\editkeywordsdlg.o .objs30\src\editorconfigurationdlg.o .objs30\src\environmentsettingsdlg.o .objs30\src\examinememorydlg.o .objs30\src\find_replace.o .objs30\src\infopane.o .objs30\src\main.o .objs30\src\notebookstyles.o .objs30\src\printdlg.o .objs30\src\projectdepsdlg.o .objs30\src\projectmanagerui.o .objs30\src\projectoptionsdlg.o .objs30\src\recentitemslist.o .objs30\src\scriptconsole.o .objs30\src\scriptingsettingsdlg.o .objs30\src\splashscreen.o .objs30\src\startherepage.o .objs30\src\switcherdlg.o .objs30\src\threadsdlg.o .objs30\src\virtualbuildtargetsdlg.o .objs30\src\watchesdlg.o .objs30\src\resources\resources.res -Wl,--enable-auto-import -Wl,--no-undefined -lcodeblocks -lexchndl -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw30ud -mwindows
.objs30\src\crashhandler.o: In function `Z27CrashHandlerSaveEditorFilesR8wxString':
F:\cb_sf_git\trunk\src/src/crashhandler.cpp:62: undefined reference to `wxScintilla::GetText() const'
.objs30\src\debugger_interface_creator.o: In function `ZN21DebugInterfaceFactory16ShowValueTooltipERKNSt3tr110shared_ptrI7cbWatchEERK6wxRect':
F:\cb_sf_git\trunk\src/src/debugger_interface_creator.cpp:216: undefined reference to `wxScintilla::CallTipActive()'
.objs30\src\debuggermenu.o: In function `ZN19DebuggerMenuHandler13OnRunToCursorER14wxCommandEvent':
F:\cb_sf_git\trunk\src/src/debuggermenu.cpp:631: undefined reference to `wxScintilla::GetCurrentLine()'
F:\cb_sf_git\trunk\src/src/debuggermenu.cpp:631: undefined reference to `wxScintilla::GetLine(int) const'
F:\cb_sf_git\trunk\src/src/debuggermenu.cpp:643: undefined reference to `wxScintilla::GetCurrentLine()'
.objs30\src\debuggermenu.o: In function `ZN19DebuggerMenuHandler18OnSetNextStatementER14wxCommandEvent':
F:\cb_sf_git\trunk\src/src/debuggermenu.cpp:655: undefined reference to `wxScintilla::GetCurrentLine()'
.objs30\src\disassemblydlg.o: In function `ZN14DisassemblyDlgC2EP8wxWindow':
F:\cb_sf_git\trunk\src/src/disassemblydlg.cpp:55: undefined reference to `wxSCINameStr'
F:\cb_sf_git\trunk\src/src/disassemblydlg.cpp:55: undefined reference to `wxScintilla::wxScintilla(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
...
/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
/* Some example here */
#ifdef WXEXPORT
#pragma message(VAR_NAME_VALUE(WXEXPORT))
#else
#pragma message("WXEXPORT not defined")
#endif
-------------- Build: sdk in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 50.0%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswud -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c sdk\cbstyledtextctrl.cpp -o .objs30\sdk\cbstyledtextctrl.o
sdk\cbstyledtextctrl.cpp:551:45: note: #pragma message: WXEXPORT=
#pragma message(VAR_NAME_VALUE(WXEXPORT))
^
#ifdef WXMAKINGDLL_SCI
#define WXDLLIMPEXP_SCI WXEXPORT
#elif defined(WXUSINGDLL_SCI) || defined(WXUSINGDLL)
#define WXDLLIMPEXP_SCI WXIMPORT
#else // not making nor using DLL
#define WXDLLIMPEXP_SCI
#endif
...
...
...
class WXDLLIMPEXP_SCI wxScintilla : public wxControl {
public:
#ifdef SWIG
%pythonAppend wxScintilla "self._setOORInfo(self)"
%pythonAppend wxScintilla() ""
wxScintilla (wxWindow *parent, wxWindowID id=wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxPySCINameStr);
%RenameCtor(PreScintilla, wxScintilla());
#else
wxScintilla (wxWindow *parent, wxWindowID id=wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxSCINameStr);
wxScintilla() { m_swx = NULL; }
~wxScintilla();
#endif
...
#if defined(HAVE_VISIBILITY)
# define WXEXPORT __attribute__ ((visibility("default")))
# define WXIMPORT __attribute__ ((visibility("default")))
#elif defined(__WINDOWS__)
/*
__declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
as VC++.
*/
# if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
/*
While gcc also supports __declspec(dllexport), it creates unusably huge
DLL files since gcc 4.5 (while taking horribly long amounts of time),
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601. Because of this
we rely on binutils auto export/import support which seems to work
quite well for 4.5+.
*/
# elif defined(__GNUC__) && !wxCHECK_GCC_VERSION(4, 5)
/*
__declspec could be used here too but let's use the native
__attribute__ instead for clarity.
*/
# define WXEXPORT __attribute__((dllexport))
# define WXIMPORT __attribute__((dllimport))
# endif
#elif defined(__WXPM__)
# if defined (__WATCOMC__)
# define WXEXPORT __declspec(dllexport)
/*
__declspec(dllimport) prepends __imp to imported symbols. We do NOT
want that!
*/
# define WXIMPORT
# elif defined(__EMX__)
# define WXEXPORT
# define WXIMPORT
# elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
# define WXEXPORT _Export
# define WXIMPORT _Export
# endif
#elif defined(__CYGWIN__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
#endif
/* for other platforms/compilers we don't anything */
#ifndef WXEXPORT
# define WXEXPORT
# define WXIMPORT
#endif
...
elif defined(__GNUC__) && !wxCHECK_GCC_VERSION(4, 5)
/* for other platforms/compilers we don't anything */
#ifndef WXEXPORT
# define WXEXPORT
# define WXIMPORT
#endif
src/CodeBlocks_wx30.cbp | 1 -
src/include/cbexception.h | 2 +-
src/include/cbstyledtextctrl.h | 2 +-
src/include/editorcolourset.h | 2 +-
src/include/filemanager.h | 4 ++--
src/include/manager.h | 2 +-
src/include/scrollingdialog.h | 2 +-
src/include/xtra_res.h | 4 ++--
src/sdk/cbstyledtextctrl.cpp | 25 +++++++++++++++++++++++++
src/sdk/scrollingdialog.cpp | 3 ++-
src/sdk/wxscintilla/src/wxscintilla.cpp | 28 ++++++++++++++++++++++++++++
11 files changed, 64 insertions(+), 11 deletions(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index ac09ab1..5a304dd 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -136,7 +136,6 @@
</Compiler>
<Linker>
<Add option="-Wl,--enable-auto-image-base" />
- <Add option="-Wl,--export-all-symbols" />
<Add option="-Wl,--add-stdcall-alias" />
<Add option="-Wl,--enable-auto-import" />
<Add option="-Wl,--no-undefined" />
diff --git a/src/include/cbexception.h b/src/include/cbexception.h
index 2044dd9..bfa91bc 100644
--- a/src/include/cbexception.h
+++ b/src/include/cbexception.h
@@ -20,7 +20,7 @@ cbThrow() and cbAssert().
*/
/** @brief The base Code::Blocks exception object. */
-class cbException
+class DLLIMPORT cbException
{
public:
cbException(const wxString& msg, const wxString& file, int line);
diff --git a/src/include/cbstyledtextctrl.h b/src/include/cbstyledtextctrl.h
index 55835a3..77c3d78 100644
--- a/src/include/cbstyledtextctrl.h
+++ b/src/include/cbstyledtextctrl.h
@@ -17,7 +17,7 @@ class wxFocusEvent;
class wxMouseEvent;
class wxPoint;
-class cbStyledTextCtrl : public wxScintilla
+class DLLIMPORT cbStyledTextCtrl : public wxScintilla
{
public:
cbStyledTextCtrl(wxWindow* pParent, int id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
diff --git a/src/include/editorcolourset.h b/src/include/editorcolourset.h
index a6573bd..e79ddac 100644
--- a/src/include/editorcolourset.h
+++ b/src/include/editorcolourset.h
@@ -73,7 +73,7 @@ struct OptionSet
};
WX_DECLARE_STRING_HASH_MAP(OptionSet, OptionSetsMap);
-class EditorColourSet
+class DLLIMPORT EditorColourSet
{
public:
EditorColourSet(const wxString& setName = COLORSET_DEFAULT);
diff --git a/src/include/filemanager.h b/src/include/filemanager.h
index 343c087..6d80f04 100644
--- a/src/include/filemanager.h
+++ b/src/include/filemanager.h
@@ -28,7 +28,7 @@ namespace TinyXML{ bool SaveDocument(const wxString&, TiXmlDocument*); }
// ***** class: LoaderBase *****
-class LoaderBase : public AbstractJob
+class DLLIMPORT LoaderBase : public AbstractJob
{
wxSemaphore sem;
bool wait;
@@ -109,7 +109,7 @@ public:
};
// ***** class: FileManager *****
-class FileManager : public Mgr<FileManager>
+class DLLIMPORT FileManager : public Mgr<FileManager>
{
BackgroundThread fileLoaderThread;
BackgroundThread uncLoaderThread;
diff --git a/src/include/manager.h b/src/include/manager.h
index 7dfe827..cd0cb30 100644
--- a/src/include/manager.h
+++ b/src/include/manager.h
@@ -179,7 +179,7 @@ private:
cbSearchResultsLog *m_SearchResultLog;
};
-template <class MgrT> class Mgr
+template <class MgrT> class DLLIMPORT Mgr
{
static MgrT *instance;
static bool isShutdown;
diff --git a/src/include/scrollingdialog.h b/src/include/scrollingdialog.h
index 33725fe..072d578 100644
--- a/src/include/scrollingdialog.h
+++ b/src/include/scrollingdialog.h
@@ -159,7 +159,7 @@ protected:
* A class that makes its content scroll if necessary
*/
-class wxScrollingDialog: public wxDialog
+class DLLIMPORT wxScrollingDialog: public wxDialog
#if !wxCHECK_VERSION(2,9,0)
, public wxDialogHelper
#endif
diff --git a/src/include/xtra_res.h b/src/include/xtra_res.h
index b8848d5..35494e3 100644
--- a/src/include/xtra_res.h
+++ b/src/include/xtra_res.h
@@ -13,7 +13,7 @@
class wxXmlResourceHandler;
-class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
+class DLLIMPORT wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
{
public:
wxToolBarAddOnXmlHandler();
@@ -30,7 +30,7 @@ class wxToolBarAddOnXmlHandler : public wxXmlResourceHandler
wxSize size = wxDefaultSize);
};
-class wxScrollingDialogXmlHandler : public wxDialogXmlHandler
+class DLLIMPORT wxScrollingDialogXmlHandler : public wxDialogXmlHandler
{
DECLARE_DYNAMIC_CLASS(wxScrollingDialogXmlHandler)
diff --git a/src/sdk/cbstyledtextctrl.cpp b/src/sdk/cbstyledtextctrl.cpp
index 4e3d6c6..dc8d06b 100644
--- a/src/sdk/cbstyledtextctrl.cpp
+++ b/src/sdk/cbstyledtextctrl.cpp
@@ -8,6 +8,16 @@
*/
#include "sdk_precomp.h"
+
+// this workaround an issue that WXEXPORT is defined as empty, so that wxScintilla class is not
+// exported from the codeblocks.dll
+#ifdef __WINDOWS__
+ #ifdef WXEXPORT
+ #undef WXEXPORT
+ #define WXEXPORT __declspec(dllexport)
+ #endif // WXEXPORT
+#endif // __WINDOWS__
+
#include "cbstyledtextctrl.h"
#ifndef CB_PRECOMP
#include <wx/gdicmn.h> // for wxPoint
@@ -539,3 +549,18 @@ void cbStyledTextCtrl::MakeNearbyLinesVisible(int line)
else if (dist >= LinesOnScreen() - 2)
LineScroll(0, 3 + dist - LinesOnScreen());
}
+
+
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
+
+/* Some example here */
+#ifdef WXEXPORT
+ #pragma message(VAR_NAME_VALUE(WXEXPORT))
+#else
+ #pragma message("WXEXPORT not defined")
+#endif
+
+
diff --git a/src/sdk/scrollingdialog.cpp b/src/sdk/scrollingdialog.cpp
index e847775..cef22e8 100644
--- a/src/sdk/scrollingdialog.cpp
+++ b/src/sdk/scrollingdialog.cpp
@@ -8,8 +8,9 @@
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////
+#include "sdk_precomp.h"
+
-#include "wx/wx.h"
#include "wx/module.h"
#include "wx/display.h"
#include "wx/bookctrl.h"
diff --git a/src/sdk/wxscintilla/src/wxscintilla.cpp b/src/sdk/wxscintilla/src/wxscintilla.cpp
index ca79dd2..8f033c6 100644
--- a/src/sdk/wxscintilla/src/wxscintilla.cpp
+++ b/src/sdk/wxscintilla/src/wxscintilla.cpp
@@ -45,8 +45,36 @@
#endif
#include "ScintillaWX.h"
+
+
+// this workaround an issue that WXEXPORT is defined as empty, so that wxScintilla class is not
+// exported from the codeblocks.dll
+#ifdef __WINDOWS__
+ #ifdef WXEXPORT
+ #undef WXEXPORT
+ #define WXEXPORT __declspec(dllexport)
+ #else
+ #define WXEXPORT __declspec(dllexport)
+ #endif // WXEXPORT
+
+#endif // __WINDOWS__
+
+
+
#include "wx/wxscintilla.h"
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
+
+/* Some example here */
+#ifdef WXEXPORT
+ #pragma message(VAR_NAME_VALUE(WXEXPORT))
+#else
+ #pragma message("WXEXPORT not defined")
+#endif
+
#ifdef SCI_NAMESPACE
using namespace Scintilla;
#endif
The bad thing is, to solve this kind of error, I also need to add export decoration to squirrel library... :(What is the error related to squirrel?
When build the src target, I get such error:The bad thing is, to solve this kind of error, I also need to add export decoration to squirrel library... :(What is the error related to squirrel?
[100.0%] g++.exe -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 -Lexchndl\win32\lib -o devel30\codeblocks.exe .objs30\src\app.o .objs30\src\appglobals.o .objs30\src\associations.o .objs30\src\backtracedlg.o .objs30\src\breakpointsdlg.o .objs30\src\compilersettingsdlg.o .objs30\src\cpuregistersdlg.o .objs30\src\crashhandler.o .objs30\src\debugger_interface_creator.o .objs30\src\debuggermenu.o .objs30\src\debuggersettingscommonpanel.o .objs30\src\debuggersettingsdlg.o .objs30\src\debuggersettingspanel.o .objs30\src\disassemblydlg.o .objs30\src\dlgabout.o .objs30\src\dlgaboutplugin.o .objs30\src\editkeywordsdlg.o .objs30\src\editorconfigurationdlg.o .objs30\src\environmentsettingsdlg.o .objs30\src\examinememorydlg.o .objs30\src\find_replace.o .objs30\src\infopane.o .objs30\src\main.o .objs30\src\notebookstyles.o .objs30\src\printdlg.o .objs30\src\projectdepsdlg.o .objs30\src\projectmanagerui.o .objs30\src\projectoptionsdlg.o .objs30\src\recentitemslist.o .objs30\src\scriptconsole.o .objs30\src\scriptingsettingsdlg.o .objs30\src\splashscreen.o .objs30\src\startherepage.o .objs30\src\switcherdlg.o .objs30\src\threadsdlg.o .objs30\src\virtualbuildtargetsdlg.o .objs30\src\watchesdlg.o .objs30\src\resources\resources.res -Wl,--enable-auto-import -Wl,--no-undefined -lcodeblocks -lexchndl -lshfolder -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lcomctl32 -lodbc32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwxmsw30ud -mwindows
.objs30\src\main.o: In function `ZN12StackHandlerC1EP4SQVM':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelObject.h:105: undefined reference to `sq_gettop'
.objs30\src\main.o: In function `ZN12StackHandler15GetObjectHandleEi':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelObject.h:125: undefined reference to `sq_resetobject'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelObject.h:126: undefined reference to `sq_getstackobj'
.objs30\src\main.o: In function `ZN12StackHandler13GetInstanceUpEiPv':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelObject.h:149: undefined reference to `sq_getinstanceup'
.objs30\src\main.o: In function `ZN12StackHandler11GetUserDataEiPv':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelObject.h:158: undefined reference to `sq_getuserdata'
.objs30\src\main.o: In function `ZN10SquirrelVM8GetVMPtrEv':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/SquirrelVM.h:58: undefined reference to `SquirrelVM::_VM'
.objs30\src\main.o: In function `ZN6SqPlus6VarRefC1EPvNS_13ScriptVarTypeES1_PFvS1_S1_EiNS_13VarAccessTypeEPKc':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:307: undefined reference to `SquirrelVM::GetRootTable()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:307: undefined reference to `SquirrelObject::GetValue(char const*) const'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:308: undefined reference to `SquirrelObject::IsNull() const'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:309: undefined reference to `SquirrelVM::CreateTable()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:309: undefined reference to `SquirrelObject::operator=(SquirrelObject const&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:309: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:310: undefined reference to `SquirrelVM::GetRootTable()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:310: undefined reference to `SquirrelObject::SquirrelObject(SquirrelObject const&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:311: undefined reference to `SquirrelObject::SetValue(char const*, SquirrelObject const&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:310: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:313: undefined reference to `SquirrelObject::SetValue(int, char const*)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:307: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:309: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:310: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:307: undefined reference to `SquirrelObject::~SquirrelObject()'
.objs30\src\main.o: In function `ZN6SqPlus25createTableSetGetHandlersER14SquirrelObject':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:349: undefined reference to `SquirrelObject::GetDelegate()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:350: undefined reference to `SquirrelObject::Exists(char const*) const'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:351: undefined reference to `SquirrelVM::CreateTable()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:351: undefined reference to `SquirrelObject::operator=(SquirrelObject const&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:351: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:352: undefined reference to `SqPlus::setVarFunc(SQVM*)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:352: undefined reference to `SquirrelVM::CreateFunction(SquirrelObject&, int (*)(SQVM*), char const*, char const*)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:352: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:353: undefined reference to `SqPlus::getVarFunc(SQVM*)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:353: undefined reference to `SquirrelVM::CreateFunction(SquirrelObject&, int (*)(SQVM*), char const*, char const*)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:353: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:354: undefined reference to `SquirrelObject::SetDelegate(SquirrelObject&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:349: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:351: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:349: undefined reference to `SquirrelObject::~SquirrelObject()'
.objs30\src\main.o: In function `ZN6SqPlus12createVarRefER14SquirrelObjectPKc':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:361: undefined reference to `SquirrelObject::GetUserData(char const*, void**, void**)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:362: undefined reference to `SquirrelObject::NewUserData(char const*, int, void**)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:363: undefined reference to `SquirrelObject::GetUserData(char const*, void**, void**)'
.objs30\src\main.o: In function `ZN6SqPlus4PushEP4SQVMb':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1873: undefined reference to `sq_pushbool'
.objs30\src\main.o: In function `ZN6SqPlus5MatchENS_11TypeWrapperIbEEP4SQVMi':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1881: undefined reference to `sq_gettype'
.objs30\src\main.o: In function `ZN6SqPlus3GetENS_11TypeWrapperIbEEP4SQVMi':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1900: undefined reference to `sq_getbool'
.objs30\src\main.o: In function `ZN6SqPlus10SQClassDefI9MainFrameED1Ev':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1715: undefined reference to `SquirrelObject::~SquirrelObject()'
.objs30\src\main.o: In function `ZN6SqPlus11GetInstanceI8wxStringLb0EEEPT_P4SQVMi':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:532: undefined reference to `sq_getinstanceup'
.objs30\src\main.o: In function `ZN6SqPlus11GetInstanceI8wxStringLb1EEEPT_P4SQVMi':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:532: undefined reference to `sq_getinstanceup'
.objs30\src\main.o: In function `ZN6SqPlus10SQClassDefI9MainFrameEC1EPKcS4_':
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1727: undefined reference to `SquirrelObject::SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1729: undefined reference to `SquirrelObject::operator=(SquirrelObject const&)'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1729: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1729: undefined reference to `SquirrelObject::~SquirrelObject()'
F:\cb_sf_git\trunk\src/include/scripting/sqplus/sqplus.h:1727: undefined reference to `SquirrelObject::~SquirrelObject()'
Process terminated with status 1 (1 minute(s), 0 second(s))
50 error(s), 0 warning(s) (1 minute(s), 0 second(s))
This means, those symbols are not exported from codeblocks.dll. Actually, they are inside the squirrel related static library. So you see the symbols are in the static library, but they should be exported through the dll(dynamic library).Why do you think this is a good idea? I think it is not, because everybody linking to libsquirrel.a will export the symbols, which is bad.
In this case, the symbol should be marked as dllexport.
EDIT: after the change, the static library should be rebuild again.
This means, those symbols are not exported from codeblocks.dll. Actually, they are inside the squirrel related static library. So you see the symbols are in the static library, but they should be exported through the dll(dynamic library).Why do you think this is a good idea? I think it is not, because everybody linking to libsquirrel.a will export the symbols, which is bad.
In this case, the symbol should be marked as dllexport.
EDIT: after the change, the static library should be rebuild again.
Have you tried linking codeblocks.exe with libsquirrel.a and all the others?
I'm not sure about this, because other parts of the code use Squirrel APIs directly.I see that all plugins in Windows Codeblocks*.cbp only link to the codeblocks.dll, and not extra static library is need here.
-------------- Build: Compiler in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[100.0%] g++.exe -shared -Wl,--dll -Lbase\tinyxml -LD:\wx3\lib\gcc_dll -Ldevel30 -Lplugins\compilergcc\depslib .objs30\plugins\compilergcc\advancedcompileroptionsdlg.o .objs30\plugins\compilergcc\compiler_defs.o .objs30\plugins\compilergcc\compilerCYGWIN.o .objs30\plugins\compilergcc\compilererrors.o .objs30\plugins\compilergcc\compilerflagdlg.o .objs30\plugins\compilergcc\compilerG95.o .objs30\plugins\compilergcc\compilergcc.o .objs30\plugins\compilergcc\compilerGDC.o .objs30\plugins\compilergcc\compilerGNUARM.o .objs30\plugins\compilergcc\compilerGNUFortran.o .objs30\plugins\compilergcc\compilerIAR.o .objs30\plugins\compilergcc\compilerICC.o .objs30\plugins\compilergcc\compilerKeilC51.o .objs30\plugins\compilergcc\compilerLCC.o .objs30\plugins\compilergcc\compilermessages.o .objs30\plugins\compilergcc\compilerMINGW.o .objs30\plugins\compilergcc\compilerMINGWgenerator.o .objs30\plugins\compilergcc\compilerMSVC.o .objs30\plugins\compilergcc\compilerMSVC10.o .objs30\plugins\compilergcc\compilerMSVC8.o .objs30\plugins\compilergcc\compileroptionsdlg.o .objs30\plugins\compilergcc\compilerOW.o .objs30\plugins\compilergcc\compilerOWgenerator.o .objs30\plugins\compilergcc\compilerXML.o .objs30\plugins\compilergcc\directcommands.o -o devel30\share\CodeBlocks\plugins\compiler.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -mthreads -lcodeblocks -lwxmsw30ud -ldepslib
.objs30\plugins\compilergcc\advancedcompileroptionsdlg.o: In function `ZN26AdvancedCompilerOptionsDlgC2EP8wxWindowRK8wxString':
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:72: undefined reference to `RegExArray::~RegExArray()'
.objs30\plugins\compilergcc\advancedcompileroptionsdlg.o: In function `ZN26AdvancedCompilerOptionsDlgD2Ev':
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:82: undefined reference to `RegExArray::~RegExArray()'
F:\cb_sf_git\trunk\src/plugins/compilergcc/advancedcompileroptionsdlg.cpp:82: undefined reference to `RegExArray::~RegExArray()'
WX_DECLARE_OBJARRAY(RegExStruct, RegExArray);
WX_DECLARE_EXPORTED_OBJARRAY(RegExStruct, RegExArray);
#define WX_DECLARE_EXPORTED_OBJARRAY(T, name) \
WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, WXDLLIMPEXP_CORE)
#ifdef WXMAKINGDLL_CORE
# define WXDLLIMPEXP_CORE WXEXPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXEXPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_CORE WXIMPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXIMPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXIMPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#else /* not making nor using DLL */
# define WXDLLIMPEXP_CORE
# define WXDLLIMPEXP_DATA_CORE(type) type
# define WXDLLIMPEXP_INLINE_CORE
#endif
#if defined(HAVE_VISIBILITY)
# define WXEXPORT __attribute__ ((visibility("default")))
# define WXIMPORT __attribute__ ((visibility("default")))
#elif defined(__WINDOWS__)
/*
__declspec works in BC++ 5 and later, Watcom C++ 11.0 and later as well
as VC++.
*/
# if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
/*
While gcc also supports __declspec(dllexport), it creates unusably huge
DLL files since gcc 4.5 (while taking horribly long amounts of time),
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601. Because of this
we rely on binutils auto export/import support which seems to work
quite well for 4.5+.
*/
# elif defined(__GNUC__) && !wxCHECK_GCC_VERSION(4, 5)
/*
__declspec could be used here too but let's use the native
__attribute__ instead for clarity.
*/
# define WXEXPORT __attribute__((dllexport))
# define WXIMPORT __attribute__((dllimport))
# endif
#elif defined(__WXPM__)
# if defined (__WATCOMC__)
# define WXEXPORT __declspec(dllexport)
/*
__declspec(dllimport) prepends __imp to imported symbols. We do NOT
want that!
*/
# define WXIMPORT
# elif defined(__EMX__)
# define WXEXPORT
# define WXIMPORT
# elif (!(defined(__VISAGECPP__) && (__IBMCPP__ < 400 || __IBMC__ < 400 )))
# define WXEXPORT _Export
# define WXIMPORT _Export
# endif
#elif defined(__CYGWIN__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
#endif
/* for other platforms/compilers we don't anything */
#ifndef WXEXPORT
# define WXEXPORT
# define WXIMPORT
#endif
/*
While gcc also supports __declspec(dllexport), it creates unusably huge
DLL files since gcc 4.5 (while taking horribly long amounts of time),
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601. Because of this
we rely on binutils auto export/import support which seems to work
quite well for 4.5+.
*/
BTW: I see one issue is that some static library is stored in the folder "src\sdk\scripting\lib", this means they are shared with both codeblocks.cbp and codeblocks-wx30.cbp, this may cause some conflicts.This is not an issue, as the scripting lib is independent of wxWidgets. Thus, if you compile it with the same compiler it will result in the same binary. Its different for the 64 bit build though... but just not because wx30-64 bit but because the lib will be 64 bit then.
look at this,is there will be a wx3.02 and 64bit release?i don't know much,i complie wx3.02 use nuwen's mingw64 distro from nuwen.net or http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/dongsheng-daily/5.x/ this mingw64 build ,it work just fine,complie wx3.02 must use -std=gnu++11Hi, mageia, I don't think a wx 3.0.2 release soon, we are on the way of migration from wx2.8.x to wx 3.x, but there are issues need to be fixed here and there in our C::B source code.
OK, now the patches(git style patch serials) are in Code::Blocks / Tickets / #239 reduce exported symbols from codeblocks.dll (https://sourceforge.net/p/codeblocks/tickets/239/)
I mainly do the following things in those patches:
1, only one pch file is used to build C::B.
2, some symbols in static libraries(such as some symbols in sqplus) are marked as "dllexport", and he symbols are exported in codeblocks.dll. So that all the src and plugin target only need to link against codeblocks.dll. No need to link to those static library(such as sqplus.a).
(Note that also build wxWidgets 3.0.2 library with the change of only export the dllexport maked symbol, which reduce the dll size, see build wxWidgets dll without __declspec(dllexport) for MinGW target - Google Groups (https://groups.google.com/forum/?fromgroups#!topic/wx-users/BLeNygSYyx0) for more details.
Do you have any objections?Can you wait couple of days, so I can find some time to test them?
Can you wait couple of days, so I can find some time to test them?I am not even able to test them due to the format, unfortunately...
ollydbg: These patches fail to compile on linux (I've fixed it in the branch). Also they do stuff that they should not.Sure, I won't plan to push this commit to our svn repo. On my test, C::B crashes if it link to wx3 release library(build with g++ -O2) under Windows XP, so I have to use the debug version of wx3(build with g++ -O0).
Like:
1. The patch that changes the link to wx3-debug should not be pushed
2. Exporting functions/classes from tinyxml is wrong. Same for the other static libraries. Project needing the libs should link directly. Squirrel stuff was tricky, because of globals.Under Windows, all the static libraries are build with all symbol exported(Note this option is enabled by default), and later those symbols were exported through codeblocks.dll(the sdk target). That's the current way we have used for many years.
3. Why do you need the workaround commits? Just include the settings.h header?The macro "WXEXPORT" is defined as empty in wxWidgets header, which make all the symbols were exported from wxWidgets shared dll. (This issue is solved by a recent commit in wx's trunk https://groups.google.com/d/msg/wx-users/BLeNygSYyx0/-57vTa3CAwAJ (https://groups.google.com/d/msg/wx-users/BLeNygSYyx0/-57vTa3CAwAJ) I have mentioned before.
#ifndef SETTINGS_H
#define SETTINGS_H
/*
Exclude VC++, because it has silly constraints on importing/exporting classes
from DLLs. Instead, we build "sdk" as a static library
*/
#if defined(__WXMSW__)
#ifndef DLLIMPORT
#if defined(EXPORT_LIB)
#define DLLIMPORT __declspec (dllexport)
#else
#define DLLIMPORT __declspec (dllimport)
#endif // EXPORT_LIB
#endif // DLLIMPORT
#ifndef EVTIMPORT
#if defined(EXPORT_EVENTS)
#define EVTIMPORT __declspec (dllexport)
#else
#define EVTIMPORT __declspec (dllimport)
#endif // EXPORT_EVENTS
#endif // EVTIMPORT
#else
#define DLLIMPORT
#define EVTIMPORT
#endif
#endif // SETTINGS_H
Under Windows, all the static libraries are build with all symbol exported(Note this option is enabled by default), and later those symbols were exported through codeblocks.dll(the sdk target). That's the current way we have used for many years.Yes, I know and I say this is the wrong way to do it.
I have said that before in this thread. Those kinds of static libraries are quite similar as shared libraries. And you will see that all the plugins are only need to link the the codeblocks.dll, and they don't need static to link to tinyxml like libraries.
My change on those static libraries is that I use explicitly symbol export, which means all the symbols needed to export from the codeblocks.dll is need to be decorated as "__declspec(dllexport)", This reduce the export table of the codeblocks.dll, and make resolution of the symbols a bit faster.
As you suggested, we need to build them as static libraries, and we need to link them as static libraries. A lot of targets need those static libraries, for example, if some plugin need to access the configure file, then we need to link to the static version of the tinyxml library.Under Windows, all the static libraries are build with all symbol exported(Note this option is enabled by default), and later those symbols were exported through codeblocks.dll(the sdk target). That's the current way we have used for many years.Yes, I know and I say this is the wrong way to do it.
I have said that before in this thread. Those kinds of static libraries are quite similar as shared libraries. And you will see that all the plugins are only need to link the the codeblocks.dll, and they don't need static to link to tinyxml like libraries.
My change on those static libraries is that I use explicitly symbol export, which means all the symbols needed to export from the codeblocks.dll is need to be decorated as "__declspec(dllexport)", This reduce the export table of the codeblocks.dll, and make resolution of the symbols a bit faster.
All these libs have not been designed to be shared libraries.
If they are we should just build them as such and don't bother with all this trickery.
Also on linux using the default visibility can cause lots of problems and strange crashes.
Yes, adding DLLIMPORT to classes in the sdk or in the include folders is safe and I have no objections, so go on and commit them.Done in trunk. :)
Why do you need to export the InfoPane class?Oh, I see this is a mistake, no need to export the InfoPane class from the file /src/src/infopane.h. I don't see build errors when I remove DLLIMPORT in this file(test with my other patches). So, I will commit the fix soon. Thanks for point this out.
Also, I see some warnings from C::B source:Code-------------- Build: sdk in Code::Blocks wx3.0.x (compiler: GNU GCC Compiler)---------------
[ 0.8%] g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -Wno-deprecated-declarations -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -iquote.objs30\include -I.objs30\include -I. -ID:\wx3\include -ID:\wx3\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c include\sdk_precomp.h -o .objs30\include\sdk_precomp.h.gch
In file included from include\cbauibook.h:13:0,
from include\sdk_common.h:133,
from include\sdk_precomp.h:13:
D:\wx3\include/wx/aui/auibook.h:349:18: warning: 'virtual bool wxAuiNotebook::AddPage(wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
^
In file included from include\sdk_common.h:133:0,
from include\sdk_precomp.h:13:
include\cbauibook.h:141:14: warning: by 'bool cbAuiNotebook::AddPage(wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
bool AddPage(wxWindow* page,
^
In file included from include\cbauibook.h:13:0,
from include\sdk_common.h:133,
from include\sdk_precomp.h:13:
D:\wx3\include/wx/aui/auibook.h:352:18: warning: 'virtual bool wxAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, int)' was hidden [-Woverloaded-virtual]
virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
^
In file included from include\sdk_common.h:133:0,
from include\sdk_precomp.h:13:
include\cbauibook.h:156:14: warning: by 'bool cbAuiNotebook::InsertPage(size_t, wxWindow*, const wxString&, bool, const wxBitmap&)' [-Woverloaded-virtual]
bool InsertPage(size_t page_idx,
^
Maybe, we need to fix our C::B's source :)
class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
{
public:
...
/** \brief Add Page
*
* Calls the base-class function and after that
* MinmizeFreeSpace().
* \param page The page to add
* \param caption The caption of the page
* \param select If true the page gets selected
* \param bitmap The bitmap of the tab
* \return true if successfull
*/
bool AddPage(wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
...
class WXDLLIMPEXP_AUI wxAuiNotebook : public wxNavigationEnabled<wxBookCtrlBase>
{
public:
wxAuiNotebook() { Init(); }
wxAuiNotebook(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxAUI_NB_DEFAULT_STYLE)
{
Init();
Create(parent, id, pos, size, style);
}
virtual ~wxAuiNotebook();
bool Create(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0);
void SetWindowStyleFlag(long style);
void SetArtProvider(wxAuiTabArt* art);
wxAuiTabArt* GetArtProvider() const;
virtual void SetUniformBitmapSize(const wxSize& size);
virtual void SetTabCtrlHeight(int height);
bool AddPage(wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
bool InsertPage(size_t pageIdx,
wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
bool DeletePage(size_t page);
bool RemovePage(size_t page);
virtual size_t GetPageCount() const;
virtual wxWindow* GetPage(size_t pageIdx) const;
int GetPageIndex(wxWindow* pageWnd) const;
bool SetPageText(size_t page, const wxString& text);
wxString GetPageText(size_t pageIdx) const;
bool SetPageToolTip(size_t page, const wxString& text);
wxString GetPageToolTip(size_t pageIdx) const;
bool SetPageBitmap(size_t page, const wxBitmap& bitmap);
wxBitmap GetPageBitmap(size_t pageIdx) const;
int SetSelection(size_t newPage);
int GetSelection() const;
virtual void Split(size_t page, int direction);
const wxAuiManager& GetAuiManager() const { return m_mgr; }
// Sets the normal font
void SetNormalFont(const wxFont& font);
// Sets the selected tab font
void SetSelectedFont(const wxFont& font);
// Sets the measuring font
void SetMeasuringFont(const wxFont& font);
// Sets the tab font
virtual bool SetFont(const wxFont& font);
// Gets the tab control height
int GetTabCtrlHeight() const;
// Gets the height of the notebook for a given page height
int GetHeightForPageHeight(int pageHeight);
// Shows the window menu
bool ShowWindowMenu();
// we do have multiple pages
virtual bool HasMultiplePages() const { return true; }
// we don't want focus for ourselves
// virtual bool AcceptsFocus() const { return false; }
//wxBookCtrlBase functions
virtual void SetPageSize (const wxSize &size);
virtual int HitTest (const wxPoint &pt, long *flags=NULL) const;
virtual int GetPageImage(size_t n) const;
virtual bool SetPageImage(size_t n, int imageId);
virtual int ChangeSelection(size_t n);
virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
int imageId);
virtual bool DeleteAllPages();
virtual bool InsertPage(size_t index, wxWindow *page, const wxString &text,
bool select, int imageId);
bool AddPage(wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
and
virtual bool AddPage(wxWindow *page, const wxString &text, bool select,
int imageId);
In file included from D:\bat\data\program\gcc\codeblocks_clean\src\sdk\scrollingdialog.cpp:17:0:
include/scrollingdialog.h:162:34: error: expected initializer before ':' token
D:\bat\data\program\gcc\codeblocks_clean\src\src\infopane.cpp:39:1: error: definition of static data member 'InfoPane::sm_eventTable' of dllimport'd class
include/cbauibook.h:29:31: error: expected initializer before ':' token
..\..\..\include/cbstyledtextctrl.h:20:34: error: expected initializer before ':' token
I get clean version from SVN, build with Wx 2.8.12, mingw32-g++ (tdm-1) 4.7.1, it fail with :
it is awesome then only denpend on codeblocks.dll,i can't build 10561,link error about wx_MSLU_stat(?)Please give use details about your problem.
...You have to add a using directive for the function in the parent class. If our function does something special and using the original function is not a good idea you can put the using directive in the private/protected section.
Any one know how to remove such warning?
...
OK.As you suggested, we need to build them as static libraries, and we need to link them as static libraries. A lot of targets need those static libraries, for example, if some plugin need to access the configure file, then we need to link to the static version of the tinyxml library.Under Windows, all the static libraries are build with all symbol exported(Note this option is enabled by default), and later those symbols were exported through codeblocks.dll(the sdk target). That's the current way we have used for many years.Yes, I know and I say this is the wrong way to do it.
I have said that before in this thread. Those kinds of static libraries are quite similar as shared libraries. And you will see that all the plugins are only need to link the the codeblocks.dll, and they don't need static to link to tinyxml like libraries.
My change on those static libraries is that I use explicitly symbol export, which means all the symbols needed to export from the codeblocks.dll is need to be decorated as "__declspec(dllexport)", This reduce the export table of the codeblocks.dll, and make resolution of the symbols a bit faster.
All these libs have not been designed to be shared libraries.
If they are we should just build them as such and don't bother with all this trickery.
Also on linux using the default visibility can cause lots of problems and strange crashes.
Am I right?
If we see this is the correct direction, I may take some time to test it.
thanks reply,and here isit is awesome then only denpend on codeblocks.dll,i can't build 10561,link error about wx_MSLU_stat(?)Please give use details about your problem.
C:\localusr\wxWidgets\include\wx\filefn.h|522|undefined reference to `wxMSLU__wstat(wchar_t const*, _stat64*)'|MSLU ,wx use it on win9.x not later,isn't it,error happen when link codeblocks.dll,and i use nuwen's mingw64 to build wx3.02 and codeblocks 10561,enough information or not?
||error: ld returned 1 exit status|
Show us the full build log please. See:FAQ-Compiling (errors) - CodeBlocks (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)QuoteC:\localusr\wxWidgets\include\wx\filefn.h|522|undefined reference to `wxMSLU__wstat(wchar_t const*, _stat64*)'|MSLU ,wx use it on win9.x not later,isn't it,error happen when link codeblocks.dll,and i use nuwen's mingw64 to build wx3.02 and codeblocks 10561,enough information or not?
||error: ld returned 1 exit status|
...I see a crash here with the above patches:
OK.
I have done the patches, which let some plugins link to the static library. So the symbols in those static libraries are not exported from the codeblocks.dll, see the patches here: Link (https://sourceforge.net/p/codeblocks/tickets/239/#bd97)
[debug]> bt 30
[debug]#0 0x004c2f21 in sq_getprintfunc (v=0x0) at F:\cb_sf_git\trunk\src\sdk\scripting\squirrel\sqapi.cpp:1256
[debug]#1 0x0049e1cc in ScriptConsole::ScriptConsole (this=0x74587d8, parent=0x5a0bd00, id=-1) at F:\cb_sf_git\trunk\src\src\scriptconsole.cpp:116
[debug]#2 0x00451844 in MainFrame::CreateIDE (this=0x5a0bd00) at F:\cb_sf_git\trunk\src\src\main.cpp:756
[debug]#3 0x0044f847 in MainFrame::MainFrame (this=0x5a0bd00, parent=0x0) at F:\cb_sf_git\trunk\src\src\main.cpp:602
[debug]#4 0x00402a56 in CodeBlocksApp::InitFrame (this=0x587d4c0) at F:\cb_sf_git\trunk\src\src\app.cpp:489
[debug]#5 0x0040407b in CodeBlocksApp::OnInit (this=0x587d4c0) at F:\cb_sf_git\trunk\src\src\app.cpp:697
[debug]#6 0x004fb06e in wxAppConsoleBase::CallOnInit (this=0x587d4c0) at D:\wx3\include\wx\app.h:93
[debug]#7 0x6a00fbf0 in wxEntryReal (argc=@0x6abe53f8: 9, argv=0x587d150) at D:\wx3\src\common\init.cpp:479
[debug]#8 0x6a094b98 in wxEntry (argc=@0x6abe53f8: 9, argv=0x587d150) at D:\wx3\src\msw\main.cpp:197
[debug]#9 0x6a094e86 in wxEntry (hInstance=0x400000, nCmdShow=10) at D:\wx3\src\msw\main.cpp:415
[debug]#10 0x0040224d in WinMain@16 (hInstance=0x400000, hPrevInstance=0x0, nCmdShow=10) at F:\cb_sf_git\trunk\src\src\app.cpp:322
[debug]#11 0x0052ac9d in main ()
[debug]>>>>>>cb_gdb:
ScriptConsole::ScriptConsole(wxWindow* parent,wxWindowID id)
{
//(*Initialize(ScriptConsole)
wxBoxSizer* BoxSizer2;
wxBoxSizer* BoxSizer1;
Create(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("id"));
BoxSizer1 = new wxBoxSizer(wxVERTICAL);
txtConsole = new wxTextCtrl(this, ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL, wxDefaultValidator, _T("ID_TEXTCTRL1"));
wxFont txtConsoleFont(10,wxFONTFAMILY_MODERN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
txtConsole->SetFont(txtConsoleFont);
BoxSizer1->Add(txtConsole, 1, wxALL|wxEXPAND, 0);
Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
Panel1->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
BoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
lblCommand = new wxStaticText(Panel1, ID_STATICTEXT1, _("Command:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
BoxSizer2->Add(lblCommand, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
txtCommand = new wxComboBox(Panel1, ID_COMBOBOX1, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, 0, wxCB_DROPDOWN|wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_COMBOBOX1"));
wxFont txtCommandFont(10,wxFONTFAMILY_MODERN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,wxEmptyString,wxFONTENCODING_DEFAULT);
txtCommand->SetFont(txtCommandFont);
BoxSizer2->Add(txtCommand, 1, wxALL|wxALIGN_CENTER_VERTICAL, 0);
btnExecute = new wxBitmapButton(Panel1, ID_BITMAPBUTTON1, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_EXECUTABLE_FILE")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON1"));
btnExecute->SetToolTip(_("Execute current command"));
BoxSizer2->Add(btnExecute, 0, wxALIGN_CENTER_VERTICAL, 5);
btnLoad = new wxBitmapButton(Panel1, ID_BITMAPBUTTON2, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_FILE_OPEN")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON2"));
btnLoad->SetDefault();
btnLoad->SetToolTip(_("Load from file"));
BoxSizer2->Add(btnLoad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
btnClear = new wxBitmapButton(Panel1, ID_BITMAPBUTTON3, wxArtProvider::GetBitmap(wxART_MAKE_ART_ID_FROM_STR(_T("wxART_DELETE")),wxART_BUTTON), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW, wxDefaultValidator, _T("ID_BITMAPBUTTON3"));
btnClear->SetDefault();
btnClear->SetToolTip(_("Clear output window"));
BoxSizer2->Add(btnClear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 0);
Panel1->SetSizer(BoxSizer2);
BoxSizer2->Fit(Panel1);
BoxSizer2->SetSizeHints(Panel1);
BoxSizer1->Add(Panel1, 0, wxALL|wxEXPAND, 0);
SetSizer(BoxSizer1);
BoxSizer1->Fit(this);
BoxSizer1->SetSizeHints(this);
Connect(ID_COMBOBOX1,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&ScriptConsole::OnbtnExecuteClick);
Connect(ID_BITMAPBUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ScriptConsole::OnbtnExecuteClick);
Connect(ID_BITMAPBUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ScriptConsole::OnbtnLoadClick);
Connect(ID_BITMAPBUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ScriptConsole::OnbtnClearClick);
//*)
txtCommand->Append(wxEmptyString);
if (!s_Console)
{
s_Console = this;
s_OldPrintFunc = sq_getprintfunc(SquirrelVM::GetVMPtr());
sq_setprintfunc(SquirrelVM::GetVMPtr(), ScriptConsolePrintFunc);
}
Log(_("Welcome to the script console!"));
}
...I debugged for a while, and I found that the SquirrelVM::_VM is a static variable of the class.
I see that SquirrelVM::GetVMPtr() is 0 here.
class SquirrelVM
{
friend class SquirrelObject;
friend struct SquirrelError;
public:
// C::B patch: Add additional initilisation flags
static void Init(SquirrelInitFlags flags = sqifAll);
static BOOL_T IsInitialized(){return _VM == NULL?FALSE:TRUE;}
static void Shutdown();
static void Cleanup();
static BOOL_T Update(); //debugger and maybe GC later
static SquirrelObject CompileScript(const SQChar *s);
static SquirrelObject CompileBuffer(const SQChar *s,const SQChar * debugInfo=sqT("console_buffer"));
static SquirrelObject RunScript(const SquirrelObject &o,SquirrelObject *_this = NULL);
static void PrintFunc(HSQUIRRELVM v,const SQChar* s,...);
static BOOL_T BeginCall(const SquirrelObject &func);
static BOOL_T BeginCall(const SquirrelObject &func,SquirrelObject &_this);
static void PushParam(const SquirrelObject &o);
static void PushParam(const SQChar *s);
static void PushParam(SQInteger n);
static void PushParam(SQFloat f);
static void PushParam(SQUserPointer up);
static void PushParamNull();
static SquirrelObject EndCall();
static SquirrelObject CreateString(const SQChar *s);
static SquirrelObject CreateTable();
static SquirrelObject CreateArray(SQInteger size);
static SquirrelObject CreateInstance(SquirrelObject &oclass); // oclass is an existing class. Create an 'instance' (OT_INSTANCE) of oclass.
static SquirrelObject CreateFunction(SQFUNCTION func);
static SquirrelObject CreateUserData(SQInteger size);
static const SquirrelObject &GetRootTable();
static HSQUIRRELVM GetVMPtr() { return _VM; }
#if 0
static void SetVMPtr(HSQUIRRELVM v) {
_VM = v;
} // setVMPtr
#endif
static void GetVMSys(SquirrelVMSys & vmSys) {
vmSys._VM = _VM;
vmSys._root = _root;
} // GetVMSys
static void SetVMSys(const SquirrelVMSys & vmSys) {
_VM = vmSys._VM;
_root = vmSys._root;
} // SetVMSys
static void PushValue(INT_T val) {
sq_pushinteger(_VM,val);
} // PushValue
static void PushValue(FLOAT_T val) {
sq_pushfloat(_VM,val);
} // PushValue
static void PushValue(bool val) { // Compiler treats SQBool as INT_T.
sq_pushbool(_VM,val);
} // PushValue
static void PushValue(SQChar * val) {
sq_pushstring(_VM,val,-1);
} // PushValue
static void PushValue(SQUserPointer val) {
sq_pushuserpointer(_VM,val);
} // PushValue
static void PushValue(const SQChar * val) {
sq_pushstring(_VM,val,-1);
} // PushValue
static void PushObject(SquirrelObject & so) {
sq_pushobject(_VM,so._o);
} // PushObject
static void Pop(SQInteger nelemstopop) {
sq_pop(_VM,nelemstopop);
} // Pop
static void PushRootTable(void);
// Create/bind a function on the table currently on the stack.
static SquirrelObject CreateFunction(SQFUNCTION func,const SQChar * scriptFuncName,const SQChar * typeMask=0);
// Create/bind a function on the table so. typeMask: standard Squirrel types plus: no typemask means no args, "*" means any type of args.
static SquirrelObject CreateFunction(SquirrelObject & so,SQFUNCTION func,const SQChar * scriptFuncName,const SQChar * typeMask=0);
// Create/bind a function to the root table. typeMask: standard Squirrel types plus: no typemask means no args, "*" means any type of args.
static SquirrelObject CreateFunctionGlobal(SQFUNCTION func,const SQChar * scriptFuncName,const SQChar * typeMask=0);
private:
static HSQUIRRELVM _VM;
static SQInteger _CallState;
static SquirrelObject * _root;
};
...OK, this is the actual issue to my problem: c++ - Using static members across Static Lib and DLL - member value is resetting - Stack Overflow (http://stackoverflow.com/questions/12991581/using-static-members-across-static-lib-and-dll-member-value-is-resetting), the static lib which contains some static member should only be linked to one dll.
I see two instance of the SquirrelVM::_VM exists. The first one is initialized inside the sdk target, and the other instance is inside the src target. It looks like the first one get initialized correctly, but the second one is not, so the second one's value is 0, and we get a crash. Is it by design of the compiler? I mean this time, SquirrelVM library is a static library, and its source are copied to both sdk and src...
So, I think we still need the "old" way, I mean that we should have only one instance of the SquirrelVM::_VM, and we need to export the symbols from the sdk.
EDIT: Is the issue mentioned here: c++ - Initializing private static members - Stack Overflow (http://stackoverflow.com/questions/185844/initializing-private-static-members), each cpp include the class will have a copy of the static member variable?
sorry,here it is.it is huge,so i post a 7z fileShow us the full build log please. See:FAQ-Compiling (errors) - CodeBlocks (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)QuoteC:\localusr\wxWidgets\include\wx\filefn.h|522|undefined reference to `wxMSLU__wstat(wchar_t const*, _stat64*)'|MSLU ,wx use it on win9.x not later,isn't it,error happen when link codeblocks.dll,and i use nuwen's mingw64 to build wx3.02 and codeblocks 10561,enough information or not?
||error: ld returned 1 exit status|
Codeg++.exe -Wall -g -pipe -mthreads -m64 -fno-keep-inline-dllexport -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -std=c++11 -IC:\localusr\wxWidgets\include -IC:\localusr\wxWidgets\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\bindings -Iinclude\scripting\include -Iinclude\scripting\sqplus -Iinclude\mozilla_chardet -Iinclude\mozilla_chardet\mfbt -Iinclude\mozilla_chardet\nsprpub\pr\include -Iinclude\mozilla_chardet\xpcom -Iinclude\mozilla_chardet\xpcom\base -Iinclude\mozilla_chardet\xpcom\glue -c E:\Devel\Codeblocks\trunk\src\sdk\xtra_res.cpp -o .objs30_64\sdk\xtra_res.o
from E:\Devel\Codeblocks\trunk\src\sdk\searchresultslog.cpp:15:
C:\localusr\wxWidgets\include/wx/window.h:1872:13: note: declared here
inline void wxWindowBase::SetInitialBestSize(const wxSize& size)
^
g++.exe -shared -Wl,--out-implib=devel30_64\libcodeblocks.a -Wl,--dll -Lbase\tinyxml -LC:\localusr\wxWidgets\lib\gcc_dll -Ldevel30_64 -Lsdk\scripting\lib .objs30_64\sdk\configmanager-revision.o .objs30_64\base\tinyxml\tinywxuni.o .objs30_64\sdk\annoyingdialog.o .objs30_64\sdk\autodetectcompilers.o .objs30_64\sdk\base64.o .objs30_64\sdk\blockallocated.o .objs30_64\sdk\cbauibook.o .objs30_64\sdk\cbcolourmanager.o .objs30_64\sdk\cbdebugger_interfaces.o .objs30_64\sdk\cbeditor.o .objs30_64\sdk\cbeditorprintout.o .objs30_64\sdk\cbexception.o .objs30_64\sdk\cbplugin.o .objs30_64\sdk\cbproject.o .objs30_64\sdk\cbstatusbar.o .objs30_64\sdk\cbstyledtextctrl.o .objs30_64\sdk\cbthreadpool.o .objs30_64\sdk\cbtreectrl.o .objs30_64\sdk\cbworkspace.o .objs30_64\sdk\ccmanager.o .objs30_64\sdk\compileoptionsbase.o .objs30_64\sdk\compiler.o .objs30_64\sdk\compilercommandgenerator.o .objs30_64\sdk\compilerfactory.o .objs30_64\sdk\compileroptions.o .objs30_64\sdk\compiletargetbase.o .objs30_64\sdk\configmanager.o .objs30_64\sdk\configurationpanel.o .objs30_64\sdk\configuretoolsdlg.o .objs30_64\sdk\confirmreplacedlg.o .objs30_64\sdk\crc32.o .objs30_64\sdk\debuggermanager.o .objs30_64\sdk\editarrayfiledlg.o .objs30_64\sdk\editarrayorderdlg.o .objs30_64\sdk\editarraystringdlg.o .objs30_64\sdk\editor_hooks.o .objs30_64\sdk\editorbase.o .objs30_64\sdk\editorcolourset.o .objs30_64\sdk\editorlexerloader.o .objs30_64\sdk\editormanager.o .objs30_64\sdk\editpairdlg.o .objs30_64\sdk\editpathdlg.o .objs30_64\sdk\edittooldlg.o .objs30_64\sdk\encodingdetector.o .objs30_64\sdk\externaldepsdlg.o .objs30_64\sdk\filefilters.o .objs30_64\sdk\filegroupsandmasks.o .objs30_64\sdk\filemanager.o .objs30_64\sdk\findreplacedlg.o .objs30_64\sdk\genericmultilinenotesdlg.o .objs30_64\sdk\globals.o .objs30_64\sdk\importers_globals.o .objs30_64\sdk\incrementalselectlistdlg.o .objs30_64\sdk\infowindow.o .objs30_64\sdk\loggers.o .objs30_64\sdk\logmanager.o .objs30_64\sdk\macrosmanager.o .objs30_64\sdk\managedthread.o .objs30_64\sdk\manager.o .objs30_64\sdk\menuitemsmanager.o .objs30_64\sdk\mozilla_chardet\src\CharDistribution.o .objs30_64\sdk\mozilla_chardet\src\JpCntx.o .objs30_64\sdk\mozilla_chardet\src\LangBulgarianModel.o .objs30_64\sdk\mozilla_chardet\src\LangCyrillicModel.o .objs30_64\sdk\mozilla_chardet\src\LangGreekModel.o .objs30_64\sdk\mozilla_chardet\src\LangHebrewModel.o .objs30_64\sdk\mozilla_chardet\src\LangHungarianModel.o .objs30_64\sdk\mozilla_chardet\src\LangThaiModel.o .objs30_64\sdk\mozilla_chardet\src\nsBig5Prober.o .objs30_64\sdk\mozilla_chardet\src\nsCharSetProber.o .objs30_64\sdk\mozilla_chardet\src\nsEscCharsetProber.o .objs30_64\sdk\mozilla_chardet\src\nsEscSM.o .objs30_64\sdk\mozilla_chardet\src\nsEUCJPProber.o .objs30_64\sdk\mozilla_chardet\src\nsEUCKRProber.o .objs30_64\sdk\mozilla_chardet\src\nsEUCTWProber.o .objs30_64\sdk\mozilla_chardet\src\nsGB2312Prober.o .objs30_64\sdk\mozilla_chardet\src\nsHebrewProber.o .objs30_64\sdk\mozilla_chardet\src\nsLatin1Prober.o .objs30_64\sdk\mozilla_chardet\src\nsMBCSGroupProber.o .objs30_64\sdk\mozilla_chardet\src\nsMBCSSM.o .objs30_64\sdk\mozilla_chardet\src\nsSBCharSetProber.o .objs30_64\sdk\mozilla_chardet\src\nsSBCSGroupProber.o .objs30_64\sdk\mozilla_chardet\src\nsSJISProber.o .objs30_64\sdk\mozilla_chardet\src\nsUniversalDetector.o .objs30_64\sdk\mozilla_chardet\src\nsUTF8Prober.o .objs30_64\sdk\multiselectdlg.o .objs30_64\sdk\newfromtemplatedlg.o .objs30_64\sdk\personalitymanager.o .objs30_64\sdk\pipedprocess.o .objs30_64\sdk\pluginmanager.o .objs30_64\sdk\pluginsconfigurationdlg.o .objs30_64\sdk\printing_types.o .objs30_64\sdk\projectbuildtarget.o .objs30_64\sdk\projectfile.o .objs30_64\sdk\projectfileoptionsdlg.o .objs30_64\sdk\projectlayoutloader.o .objs30_64\sdk\projectloader.o .objs30_64\sdk\projectloader_hooks.o .objs30_64\sdk\projectmanager.o .objs30_64\sdk\projectsfilemasksdlg.o .objs30_64\sdk\projecttemplateloader.o .objs30_64\sdk\scripting\bindings\sc_consts.o .objs30_64\sdk\scripting\bindings\sc_dialog.o .objs30_64\sdk\scripting\bindings\sc_globals.o .objs30_64\sdk\scripting\bindings\sc_io.o .objs30_64\sdk\scripting\bindings\sc_plugin.o .objs30_64\sdk\scripting\bindings\sc_progress.o .objs30_64\sdk\scripting\bindings\sc_util_dialogs.o .objs30_64\sdk\scripting\bindings\sc_wxtypes.o .objs30_64\sdk\scripting\bindings\scriptbindings.o .objs30_64\sdk\scriptingmanager.o .objs30_64\sdk\scriptsecuritywarningdlg.o .objs30_64\sdk\scrollingdialog.o .objs30_64\sdk\sdk_events.o .objs30_64\sdk\searchresultslog.o .objs30_64\sdk\selecttargetdlg.o .objs30_64\sdk\templatemanager.o .objs30_64\sdk\toolsmanager.o .objs30_64\sdk\uservarmanager.o .objs30_64\sdk\workspaceloader.o .objs30_64\sdk\xtra_res.o -o devel30_64\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--export-all-symbols -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -lshfolder -ltxml30_64 -lwxscintilla_cb -lsqplus30_64 -lsqstdlib30_64 -lsquirrel30_64 -lgdi32 -lwxmsw30u
Hi, I see this log file, and I don't see something is wrong from the log file.sorry,here it is.it is huge,so i post a 7z fileShow us the full build log please. See:FAQ-Compiling (errors) - CodeBlocks (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)QuoteC:\localusr\wxWidgets\include\wx\filefn.h|522|undefined reference to `wxMSLU__wstat(wchar_t const*, _stat64*)'|MSLU ,wx use it on win9.x not later,isn't it,error happen when link codeblocks.dll,and i use nuwen's mingw64 to build wx3.02 and codeblocks 10561,enough information or not?
||error: ld returned 1 exit status|
../../src/common/filefn.cpp(253): assert "!fn.IsDir()" failed in FindValidPath(): Cannot search for directories; only for files
../../src/common/arrstr.cpp(395): assert "iIndex != (-1)" failed in Remove(): removing inexistent element in wxArrayString::Remove
thx ,i take a look and try later!Hi, I see this log file, and I don't see something is wrong from the log file.sorry,here it is.it is huge,so i post a 7z fileShow us the full build log please. See:FAQ-Compiling (errors) - CodeBlocks (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)QuoteC:\localusr\wxWidgets\include\wx\filefn.h|522|undefined reference to `wxMSLU__wstat(wchar_t const*, _stat64*)'|MSLU ,wx use it on win9.x not later,isn't it,error happen when link codeblocks.dll,and i use nuwen's mingw64 to build wx3.02 and codeblocks 10561,enough information or not?
||error: ld returned 1 exit status|
But it has reported before in our forum:
Build C::B linker error: undefined reference to`wxMSLU__wstat(wchar_t const*,... (http://forums.codeblocks.org/index.php/topic,19779.msg135153.html#msg135153), either a compiler issue or wx build option issue.
Also, I see some similar page which is in Japaneses state the issue, see:
wxWidgets-2.9.5 msw - なんとな~くしあわせ?の日記 (http://nantonaku-shiawase.hatenablog.com/entry/2013/08/17/081354), you may need to translate to English language by some web service.
This patch can fix the warning:...You have to add a using directive for the function in the parent class. If our function does something special and using the original function is not a good idea you can put the using directive in the private/protected section.
Any one know how to remove such warning?
...
diff --git a/src/include/cbauibook.h b/src/include/cbauibook.h
index a32ad7a..52aabd5 100644
--- a/src/include/cbauibook.h
+++ b/src/include/cbauibook.h
@@ -393,6 +393,11 @@ class DLLIMPORT cbAuiNotebook : public wxAuiNotebook
*/
static int s_advanceDirection;
+ private:
+ // the following two using directives remove the "-Woverloaded-virtual" warnings
+ using wxAuiNotebook::AddPage;
+ using wxAuiNotebook::InsertPage;
+
DECLARE_EVENT_TABLE()
};
bool AddPage(wxWindow* page, const wxAuiNotebookPage& info);
....
bool AddPage(wxWindow* page,
const wxString& caption,
bool select = false,
const wxBitmap& bitmap = wxNullBitmap);
...