User forums > Help
Need help getting wxwidget into C::B
Manatax:
Well... that was easy :shock: It appears I was not actually useing the pack... now I am... and it works... Thank you very much guys :D
Manatax:
Ok... so.. I've been using the 4 files that CB created for me as a wxWidget project and all seems to be working fine... the thing is... I'm trying some tutorials and for some reason CB does not find the librarys for single files (as oposite from wx projects).
this tutorial example:
--- Code: ---#include <wx/file.h>
int main(int argc, char **argv)
{
wxString str = wxT("You make me want to be a better man.\n");
wxFile file;
file.Create(wxT("quote"), true);
if (file.IsOpened())
wxPuts(wxT("the file is opened"));
file.Write(str);
file.Close();
if (!file.IsOpened())
wxPuts(wxT("the file is not opened"));
}
--- End code ---
Produces this error msg:
--- Code: ---D:\Documents and Settings\Manny\Escritorio\createfile.cpp|1|wx/file.h: No such file or directory|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp||In function `int main(int, char**)':|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|6|error: `wxString' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|6|error: expected `;' before "str"|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|8|error: `wxFile' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|8|error: expected `;' before "file"|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|9|error: `file' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|9|error: `wxT' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|12|error: `wxPuts' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|14|error: `str' was not declared in this scope|
D:\Documents and Settings\Manny\Escritorio\createfile.cpp|18|error: `wxPuts' was not declared in this scope|
||=== Build finished: 10 errors, 0 warnings ===|
--- End code ---
Can I get some help on this one plz? :(
Jenna:
Look at the wizard created projects build options.
It gives you a hint how to specify the correct include dirs and link to the appropriate libs.
Of course the exact paths and libs to be included depend on the wxWidgets flavour(s) you have installed (Debug, Release monolithic, shared, static ...).
But what you need exactly goes beyond the scope of the C::B forum and should be asked in an appropriate forum (like the wxWidgets one).
dmoore:
--- Quote from: Manatax on February 06, 2009, 06:03:03 pm ---Ok... so.. I've been using the 4 files that CB created for me as a wxWidget project and all seems to be working fine... the thing is... I'm trying some tutorials and for some reason CB does not find the librarys for single files (as oposite from wx projects).
--- End quote ---
C::B wxWidgets projects add all of the necessary boilerplate (include directories/libs/flags etc.), which obviously won't be applied to single files that are outside of the project. As Jens says, look at the build options for a C::B created wxwidgets project ... THEN... copy them across to Settings -> Compiler and Debugger, which will then apply them globally. Keep in mind that will mean those directories, libs and flags will be applied to any project and any single file compiled (but you could create a copy of the default compiler for this purpose)
Manatax:
I am doing sorta that right now, but I still have issues
(I'm applying the properties to the new empty project)
Compiler Settings:
> Other Options:
>> -pipe
>> -mthreads
>> [[if (PLATFORM == PLATFORM_MSW && (GetCompilerFactory().GetCompilerVersionString(_T("gcc")) >= _T("4.0.0"))) print(_T("-Wno-attributes"));]]
> #defines:
>> __GNUWIN32__
>> __WXMSW__
>> WXUSINGDLL
>> wxUSE_UNICODE
Search Directories:
> Compiler:
>> D:\CodeBlocks\wxWidgets\include
>> D:\CodeBlocks\wxWidgets\contrib\include
> Resource Compiler
>> D:\CodeBlocks\wxWidgets\include
But I get this:
--- Code: ---||=== Test, Debug ===|
obj\Debug\createfile.o:createfile.cpp:(.text+0xa6)||undefined reference to `__imp___ZN6wxFile6CreateEPKwbi'|
obj\Debug\createfile.o:createfile.cpp:(.text+0xcf)||undefined reference to `__imp__wxConvUTF8'|
obj\Debug\createfile.o:createfile.cpp:(.text+0xf9)||undefined reference to `__imp___ZN6wxFile5CloseEv'|
obj\Debug\createfile.o:createfile.cpp:(.text$_ZN6wxFileD1Ev[wxFile::~wxFile()]+0xd)||undefined reference to `__imp___ZN6wxFile5CloseEv'|
)]+0x4a)||undefined reference to `__imp___ZNK8wxString6mb_strERK8wxMBConv'|
)]+0xb5)||undefined reference to `__imp___ZN6wxFile5WriteEPKvj'|
)]+0x7)||undefined reference to `__imp___ZN12wxStringBase4nposE'|
)]+0x27)||undefined reference to `__imp___ZN12wxStringBase8InitWithEPKwjj'|
||=== Build finished: 8 errors, 0 warnings ===|
--- End code ---
Jens @ I know I could probably get some help from their forum... but I thought that maybe someone in here with experience in C::B could be more useful than someone with knowledge of the librarys. Thanx for the help anyways :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version