Author Topic: [RESOLVED] Compiling wxWidgets SHARED=0 used with CODEBLOCKS  (Read 11482 times)

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
[RESOLVED] Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« on: February 13, 2006, 11:10:42 am »
Hi

I compile wxWidgets with parameters SHARED=0.
So the folder created is gcc_msw

My compiler is mingw and my IDE Codeblocks.

I cannot compile due many errors
I don't know what are parameters to add.

If someone compile wxWidgets with SHARED=0, can he give me linker and compiler parameters ?
It will be nice..

I've post this before on wxWidgets Forum, but no response, so i try here.

Thanks
« Last Edit: February 13, 2006, 11:32:43 pm by barbarello »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #1 on: February 13, 2006, 11:13:07 am »
Instead of posting, you should use this little search box in the upper right part of the screen. It has been answered so many times...
Be patient!
This bug will be fixed soon...

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #2 on: February 13, 2006, 12:03:52 pm »
That's right, that's what i've done.

And It's not the first time that i've post this question.

Each time I've found link option to lib\gcc_dll\msw but after compiling, the folder name is gcc_msw.
If I link to, i got errors.

I don't understand anything about thoses parameters, I made test without understanding what I do....

If you prefer delete this post, it doesn't matter I still looking for solution with searching tools.  :)

Thanks for your reply

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #3 on: February 13, 2006, 12:15:04 pm »
Hello,

You can have a look at:


And I am quite sure that in wxWidgets package/website there are information on how to build and about the different parameters.

Best wishes,
Michael

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #4 on: February 13, 2006, 12:36:17 pm »
You are really great.

Unfortunatly thoses options are for SHARED=1 and gcc_dll folder.
After compiling I don't have gcc_dll folder...
In first time, I've read wiki codeblocks and wxwidgets (compile with SHARED=1) to use with CodeBlocks and it works fine.

However I need to copy each time wxmsw26_gcc_cb.dll (6 Mo) and mingwm10.dll with my exe (weight under 300Ko...)

So i decided to generate only 1 executable (without dll) even this option will increase his weight.

Since the recompilation of wxWidgets, I can do anything via Codeblocks.

Maybe this post have not his place here.

I 'm going still search by my side.

Thanks for your reply

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #5 on: February 13, 2006, 12:44:34 pm »
However I need to copy each time wxmsw26_gcc_cb.dll (6 Mo) and mingwm10.dll with my exe (weight under 300Ko...)

You can build a static wxWidgets library, instead of dynamic. Then you can distribute your .exe without including the dll. Anyway, the size of the .exe will be bigger than with linking with dll. An idea would be to build wxWidgets non-monolithic, but its seems that there are some issues (it was discussed somewhere in the forum, if I remember correctly).

Michael

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #6 on: February 13, 2006, 01:44:47 pm »
Yes it's exactly what i try to do....with parameters SHARE=0....

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #7 on: February 13, 2006, 01:55:26 pm »
Did you try by using the same parameters as described in one of the topics cited above, but just changing SHARE to 0?

Michael

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #8 on: February 13, 2006, 07:38:56 pm »
So the folder created is gcc_msw
So change every occurence of "gcc_dll" in the build options (linker directories, compiler directories) to "gcc_msw". Or if the directory containing the library files is "gcc_lib", change to that.

Also remove WXUSINGDLL from the #defines.

Compile. Enjoy.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #9 on: February 13, 2006, 08:07:03 pm »
Thanks a lot
I'm going to try this!

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #10 on: February 13, 2006, 08:31:23 pm »
Errors and more errors.

