Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / makefile ?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. makefile ?
#2290
Posted by: 2003-05-27 19:05:55

Hello,

Does anyone here -you Guidance:)- have a SIMPLE control of creating a
SIMPLE makefile for Dev-cpp making wxWindows samples.

My problem is with the .rc file... I Guess ???

I can compile my own (demo cut and pasted) wxWindows code under
Dev-Cpp.

No need to be as long as me !

My work :
------------------------------------------------------

I installed the Dev-C++ with wxWindows package 4.9.8.0 and
the wxWindows 2.4.0.  Here it install without any bug !
(After 5 trials :)

 wxWindows site : http://www.wxwindows.org/
 Dev-C++ and wxWindows : http://www.wxwindows.org/devcpp.htm

I hardly gained SOME control of creating a makefile, but it's
only 'TIPS'

I wrote a RQ software creating makefile.win based on the .pro file
often:) present in the wxWindows Samples directory of the project

IE : for  wx/samples/widgets/  the result is
------------------- does not work :) -----------
# Project: widgets
# Makefile created by Dev-C++ 4.9.8.0

CPP  = g++.exe
CC   = gcc.exe
WINDRES = windres.exe
RES  = widgets_private.res
OBJ  = textctrl.o static.o spinbtn.o slider.o radiobox.o notebook.o listbox.o gauge.o combobox.o button.o widgets.o $(RES)
LINKOBJ  = textctrl.o static.o spinbtn.o slider.o radiobox.o notebook.o listbox.o gauge.o combobox.o button.o widgets.o $(RES)
LIBS =  -L"C:/DEV-CPP/lib" -mwindows -lwxmswu -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid  
INCS =  -I"C:/DEV-CPP/include"
CXXINCS =  -I"C:/DEV-CPP/include/c++"  -I"C:/DEV-CPP/include/c++/mingw32"  -I"C:/DEV-CPP/include/c++/backward"  -I"C:/DEV-CPP/include"
BIN  = widgets.exe
CXXFLAGS = $(CXXINCS)-D_X86_=1 -DWIN32 -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -mthreads -DSTRICT  -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions 
CFLAGS = $(INCS)

.PHONY: all all-before all-after clean clean-custom

all: all-before widgets.exe all-after


clean: clean-custom
   rm -f $(OBJ) $(BIN)

$(BIN): $(LINKOBJ)
   $(CPP) $(LINKOBJ) -o "widgets.exe" $(LIBS)

textctrl.o: textctrl.cpp
   $(CPP) -c textctrl.cpp -o textctrl.o $(CXXFLAGS)

static.o: static.cpp
   $(CPP) -c static.cpp -o static.o $(CXXFLAGS)

spinbtn.o: spinbtn.cpp
   $(CPP) -c spinbtn.cpp -o spinbtn.o $(CXXFLAGS)

slider.o: slider.cpp
   $(CPP) -c slider.cpp -o slider.o $(CXXFLAGS)

radiobox.o: radiobox.cpp
   $(CPP) -c radiobox.cpp -o radiobox.o $(CXXFLAGS)

notebook.o: notebook.cpp
   $(CPP) -c notebook.cpp -o notebook.o $(CXXFLAGS)

listbox.o: listbox.cpp
   $(CPP) -c listbox.cpp -o listbox.o $(CXXFLAGS)

gauge.o: gauge.cpp
   $(CPP) -c gauge.cpp -o gauge.o $(CXXFLAGS)

combobox.o: combobox.cpp
   $(CPP) -c combobox.cpp -o combobox.o $(CXXFLAGS)

button.o: button.cpp
   $(CPP) -c button.cpp -o button.o $(CXXFLAGS)

widgets.o: widgets.cpp
   $(CPP) -c widgets.cpp -o widgets.o $(CXXFLAGS)

widgets_private.res: widgets_private.rc
   $(WINDRES) -i widgets_private.rc -I rc -o widgets_private.res -O coff
----------------------------------

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I wrote too a RQ software creating this myproject.dev based too on
that  .pro file often present in wxWindows samples directory of the project

IE : for  wx/samples/widgets/  the result is

