[Wine] Re: Using Monodevelop to write Winelib apps
Progman3K
wineforum-user at winehq.org
Thu May 6 06:54:37 CDT 2010
Thank you for your responses, they are most helpful.
I should clarify, I am already able to write Winelib apps fairly easily using imake.
I have been able to write some simple Imakefiles to build a project for Winelib or for MinGW.
It's just that to write everything, I am using separate tools like gedit, imake and the terminal.
Using Monodevelop is interesting because of it's integrated debugger and code-completion.
For example to write graphical Windows apps, I have had success with Imakefiles like these:
for Winelib
>
> INCROOT = /usr/include/wine/windows
> SYSTEMUSRINCDIR = /usr/include/wine/windows
>
> APPNAME = myapp
>
> SRCS = src/main.cpp
>
> OBJS = resource.res $(SRCS:.cpp=.o)
> LOCAL_LIBRARIES =
> INCLUDES = -I. -Iinc -I../include
> DEFINES = -DWINELIB -D_REENTRANT
>
> CC = wineg++
> CXX = wineg++
> CXXOPTIONS += -mwindows -std=c++0x -Wall
>
> WRC = wrc
>
> WINELIB_FLAGS = -I./inc -I/usr/include/wine/windows $(DEFINES)
> WRCFLAGS = -r
>
> ifndef NDEBUG
> CXXDEBUGFLAGS += -g
> CDEBUGFLAGS += -g
> DEFINES += -DDEBUG
> endif
>
> /* Basic libraries */
> USRLIBDIR = /usr/lib32/wine
> SYSTEMUSRLIBDIR = /usr/lib32/wine
> SHLIBDIR = /usr/lib32/wine
>
> SYS_LIBRARIES += -lcomctl32
>
> .SUFFIXES: .rc .res
>
> resource.res:: res/dialogs.rc
>
> clean::
> $(RM) $(OBJS) $(APPNAME).exe $(APPNAME).exe.so
>
> .rc.res:
> $(WRC) $(WRCFLAGS) $(WINELIB_FLAGS) -o $@ $<
>
> AllTarget($(APPNAME))
> ComplexProgramTargetNoMan($(APPNAME))
> DependTarget()
And now the same thing for MinGW:
>
> INCROOT = /usr/i686-pc-mingw32/usr/include
> SYSTEMUSRINCDIR = /usr/i686-pc-mingw32/usr/include
>
> APPNAME = myapp.exe
>
> SRCS = src/main.cpp
>
> OBJS = resource.o $(SRCS:.cpp=.o)
> LOCAL_LIBRARIES =
> INCLUDES = -I. -Iinc -I../include
> DEFINES = -D_M_IX86 -D_WIN32_IE=0x0400
>
> CC = i686-pc-mingw32-g++
> CXX = i686-pc-mingw32-g++
> CXXOPTIONS += -mwindows -std=c++0x
>
> WRC = i686-pc-mingw32-windres
>
> WINELIB_FLAGS = -I. -Iinc -I/usr/i686-pc-mingw32/usr/include $(DEFINES)
> WRCFLAGS = -r
>
> ifndef NDEBUG
> CXXDEBUGFLAGS += -g
> CDEBUGFLAGS += -g
> DEFINES += -DDEBUG
> endif
>
> /* Basic libraries */
> USRLIBDIR = /usr/i686-pc-mingw32/usr/lib
> SYSTEMUSRLIBDIR = /usr/i686-pc-mingw32/usr/lib
> SHLIBDIR = /usr/i686-pc-mingw32/usr/lib
>
> SYS_LIBRARIES += -lcomctl32
>
> .SUFFIXES: .rc .res
>
> resource.o:: res/dialogs.rc
>
> clean::
> $(RM) $(OBJS)
>
> .rc.o:
> $(WRC) $(WRCFLAGS) $(WINELIB_FLAGS) -o $@ $<
>
> AllTarget($(APPNAME))
> ComplexProgramTargetNoMan($(APPNAME))
> DependTarget()
This approach works really well, I'm trying to do basically the same thing but using the project options in Monodevelop.
More information about the wine-users
mailing list