Here is my file. I added everything i've found....I know it's ridiculous, but....
Quote
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="3" />
   <Project>
      <Option title="STATIC" />
      <Option pch_mode="0" />
      <Option compiler="gcc" />
      <Build>
         <Target title="default">
            <Option output="wxwidgets_static_u.exe" />
            <Option type="0" />
            <Option compiler="gcc" />
            <Option includeInTargetAll="1" />
            <Option projectResourceIncludeDirsRelation="0" />
         </Target>
         <Environment>
            <Variable name="WX_CFG" value="" />
         </Environment>
      </Build>
      <Compiler>
         <Add option="-pipe" />
         <Add option="-mthreads" />
         <Add option="-Winvalid-pch" />
         <Add option="-D__GNUWIN32__" />
         <Add option="-D__WXMSW__" />
         <Add option="-DwxUSE_UNICODE" />
         <Add directory="I:\wxWidgets-2.6.2\include" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx" />
         <Add directory="I:\wxWidgets-2.6.2\contrib\include" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx\msw" />
         <Add directory="I:\wxWidgets-2.6.2\build\msw\gcc_msw" />
      </Compiler>
      <ResourceCompiler>
         <Add directory="I:\wxWidgets-2.6.2\include" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx\msw" />
         <Add directory="I:\wxWidgets-2.6.2\build\msw\gcc_msw" />
      </ResourceCompiler>
      <Linker>
         <Add library="wxmswu" />
         <Add library="winspool" />
         <Add library="winmm" />
         <Add library="shell32" />
         <Add library="comctl32" />
         <Add library="ctl3d32" />
         <Add library="odbc32" />
         <Add library="advapi32" />
         <Add library="wsock32" />
         <Add library="opengl32" />
         <Add library="glu32" />
         <Add library="ole32" />
         <Add library="oleaut32" />
         <Add library="uuid" />
         <Add directory="I:\wxWidgets-2.6.2\lib" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx" />
         <Add directory="I:\wxWidgets-2.6.2\include\wx\msw" />
         <Add directory="I:\wxWidgets-2.6.2\build\msw\gcc_msw" />
      </Linker>
      <Unit filename="main.cpp">
         <Option compilerVar="CPP" />
         <Option target="default" />
      </Unit>
   </Project>
</CodeBlocks_project_file>

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #11 on: February 13, 2006, 08:51:46 pm »
Quote
...
<Target title="default">
  <Option output="wxwidgets_static_u.exe" />
...

May be I am wrong but do you have set the output as .exe? It should be .a (static library) :?. You cannot have wxWidgets as .exe.

Michael

Offline barbarello

  • Multiple posting newcomer
  • *
  • Posts: 19
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #12 on: February 13, 2006, 08:58:26 pm »
OK you are really nice guys !

I thanks you all

But it's boring me, and i will continue to works with DLL separatly.
I really understand anything of IDE compilating parameters (surely because it's not interest me  :lol: ).

Thanks for your replies :D

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #13 on: February 13, 2006, 09:24:44 pm »
May be I am wrong but do you have set the output as .exe? It should be .a (static library) :?. You cannot have wxWidgets as .exe.
According to his first post, he's already successfully compiled wxWidgets, and is now trying to compile a program using wxWidgets.

barbarello, there are several things wrong I see in your project's options:
  • WX_CFG is empty, but wxUSE_UNICODE is defined. If you're using a Unicode build of wxWidgets (you compiled wxWidgets with UNICODE=1), then WX_CFG should usually be set to "u". Conversely, if your wxWidgets build is not unicode, then you should delete the wxUSE_UNICODE line from your #defines.
  • You're using some incorrect include and library directories. Your include directories should be "I:\wxWidgets-2.6.2\include", "I:\wxWidgets-2.6.2\contrib\include", "I:\wxWidgets-2.6.2\lib\gcc_lib\msw"; your library directory should be "I:\wxWidgets-2.6.2\lib\gcc_lib". If you're using a unicode build, use "mswu" instead of "msw". You don't need any other directories.
  • You aren't linking with the wxWidgets static library. Add "wxbase26" and "wxmsw26" to your link libraries if you did the standard wxWidgets build, or "wxmsw26" if you did a monolithic wxWidgets build. You shouldn't need any of the other libraries you have.
Cheers,
JohnE
« Last Edit: February 13, 2006, 09:37:42 pm by TDragon »
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Compiling wxWidgets SHARED=0 used with CODEBLOCKS
« Reply #14 on: February 13, 2006, 10:03:25 pm »
@barbarello

give the attached project a try, it should build quite nice (at least it does for me)
if your wx-widgets directory is "I:\wxWidgets-2.6.2"

build the wxRelease target only, if you don't have a debug-version of wxWidgets.

good luck, tiwag

[attachment deleted by admin]