-------- this works to open and compile the project under Dev-Cpp -------
[Project]
FileName=widgets.dev
Name=widgets
UnitCount=11
Type=0
Ver=1
ObjFiles=
Includes=
Libs=
PrivateResource=widgets_private.rc
ResourceIncludes=
MakeIncludes=
Compiler=
CppCompiler=-D_X86_=1 -DWIN32 -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -mthreads -DSTRICT  -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -fno-rtti -fno-exceptions_@@_
Linker=-lwxmswu -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid  _@@_
IsCpp=1
Icon=widgets.ico
ExeOutput=
ObjectOutput=
OverrideOutput=0
OverrideOutputName=widgets.exe
HostApplication=
Folders=
CommandLine=
IncludeVersionInfo=0
SupportXPThemes=0
CompilerSet=0
CompilerSettings=000000000000000000

[Unit1]
FileName=textctrl.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit2]
FileName=static.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit3]
FileName=spinbtn.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit4]
FileName=slider.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit5]
FileName=radiobox.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit6]
FileName=notebook.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit7]
FileName=listbox.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit8]
FileName=gauge.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit9]
FileName=combobox.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit10]
FileName=button.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[Unit11]
FileName=widgets.cpp
CompileCpp=1
Folder=Projet1
Compile=1
Link=1
Priority=1000
OverrideBuildCmd=0
BuildCmd=

[VersionInfo]
Major=0
Minor=1
Release=1
Build=1
LanguageID=1033
CharsetID=1252
CompanyName=
FileVersion=
FileDescription=Developed using the Dev-C++ IDE
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=
AutoIncBuildNr=0
--------------------------------------------------

Here is the Batch file Compiling my Makefile.win
---------wxCompile.Bat---------------
@Echo off
c:Dev-CppBinmake -f "C:Dev-cppwx_sampleswidgetsMakefile.Win" all


Echo '
Echo '
Echo     COMPILTION FINISHED
Echo '
Echo '
Pause
------------------------------------

BTW wxWindows is the perfect thing to translate rapidQ code
in C++ ! Except it slowness to compile...

Jacques
Message2. Re: makefile ?
#2292
Posted by: guidance 2003-05-27 21:04:06
Hi, Jacques, welcome to wxWindows/Dev-c++! :)

But I didn't understand your question :(

Are you using wxWindows cpp source files directly?

