News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Endless problems with wxwidgets

Started by nc3b, January 26, 2008, 03:27:49 PM

Previous topic - Next topic

nc3b

Hello everyone. I really like codeblocks (I used to use the old version for small c++ programs). So I downloaded a nightly build, a recent one, and I read about wx support (wxsmith and so on). So I downloaded wxPack and installed it and tried to build an application. I am using visual c++ 2008 express. So first time when I get to the wx library setting I select nothing and move on. I am presented with the very nice wxSmith gui builder and I just click "build". And boom. 33 unresolved externals. I looked around on this forum and saw I have to remove msvcrt or something like that and I did what it said. It still did not work, saying something about double declare _free.. I am getting so confused. Can anyone help me?

Fozzybear

Do you have a particular reason to use Visual C++ instead of MinGW? I believe it's possible to compile wx apps in VCC but MinGW is much easier. I would suggest you try this first and check your paths to wxPack and MinGW.

stahta01

You should be able to use visual c++ 2008 express, but wxWidgets needs to be complied using visual c++ 2008 express. I do not think wxPack does this at the current point in time.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

thomas

Quote from: stahta01 on January 28, 2008, 01:19:39 AMYou should be able to use visual c++ 2008 express, but wxWidgets needs to be complied using visual c++ 2008 express. I do not think wxPack does this at the current point in time.
Right.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

nc3b

I did manage to compile stuff using code blocks, but I had to do some adding and removing of libraries. I had to remove mscvrt and set it to nodefault, and in a certain configuration I had to manually add wxpng, wxtiff and so on.  :)
It really was a pain (and I am not lazy :wink:). The reason I wanted to use vcc this time is that mingw produces so much larger executables, it's almost obscene:)). Leaving the joke behind, I really think that visual c++ 2008 express comes with a rather capable compiler. Until I find I bugging, I will use it from time to time.

Nice work with codeblocks, keep it going that way, I'm really looking forward for a nice linux IDE. Cheers. :D

P.S since I already opened a post, can you also tell me about some good networking examples with wxwidgets? Thank you.

denk_mal

Quote from: nc3b on January 28, 2008, 10:51:55 PMThe reason I wanted to use vcc this time is that mingw produces so much larger executables, it's almost obscene:)).
This is wrong because you have to install the runtime environment for apps compiled on vcc. Or in other words if you write an portable application - as I do - you can't use vcc.

greetings
denk_mal

troels

Quote from: denk_mal on January 29, 2008, 07:41:11 AM
This is wrong because you have to install the runtime environment for apps compiled on vcc
You are wrong if you are talking about deployment:
It is the other way around. MinGW always links dynamically to the CRT (msvcrt.dll or whatever). In VC you can specify to link the CRT statically -> no particular dll dependencies at all.

Troels

denk_mal

Quote from: troels on January 29, 2008, 08:06:53 AM
Quote from: denk_mal on January 29, 2008, 07:41:11 AM
This is wrong because you have to install the runtime environment for apps compiled on vcc
You are wrong if you are talking about deployment:
It is the other way around. MinGW always links dynamically to the CRT (msvcrt.dll or whatever). In VC you can specify to link the CRT statically -> no particular dll dependencies at all.

Troels

I am not talking about development, I am talking about the standard user and for the standard user you have to install the Microsoft Visual C++ 2005 Redistributable Package if you have an application deveoped with M$VC express
AFAIK Linking the CRT statically dosn't work on the Express version of VC

denk_mal

troels

Quote from: denk_mal on January 29, 2008, 08:53:09 AM
I am talking about the standard user
Indeed, deployment.

Quote from: denk_mal on January 29, 2008, 08:53:09 AM
AFAIK Linking the CRT statically dosn't work on the Express version of VC
I know it does because I use it, VC6-VC7-VC8 Express -VC9 Express.

Please check your information before posting.
Please stop spreading misinformation.

denk_mal

Quote from: troels on January 29, 2008, 09:12:05 AM
Quote from: denk_mal on January 29, 2008, 08:53:09 AM
I am talking about the standard user
Indeed, deployment.

Quote from: denk_mal on January 29, 2008, 08:53:09 AM
AFAIK Linking the CRT statically dosn't work on the Express version of VC
I know it does because I use it, VC6-VC7-VC8 Express -VC9 Express.
Could you please tell me how you do this? We're here working on a plattformindepended project
(win/linux/mac) and some of us want to use VC on Windows instead of gcc (the debugger is smarter)
Quote
Please check your information before posting.
Please stop spreading misinformation.

http://www.microsoft.com/Downloads/details.aspx?FamilyID=32bc1bee-a3f9-4c13-9c99-220b62a191ee&displaylang=en
You should post your solution to Microsoft also. They even don't know the trick :)

denk_mal

troels

Quote from: denk_mal on January 29, 2008, 10:12:22 AM
Could you please tell me how you do this?

The /MT compiler option:
Properties->C/C++->Code Generation->Runtime library->Multithreaded (/MT)
Using /MT, "Microsoft Visual C++ 200X Redistributable Package" is not needed, for deployment.

The CRT gets statically linked to your executable, an option MinGW sadly cannot offer, because the CRT code is proprietary.

Quote from: denk_mal on January 29, 2008, 10:12:22 AM
You should post your solution to Microsoft also. They even don't know the trick :)
This is not a "solution", it is a regular compiler option.

Quote from: denk_mal on January 29, 2008, 10:12:22 AM
They even don't know the trick :)
Sure they do. Most VC users know too.

Troels

denk_mal

On a logical base this semms to be a real and correct solution.
I've tried it on a 'short jump' in my project and got a lot of unreferenced symbols
(including unresloved external reference wxStringData::Free(void) )
but I'll tried again when I have more time.

thanks
denk_mal


JGM

Quote from: nc3b on January 28, 2008, 10:51:55 PM
The reason I wanted to use vcc this time is that mingw produces so much larger executables, it's almost obscene:)).

A dirty solution would be to use upx ( http://upx.sourceforge.net/ ) only adds a little overhead for decompressing the real executable.

nc3b


Belgabor

Indeed upx does wonders for wxWidgets/MinGW programs. The overhead might actually be offset by the time you save loading the file from hd.