Author Topic: Using a makefile  (Read 7217 times)

Offline Xorlium

  • Multiple posting newcomer
  • *
  • Posts: 21
    • http://
Using a makefile
« on: May 08, 2005, 12:23:12 am »
Hi.

I've been trying for oh so long to write a simple wxWidgets application, but with no success. I've succesfully compiled maaaany time wxWidgets, but I keep getting the same error when I try to run my app from within codeblocks (I posted a thread about it too, http://www.codeblocks.org/index.php?name=PNphpBB2&file=viewtopic&t=269)


I noticed that I CAN compile and run the samples that come with wxwidgets, so I thought "hell, I'm just learning, I'll just replace those samples with my own code". And it works.

I've been writing my own wx apps using their own makefile, and it works.

But it's kind of boring to go to msys and type "make" and then run the program every time I make a small change.

So what I was thinking is... is there some way I can tell code::blocks to use the makefile there? That when I hit "compile & run" it just gives out the simple command: "make" and then runs the program?

If I change the compiler to "use makefiles", it tries to create a new makefile and then go from there. I don't want it to create a new makefile, I want it to use the makefile that's already there.

Thanks!

Offline Profic

  • Multiple posting newcomer
  • *
  • Posts: 56
Using a makefile
« Reply #1 on: May 08, 2005, 12:44:36 am »
What about "Use custom makefile" checkbox in something inside Advanced setup of Compiler plugin (or compler project options - can't say exactly where it is as I don't have C::B installed here)?
Not fear, nor tears can reach me now, the light seems so clear as the night fades away (c) Tristania - Beyond The Veil

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Using a makefile
« Reply #2 on: May 08, 2005, 12:46:10 am »
There is an option for "use custom makefile". I think it's in advanced or something... lemme check. Ah, yes. In menu: "Project"... select "properties".

There's a makefile, and then check the little box that says "generate custom makefile".

And don't worry. In upcoming beta8, the wxwidgets template projects do work now :-) I fixed them myself with the help of some of the users in here :-).

Offline Xorlium

  • Multiple posting newcomer
  • *
  • Posts: 21
    • http://
Using a makefile
« Reply #3 on: May 08, 2005, 01:48:11 am »
Duh, thanks!

Now I've got a NEW problem, but now it's not codeblocks related.

If I type "make" in minSYS, it works perfectly. But if I type "mingw32-make" in the DOS prompt, it doesn't, it says:

Code

../.././bk-deps g++ -c -o minimal_minimal.o -D__WXMSW__     -I../../../samples/minimal -DWXUSINGDLL -I../../../samples/minimal/../../samples -DWX_PRECOMP -DNO_GCC_PRAGMA -I../../lib/wx/include/msw-ansi-release-2.6 -I../../../include -O2 -mthreads -Wall -Wno-ctor-dtor-privacy ../../../samples/minimal/minimal.cpp
process_begin: CreateProcess((null), sh C:\wx\bldGLp\bk-deps g++ -c -o minimal_minimal.o -D__WXMSW__ -I../../../samples/minimal -DWXUSINGDLL -I../../../samples/minimal/../../samples -DWX_PRECOMP -DNO_GCC_PRAGMA -I../../lib/wx/include/msw-ansi-release-2.6 -I../../../include -O2 -mthreads -Wall -Wno-ctor-dtor-privacy ../../../samples/minimal/minimal.cpp, ...) failed.
make (e=2): El sistema no puede hallar el archivo especificado.
mingw32-make.exe: *** [minimal_minimal.o] Error 2


Oh, "El sistema no puede hallar el archivo especificado" means "The system can't find the specified file".

What do I do now?

Can I tell codeblocks to use minSYS instead of the dos prompt?? Or what's wrong now?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Using a makefile
« Reply #4 on: May 08, 2005, 02:19:12 am »
Um, I guess the makefile only works for unix. OK here's the deal:
The wxWidgets template files are located at http://cvs.sourceforge.net/viewcvs.py/codeblocks/codeblocks/src/templates/win32/
Look for wxwidgets.cbp,wxwidgets.template and wxwidgets_static.cbp. Copy them to your codeblocks templates directory (under share/codeblocks).

Try to see if you can create new wxwidgets projects this way. Then you just have to add your files. Ta-da! :)

Offline Xorlium

  • Multiple posting newcomer
  • *
  • Posts: 21
    • http://
Using a makefile
« Reply #5 on: May 08, 2005, 02:32:41 am »
No, exactly the same problem I've been having for decades...

"variable 'vtable for wxFrame' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details."

Can I make a quick suggestion?
Maybe minSYS could be a requirement for codeblocks. It should use it instead of the default DOS prompt. It would make cross-platforming a loot easier, since minSYS handles /usr/lib, /usr/include (you know, what you'd do in a linux box).

Also, no more "mingw32-make", just good old "make" :)

Just a thought.

Offline Xorlium

  • Multiple posting newcomer
  • *
  • Posts: 21
    • http://
Using a makefile
« Reply #6 on: May 08, 2005, 02:50:51 am »
Oh, also, now that I'm the business of suggesting things to people who know waaay more than me, some time ago I made a feature request about being able to change the colors of the text in the 'suggested functions' box (you know, when you say Something->" it opens up a list of functions).
The thing is, the text inside that box is black, and if you have your window set to black background (which you change in the control panel), you don't see anything.

I found the solution, just apply the "Control text colour fix for Windows" patch before compiling wxWidgets:
http://www.wxwidgets.org/patch.htm#patches260

So I'll keep waiting for beta 8... :)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Using a makefile
« Reply #7 on: May 08, 2005, 05:02:19 am »
Don't you LOVE those DLL libraries that have to be recompiled for your program to work properly?

Anyway thanks for the tip.

Anonymous

  • Guest
Using a makefile
« Reply #8 on: May 08, 2005, 04:58:44 pm »
I had  can't be auto-imported  and other poblem becuase it was mixing the old header and libbarry files with new ones of wxwidgets.  If you have wxwidgets dev-cpp packages i would suggest you remove them.  And follow the new instruction on "installation form" of the 2.6.0 widgest  Then you can use the template files and create your app in code::blocks.   If you still want to use dev-cpp all you sould need to do it set thing to the wright path  so it find all header, libarry, etc.  copy over the compiler and linker opption and you sould be set.

Offline Xorlium

  • Multiple posting newcomer
  • *
  • Posts: 21
    • http://
Using a makefile
« Reply #9 on: May 09, 2005, 02:06:19 am »
I don't use Devcpp, I use Code::Blocks!!! :)

minipc

  • Guest
Re: Using a makefile
« Reply #10 on: May 13, 2009, 07:02:01 pm »
Can I make a quick suggestion?
Maybe minSYS could be a requirement for codeblocks. It should use it instead of the default DOS prompt. It would make cross-platforming a loot easier, since minSYS handles /usr/lib, /usr/include (you know, what you'd do in a linux box).
in case anyone is still interested in this issue...

on a ms platform, through a process of trial & error, i have discovered that if you install mingw without the mingw32-make option, then install msys, then install code::blocks, code::blocks will use the msys bash shell by default (instead of the ms cmd shell) which deals better with unix style makefiles.  you can subsequently install the mingw32-make package to get the best of both worlds, although it must now, of course, be used from within a cmd shell, rather than c::b.

horses for courses, i guess:)