레이블이 wxWidget인 게시물을 표시합니다. 모든 게시물 표시
레이블이 wxWidget인 게시물을 표시합니다. 모든 게시물 표시

2012년 5월 21일 월요일






wxWidgets 2.8.12

"Hello world!" 프로그램이 종료되지 않는다......!




2012년 5월 20일 일요일

Code::Block 빌드 성공


참조:
1. http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows





MinGW 를 설치하고,

wxWidget-2.8.12 소스코드를 빌드하고,

Code::Block 소스코드를 빌드하는데 성공했다.





















Plugin 을 빌드하는 즐거움도 느낄수 있다.

Plugin 을 빌드한후, update.bat 을 다시한번 실행시켜 주어야 한다.









개발자가 개발도구( IDE )를 빌드할 수 있다는것이 어떤의미인가.

그로인한 효과는 무엇인가.

이것으로 무엇이 가능한가.



<Code::Block 빌드>가 모든것의 출발점이다.




2012년 5월 19일 토요일

wxWidget 빌드 에러 ( wxMSW-2.8.12 )

































wxWidgets ("wxMSW-2.8.12")  를 MinGW 로 빌드하다가 "Memory exhausted" 에러가 났다.





이 오류는 다음과 같이 CFLAGS, CXXFLAGS 를 추가하면 해결된다.

MinGW, TDM-GCC 둘다 이 방법으로 wxWidgets 을 빌드할 수 있다.




D:\DEV\wxMSW-2.8.12\build\msw>


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 clean


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1




mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1 clean


mingw32-make.exe -f makefile.gcc CFLAGS=-fno-keep-inline-dllexport CXXFLAGS=-fno-keep-inline-dllexport SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1