I, as same as most other wxWindows users, just use compiled wxWindows library, then link my code to the lib (.a file). This way, always create minimum 1 MB exe file, really too large! (http://g.yi.org/_scripts/file.php?f=1645&r=46)
Message3. Re: makefile ?
#2293
Posted by: 2003-05-27 22:41:53

Hello,

First, thank you for your reply !

With the package mentionned above, no need to compile
the wxWindows libraries ! Just do what is said at
 
    http://www.wxwindows.org/devcpp.htm

Then you can open wxWindows projects under Dev-Cpp and
compile them ! BUT YOU MUST USE THE
     File>New>Project>Gui>wxWindows
which opens you the minimum wxWindows project !

So, I Use the wx/Samples directly in Dev-Cpp
But to do that, I had to create a project.dev file based on the
project.pro file that can be found in the wx/Samples/ directories !

As a test for that installation, I compiled some of the wx/samples/*

My goal is to be able to build a makefile without using Dec-c++.
I am close to it !

My question is : could you build a makefile knowing the files that have
to be compiled ? Without using Dev-cpp. Just typing the commands in a
text file or writing a software doing it ? (To write a RQ to wxWindows
translator this stage is mandatory :)

IE : Main.cpp, main.h, more_1.cpp, more_2.cpp, main.rc, more_1.rc

Jacques

BTW thank you for pointing me to wxWindows and Dev-C++
Message4. Re: makefile ?
#2296
Posted by: guidance 2003-05-28 21:48:31
May check mingw document for its make usage.

How can you know which wxWindows cpp source files are needed? I tried, added many files into the dev project, still didn't work. I suppose this way may minimize exe size, compared with linking to static library.
Message5. Re: makefile ? It works now !
#2297
Posted by: 2003-05-28 23:12:06

Hello,

In the/my wx/samples/* directories there is a file with the .PRO extension
which enumerates the files of the project.

The problem with my makefile was with resource file (now my makefiles work):
1 :
RES  = widgets_private.res
must be
RES =

2:
widgets_private.res: widgets_private.rc
    $(WINDRES) -i widgets_private.rc -I rc -o widgets_private.res -O coff
That should be deleted

The project.rc file is "automatically" included !

I think that  you only have to compile resources when there is a second
resource file with another name than project.rc ??????

============================

For the size of the EXE ! 2 megabytes minimum here :)

Getting some elements out of the LIBS line use by linker should reduce
the exe size ??? Are all these library added to the project at link time ????

LIBS =  -L"C:/DEV-CPP/lib" -mwindows -lwxmswu -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid  

My knowledge of compile and linkage is made of tips :)
Message6. Re: makefile ? It works now !
#2298
Posted by: 2003-05-28 23:15:01

Hello,

In the/my wx/samples/* directories there is a file with the .PRO extension
which enumerates the files of the project.

The problem with my makefile was with resource file (now my makefiles work):
1 :
RES  = widgets_private.res
must be
RES =

2:
widgets_private.res: widgets_private.rc
    $(WINDRES) -i widgets_private.rc -I rc -o widgets_private.res -O coff
That should be deleted

The project.rc file is "automatically" included !

I think that  you only have to compile resources when there is a second
resource file with another name than project.rc ??????

============================

For the size of the EXE ! 2 megabytes minimum here :)

Getting some elements out of the LIBS line use by linker should reduce
the exe size ??? Are all these library added to the project at link time ????

LIBS =  -L"C:/DEV-CPP/lib" -mwindows -lwxmswu -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid  

My knowledge of compile and linkage is made of tips :)

I attach here the RQ code creating .dev and makefile.win for wxSamples !

Topic closed :)

Jacques
Message7. .
#2299
Posted by: 2003-05-28 23:15:03
.
Message8. .
#2300
Posted by: 2003-05-28 23:16:52
.
Message9. How to attach/upload
#2301
Posted by: guidance 2003-05-29 10:31:12
To easy sharing, please upload files to suitable subfolders under RapidQ/Upload folder: http://g.yi.org/_scripts/file.php?f=80&r=2330
Thanks!

Can your RQ code handle any user source files and know which wxWindows cpp should be included?
Message10. No !
#2302
Posted by: 2003-05-29 18:36:49

It works with many (?80%) of the wx/samples/ sources, but not all !

To use it with your projects, just create a file such as :

============== see wx/samples/widgets/widgets.pro ====
# project files
SOURCES = widgets.cpp button.cpp combobox.cpp gauge.cpp listbox.cpp
          notebook.cpp radiobox.cpp slider.cpp spinbtn.cpp static.cpp
          textctrl.cpp
RC_FILE = widgets.rc
TARGET  = widgets
==============

for your project and it "should" work :) ... on windows plattform !

I wrote that code to train myself and to compile these examples and see how bugged my wxWindows installation was ! There are Bugs :)

That code is a dirty quick written thing, I uploaded here because I told you
about it and because you're the only other user of this group :)

-------------------------------------------------------

I have few simple questions ... for now :
 - how bugged is the wx beta 240 version ?
 - is the 229 bugless ?
 - what is THE tip to use  patch.exe with patches???.txt found:)

Jacques
Message11. Re: No !
#2303
Posted by: guidance 2003-05-29 18:57:59
I downloaded your file, and rename it to zip, but has only 50 bytes and winzip reported corrupt. Could you put it on rapidq/upload folder? Thanks!

What bugs do you find of wx240? I don't feel there's any big one.
Message12. Re: No !
#2304
Posted by: 2003-05-29 19:24:57

As I said, it's dirty written code ! I wont broadcast it !

Just get it at :
  http://www.teledisnet.be/web/jph01696/wxWinMakefile.zip

In the .DEV code, you could add the .h  files as "UNIT" they will be
included in the project too !

wx240 bugs ... I'll tell you later ! I would like to recompile the
wx240 libraries first ... I wonder if the Dev-Cpp package includes
everything ????

Could you delete the my 3 -double- useless posts in this group ?
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,800.00 ·
 
 
¥489.00 ·
 
 
¥288.00 ·
 
 
¥908.00 ·
 
 
¥748.00 ·
 
 
¥264.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0