Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Build C::B against wx3.02 with gcc 5.2 under Windows

<< < (16/25) > >>

ollydbg:

--- Quote from: oBFusCATed on October 13, 2015, 08:31:30 pm ---
--- Quote from: ollydbg on October 13, 2015, 05:15:08 pm ---The bad thing is, to solve this kind of error, I also need to add export decoration to squirrel library... :(

--- End quote ---
What is the error related to squirrel?

--- End quote ---
When build the src target, I get such error:

--- Code: ---[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))


--- End code ---
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).
In this case, the symbol should be marked as dllexport.
EDIT: after the change, the static library should be rebuild again.

oBFusCATed:

--- Quote from: ollydbg on October 14, 2015, 12:58:24 am ---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).
In this case, the symbol should be marked as dllexport.
EDIT: after the change, the static library should be rebuild again.

--- End quote ---
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.
Have you tried linking codeblocks.exe with libsquirrel.a and all the others?

stahta01:

--- Quote from: oBFusCATed on October 14, 2015, 08:40:23 am ---
--- Quote from: ollydbg on October 14, 2015, 12:58:24 am ---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).
In this case, the symbol should be marked as dllexport.
EDIT: after the change, the static library should be rebuild again.

--- End quote ---
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.
Have you tried linking codeblocks.exe with libsquirrel.a and all the others?

--- End quote ---

IMO, The only thing linking to the libsquirrel.a should be the Code::Blocks DLL, do you disagree?

Tim S.

oBFusCATed:
I'm not sure about this, because other parts of the code use Squirrel APIs directly.
Thus either everything that uses squirrel has to link to squirrel's lib or codeblocks.dll has to export all used APIs.

The only benefit if we use the latter option is that any globals and static will be defined just once.
I guess, I'll have to resurrect my patches that try to introduce hidden visibility on linux.

ollydbg:

--- Quote from: oBFusCATed on October 14, 2015, 09:11:13 pm ---I'm not sure about this, because other parts of the code use Squirrel APIs directly.

--- End quote ---
I see that all plugins in Windows Codeblocks*.cbp only link to the codeblocks.dll, and not extra static library is need here.
The way we build the static libraries (such as libsqplus.a inside \src\sdk\scripting\lib) with export all symbol option enabled, so that the codeblocks.dll are export all the symbols of those static libraries.

If the plugin is explicitly link to a static library, such as libsqplus.a, then the piece of code is in both codeblocks.dll and the plugin.dll.

I'm OK this this design.

@Tim: if you want to use __declspec(dllimport), then we will finally need two pchs, because on pch are for SDK(with many __declspec(dllexport) decoration for symbols) and another pch is for src and plugin targets (with __declspec(dllimport) decoration for symbols).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version