참조:
1. http://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW
2. TDM-GCC ( http://tdm-gcc.tdragon.net/ )



(from README-gcc-tdm.txt)


>>>>> USAGE NOTES

*** Inline member functions and DLLs ***

[[[ IMPORTANT NOTE:
[[[ You will probably need to use "-fno-keep-inline-dllexport" when building
[[[ large DLLs with lots of inline member functions, such as the "wxWidgets"
[[[ library's monolithic DLL.

The GCC 4.5 series introduced a change in the way inline functions that are
members of classes are handled in DLLs. Before the 4.5 series, inline member
functions were *not* emitted in DLLs by default; in the 4.5 series and later,
they are.

Unfortunately, this change in behavior led to link-time problems with large
libraries (such as wxWidgets) that use precompiled headers and many inline
member functions, where the linker would run out of memory while trying to
generate the DLL.

In the GCC 4.6 series, therefore, the flag "-fno-keep-inline-dllexport" was
introduced, which allows you to disable the emission of inline functions in DLLs
and return to the old behavior.








2012년 5월 18일 금요일

Code::Block 빌드



참조: Installing Code::Blocks from source on Windows

http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows





Code::Block 을 빌드해보자.

우선 소스코드를 내려받아야 한다.




다음 위치를 입력하여 코드를 적당한 디렉토리에 내려받자.

svn://svn.berlios.de/codeblocks/trunk






















내려받기가 끝났다.



지금부터 할일은 Code::Block 으로 Code::Block 을 빌드하는 일이다.


설치된 Code::Block 을 실행하고, 다음 프로젝트 파일을 연다.

CodeBlocks_wx29.cbp








전역변수 wx29 의 위치를 입력해준다.









빌드 버튼을 누른다.





빌드가 잘되고 있다.

빌드가 끝났으면 이전에 빌드해두었던 다음 파일을

%WX_DIR%\wxWidgets-2.9.3\lib\gcc_dll\wxmsw293u_gcc_custom.dll


다음 위치로 복사하자.

%CB_DIR%\src\devel29


그리고나서 update29.bat 를 실행시켜준다.


zip.exe 가 없는 경우는 다음 사이트에서 다운받고,
실행시킬수 있도록 시스템 환경변수 Path 를 설정해주자.

http://sourceforge.net/projects/gnuwin32/files/zip/2.3-3/zip-2.3-3-bin.zip/download









wxWidgets 빌드




wxWidgets 는 소스코드형태로 제공되므로, C++ 개발자가 빌드해야한다.


wxWidgets 의 압축을 풀고, 그 아래의 "\build\msw" 디렉토리로 이동한다.


내 컴퓨터에서 디렉토리위치는 다음과 같이 표현된다.

"D:\DEV\wxWidgets-2.9.3\build\msw"





빌드작업은 콘솔창에서 make 를 사용한다.

MinGW 에서 make 의 파일이름은 mingw32-make.exe 이다.





이전 빌드된 임시파일을 지운다.

mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 clean



빌드한다.

mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1









빌드가 잘 되고 있다.



debug 버전에 대해서도 위 작업을 한번 더 해준다.



mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1 clean


mingw32-make.exe -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD= debug UNICODE=1









이렇게 해서, 나는 wxWidgets 를 MinGW 로 빌드해본 프로그래머가 되었다.



2012년 5월 11일 금요일

wxWidget



wxWidget
http://www.wxwidgets.org/ )



main 함수가 보이지 않는다.
앞으로 어찌해야 하나.



















// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"


#include "wx/wx.h"


#include "wx/app.h"
#include "wx/grid.h"
#include "wx/treectrl.h"
#include "wx/spinctrl.h"
#include "wx/artprov.h"
#include "wx/clipbrd.h"
#include "wx/image.h"
#include "wx/colordlg.h"
#include "wx/wxhtml.h"
#include "wx/imaglist.h"
#include "wx/dataobj.h"
#include "wx/dcclient.h"
#include "wx/bmpbuttn.h"
#include "wx/menu.h"
#include "wx/toolbar.h"
#include "wx/statusbr.h"
#include "wx/msgdlg.h"
#include "wx/textdlg.h"






// Declare the application class
class MyApp : public wxApp
{
public:
// Called on application startup
virtual bool OnInit();
};
// Declare our main frame class
class MyFrame : public wxFrame
{
public:
// Constructor
MyFrame(const wxString& title);
// Event handlers
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
private:
// This class handles events
DECLARE_EVENT_TABLE()
};






// Implements MyApp& GetApp()
DECLARE_APP(MyApp)
// Give wxWidgets the means to create a MyApp object
IMPLEMENT_APP(MyApp)
// Initialize the application
bool MyApp::OnInit()
{
// Create the main application window
MyFrame *frame = new MyFrame(wxT("Minimal wxWidgets App"));
// Show it
frame->Show(true);
// Start the event loop
return true;
}


// Event table for MyFrame
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_ABOUT, MyFrame::OnAbout)
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
END_EVENT_TABLE()
void MyFrame::OnAbout(wxCommandEvent& event)
{
wxString msg;
msg.Printf(wxT("Hello and welcome to %s"),
wxVERSION_STRING);




wxMessageBox(msg, wxT("About Minimal"),
wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnQuit(wxCommandEvent& event)
{
// Destroy the frame
Close();
}






#include "sample.xpm"




MyFrame::MyFrame(const wxString& title)
: wxFrame(NULL, wxID_ANY, title)
{
// Set the frame icon
// SetIcon(wxIcon(mondrian_xpm));
SetIcon(wxIcon(sample_xpm));
// Create a menu bar
wxMenu *fileMenu = new wxMenu;
// The “About” item should be in the help menu
wxMenu *helpMenu = new wxMenu;

helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"),


wxT("Show about dialog"));
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"),
wxT("Quit this program"));
// Now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(fileMenu, wxT("&File"));
menuBar->Append(helpMenu, wxT("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// Create a status bar just for fun
CreateStatusBar(2);
SetStatusText(wxT("Welcome to wxWidgets!"));
}