Page 1 of 2

WxWidgets 2.6.2 and Visual Studio.net 2003

Posted: Fri Jan 20, 2006 3:32 am
by Seth Shapiro
Hi all.

Totally green here. Very very green! :)

Trying to set everything up, Wxwidgets and Visual Studio.net 2003 Following the cross-platform book instructions.

Here is my dilemma.

I am getting the below error
fatal error LNK1104: cannot open file 'wxmsw26d_core.lib;'

Okay, I understand that its either:
1) Libraries haven

Posted: Fri Jan 20, 2006 4:28 am
by cpp
You need to compile the library before you use it. See the install.txt file in the wxWidgets folder.
For the rest of the setup, check out the following topic
http://forums.wxwidgets.org/viewtopic.php?t=4388
HTH
Welcome to wxWidgets!

Posted: Fri Jan 20, 2006 4:33 am
by metalogic
You should look around these forums for links to beginner tutorials. That's your best bet.

Anyhow, what you need to do is build the libraries first. You will find
C:\wxWidgets-2.6.2\build\msw\wx.dsw

Open that (it's a 6.0 version so VC++ 2003 will ask if you want to convert, say yes). Then Build->Build Solution.

That will create your .lib files. Then you will have to setup your project to point to the right directories, etc. Like I said, you can find that in the tutorials (there are a handful).

Posted: Sat Jan 21, 2006 1:56 am
by CorsairX
Ah, a perfect guinea pig :lol:

I was recently having problems with wxWidgets and VS Studio 2003 and put a tute together - http://members.iinet.net.au/~corsairx/m ... VS2003.pdf

It might help; and I'd appreciate any feedback

Posted: Sat Jan 21, 2006 6:57 am
by cpp
Very nice work CorsairX! i wish i saw something like this when i started in wxWidgets :D

One question tho, whats with the NOPCH preprocesor definition in debug mode?

Posted: Sat Jan 21, 2006 10:04 pm
by Seth Shapiro
Thanks for the tutorial. I built it and am getting one error.

Page 8 of your tutorial, shows the code I copied, if for the HelloWorldApp.cpp code.

c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\wxDemo\HelloWorldApp.cpp fatal error [C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory

I do have that file, wxprec.h, in my C:\wxWidgets-2.6.2\include\wx folder

Any ideas about this error? Am I not linking something properly?



[/b]

Posted: Mon Jan 23, 2006 6:55 pm
by Ksmith22
Seth Shapiro wrote:Thanks for the tutorial. I built it and am getting one error.

Page 8 of your tutorial, shows the code I copied, if for the HelloWorldApp.cpp code.

c:\Documents and Settings\Owner\My Documents\Visual Studio Projects\wxDemo\HelloWorldApp.cpp fatal error [C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory

I do have that file, wxprec.h, in my C:\wxWidgets-2.6.2\include\wx folder

Any ideas about this error? Am I not linking something properly?
[/b]
Try instead:

Code: Select all

#include <wx/wxprec.h>
It has been my experience (with VS .NET 2003 at least) that anything not in the immediate directory (or accessed from the immediate directory) needs to use < > brackets rather than quotes.

Posted: Mon Jan 23, 2006 9:34 pm
by Seth Shapiro
Try instead:

Code: Select all

#include <wx/wxprec.h>
Thanks but that didnt do the trick. I tried that previously with no luck.

I am still getting the same error message fatal error [C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory

Seems like something isnt linked properly? I am dumbstruck

Posted: Mon Jan 23, 2006 9:49 pm
by metalogic
Right click on your project and select Properties. From there go to Configuration Properties -> C/C++ -> General
Make sure that under Additional Include Directories you have the wxWidgets directory. Something like this:
C:\wxWidgets-2.6.2\include
C:\wxWidgets-2.6.2\lib\vc_lib\msw

Posted: Tue Jan 24, 2006 2:16 am
by Seth Shapiro
Metalogic, good call! I had "app" in my path, like "C:\app\wxWidgets-2.6.2\include" , so I removed it and the error disapeared

I am slowly but surely working through to my first WxWidgets program.

Now I have a new fatal error, wxDemo fatal error LNK1104: cannot open file 'wxmsw26d_core.lib;'

My path for that library is

Code: Select all

C:\wxWidgets-2.6.2\lib\vc_lib\wxmsw26d_core.lib
Not sure why I am getting the fatal error[/code]

Posted: Tue Jan 24, 2006 8:14 am
by Vexator
you do not only have to specify the additional include directories, but also the additional linrary directories :) it's in the linker options.

Posted: Tue Jan 24, 2006 9:48 am
by metalogic
Like Vexator said, you also need to setup the additional include directories:

Right click on your project and select Properties. From there go to Configuration Properties -> Linker -> General
Make sure that under Additional Library Directories you have the wxWidgets directory. Something like this:
C:\wxWidgets-2.6.2\lib\vc_lib

Posted: Fri Feb 03, 2006 3:25 pm
by CorsairX
Hi all,
Sorry for the delay in responding
cpp wrote:Very nice work CorsairX! i wish i saw something like this when i started in wxWidgets :D

One question tho, whats with the NOPCH preprocesor definition in debug mode?
It disables the use of pre-compiled headers which may interfere with debugging (or so I'm told - I've personally never had any trouble with it)
Ksmith22 wrote:It has been my experience (with VS .NET 2003 at least) that anything not in the immediate directory (or accessed from the immediate directory) needs to use < > brackets rather than quotes.
Again not something I've run into personally, but I've run into VS 2003 wackiness to believe it!

I'm going to clarify a couple of points in the tutorial based on the above, then I'll update it - also see if I can tidy up the wiki entry a little.

Posted: Tue Feb 07, 2006 4:50 pm
by CorsairX
CorsairX wrote:Hi all,
Sorry for the delay in responding
cpp wrote:Very nice work CorsairX! i wish i saw something like this when i started in wxWidgets :D

One question tho, whats with the NOPCH preprocesor definition in debug mode?
It disables the use of pre-compiled headers which may interfere with debugging (or so I'm told - I've personally never had any trouble with it)
Just a quick note: Some equally quick tests shows that NOPCH prevents the use of MS precompiled headers - failing to do this may give you linking problem when build your project

Posted: Sat Feb 11, 2006 10:35 am
by engineer
I usually run in those problems, when installing a new version of wxWidgets, no matter wich IDE I use. I have to recompile th libs a several times before it works, however. Still did not figure out, what I am doing wrong. :?