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

building CodeBlocks with M$ VC++ Toolkit 2003

<< < (4/9) > >>

David Perfors:
for wx 2.4.2 look into the contrib dir. (see installatio instructions in the wiki)
for wx 2.6.* you will find the stc in the contrib dir and xrc with USE_XRC option in the normal build (again look into the wiki)

CrazyAbbot:
Ok ive done that, both the stc and xrc librarys compiled as a DLL and linked in

It's been giving me a few more errors now, in trying to link codeblocks.dll
I've sorted out most of them, but these ones remain.

Some of them look like functions/classes in the dll itself, why are they causing link errors?

I'm using wx 2.4.2


--- Code: ---
cbeditor.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxStyledTextCtrl::sm_eventTable" (?sm_eventTable@wxStyledTextCtrl@@1UwxEventTable@@B)
cbeditor.obj : error LNK2001: unresolved external symbol "char const * const wxSTCNameStr" (?wxSTCNameStr@@3PBDB)
editorconfigurationdlg.obj : error LNK2001: unresolved external symbol "char const * const wxSTCNameStr" (?wxSTCNameStr@@3PBDB)
cbeditor.obj : error LNK2001: unresolved external symbol "public: static class wxClassInfo wxStyledTextCtrl::sm_classwxStyledTextCtrl" (?sm_classwxStyledTextCtrl@wxStyledTextCtrl@@2VwxClassInfo@@A)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_USERLISTSELECTION" (?wxEVT_STC_USERLISTSELECTION@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_DWELLEND" (?wxEVT_STC_DWELLEND@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_DWELLSTART" (?wxEVT_STC_DWELLSTART@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_CHARADDED" (?wxEVT_STC_CHARADDED@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_CHANGE" (?wxEVT_STC_CHANGE@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_UPDATEUI" (?wxEVT_STC_UPDATEUI@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_MARGINCLICK" (?wxEVT_STC_MARGINCLICK@@3HB)
projectmanager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
projecttemplateloader.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
xtra_res.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
configmanager.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
filegroupsandmasks.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
pipedprocess.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
projectbuildtarget.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
cbplugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z) referenced in function "void __cdecl wxPostEvent(class wxEvtHandler *,class wxEvent &)" (?wxPostEvent@@YAXPAVwxEvtHandler@@AAVwxEvent@@@Z)
cbproject.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
compiler.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z) referenced in function "public: void __thiscall RegExArray::Add(struct RegExStruct const &,unsigned int)" (?Add@RegExArray@@QAEXABURegExStruct@@I@Z)
compilerfactory.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wxAssert@@YAXHPBDH00@Z)
--- End code ---

rickg22:
Check out the latest CVS and see if the errors are reduced. I think it's got to do with  a DLLIMPORT clause missing.

Regarding the wxAssert, it seems (IMHO) you're using the DEBUG build of wxwidgets. Check out the wiki for wxwidgets compilation instructions.

Oh, found similar warnings in the web. Look!

http://lists.wxwidgets.org/archive/wxPython-users/msg04275.html


--- Quote ---
>but now I am getting unresolved externals.
> A bunch of unresolved externals involving wxAssert like this:
> windows.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) v
> void __cdecl wxAssert(int,char const *,int,char const *,char const *)" (__imp_?wx
Assert@@YAXHPBDH00@Z)

>as well as a bunch about wxObject new:

> wx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public
: static void * __cdecl wxObject::operator new(unsigned int,char const *,int)" (
__imp_??2wxObject@@SAPAXIPBDH@Z)

You need to rebuild everything. It looks like at lease some of your wxPython .obj files were built with hybrid settings.

--- End quote ---

CrazyAbbot:
Ok, i've downloaded the code from cvs and i'm using that.

ive found a little oddity in your code, its nothing major but the compiler complains about it.

in toolsmanager.h you have struct Tool{}  but you prototype it elsewhere as class Tool;

I've done this in toolsmanager.h to shut it up.


--- Code: ---
class Tool
{
public:
Tool(){ menuId = -1; }
wxString name;
wxString command;
wxString params;
wxString workingDir;
int menuId;
};

--- End code ---


I'm not using a debug build of wxwidgets or any other library and i'm linking it with libtinyxml, wxxrc stcdll and the wxwidgets dll.

I'm defining these preprocessor symbols.  Is there anything im missing?

__WX__
__WIN32__
__WINDOWS__
WINDOWS
WXMSW
__WXMSW__
WXUSINGDLL
EXPORT_LIB
EXPORT_EVENTS
_USRDLL

The build errors are a bit different now.  they seem to be about the styled text control.  Thats built as a dll.

The wiki isnt completey clear, should the stc and xrc be build as static libraries?

compiling and linking stc staticly seems to generate even more linker errors.


--- Code: ---
------ Build started: Project: codeblocks_dll, Configuration: Release Win32 ------

Linking...
   Creating library Release/codeblocks_dll.lib and object Release/codeblocks_dll.exp
cbeditor.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxStyledTextCtrl::sm_eventTable" (?sm_eventTable@wxStyledTextCtrl@@1UwxEventTable@@B)
cbeditor.obj : error LNK2001: unresolved external symbol "char const * const wxSTCNameStr" (?wxSTCNameStr@@3PBDB)
editorconfigurationdlg.obj : error LNK2001: unresolved external symbol "char const * const wxSTCNameStr" (?wxSTCNameStr@@3PBDB)
editormanager.obj : error LNK2001: unresolved external symbol "char const * const wxSTCNameStr" (?wxSTCNameStr@@3PBDB)
cbeditor.obj : error LNK2001: unresolved external symbol "public: static class wxClassInfo wxStyledTextCtrl::sm_classwxStyledTextCtrl" (?sm_classwxStyledTextCtrl@wxStyledTextCtrl@@2VwxClassInfo@@A)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_USERLISTSELECTION" (?wxEVT_STC_USERLISTSELECTION@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_DWELLEND" (?wxEVT_STC_DWELLEND@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_DWELLSTART" (?wxEVT_STC_DWELLSTART@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_CHARADDED" (?wxEVT_STC_CHARADDED@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_CHANGE" (?wxEVT_STC_CHANGE@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_UPDATEUI" (?wxEVT_STC_UPDATEUI@@3HB)
cbeditor.obj : error LNK2001: unresolved external symbol "int const wxEVT_STC_MARGINCLICK" (?wxEVT_STC_MARGINCLICK@@3HB)
Release/codeblocks_dll.dll : fatal error LNK1120: 10 unresolved externals

--- End code ---


I might give it a go with wx widgets 2.6 later on

rickg22:
OK, updated CVS with your Tool code. Did you remember to copy the libstc.a to your mingw path, or add its directory to your linker dir?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version