Compiling with MSVC++ Toolkit: Tutorial bug?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Compiling with MSVC++ Toolkit: Tutorial bug?

Post by ionstream » Thu Mar 24, 2005 3:42 pm

Note that I am new to wxWidgets, but not C++.

I've been ripping my hair out trying to compile wxWidgets using MS's Free Toolkit. I followed this wiki tutorial:

http://wiki.wxwidgets.org/wiki.pl?Insta ... Free_Tools

I have the Platform SDK, and the toolkit. All the the variables are set.Nmake says "NMAKE : fatal error U1052: file 'cleanall' not found. Stop." Can someone explain this?

I remove the cleanall parameter, and sure enough, it compiles. wxmsw.lib is created. Now, compiling the samples:

The tutorial tells me that the first thing to do to compile the samples is to type:

c:\program files\microsoft sdk\setvars.bat /RELEASE

The cmd says "C:\program is not recognized..." So I quote the path. Next, setvars.bat is not even a file. I thought that whoever wrote this actually meant "setenv.bat". It runs, but does not understand the /RELEASE command. It gives me the "proper usage" message.

I forget that, and continue with the rest of the tutorial. I get about 20 linker errors. Unresolved symbol __fto12, whatnot.

Reading down, the tutorial says, "The most recent Platform SDK no longer includes the Win64 directory, and does not come with nmake.exe. However the .NET SDK does include nmake.exe."

Well, I HAVE nmake, so maybe I'm using too old of a version? Is the lib compiling right at all? Thank you for your help.

User avatar
T-Rex
Moderator
Moderator
Posts: 1195
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex » Thu Mar 24, 2005 4:36 pm

Hm, ... everything works fine for me when using DOS path

1. Run cmd
2. cd \
3. dir /D/X
4. Find DOS path for "Program Files" in output (my path is PROGRA~1)
5. cd PROGRA~1
6. dir /D/X
7. Find DOS path for "Microsoft SDK" in output (my path is MIFD68~1)
8 Run bat-file using DOS path (c:\progra~1\MIFD68~1\setenv.bat /XP32 /RETAIL)

ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Post by ionstream » Thu Mar 24, 2005 6:48 pm

Well, I can get setenv.bat to work with /RETAIL, but there's no setvars.bat with /RELEASE.


Do I need to link with the standard windows libraries in order for wxMsw to work?

ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Post by ionstream » Fri Mar 25, 2005 4:32 am

Please, I don't usually bump my posts, but this is infuriating! No matter what I do, I can't get the samples to compile, and I can't build any projects that use the wxWidgets lib that the toolkit makes. Why doesn't the wxWidgets setup come with the libraries like it used to?

How do I use the commands in the makefile, like "clean" and "cleanall"?

Here are the errors when compiling the samples:

Code: Select all

        link @C:\DOCUME~1\DJTurpin\LOCALS~1\Temp\nma03860.
LINK : warning LNK4098: defaultlib "MSVCRTD" conflicts with use of other libs; u
se /NODEFAULTLIB:library
wxmswd.lib(app.obj) : error LNK2001: unresolved external symbol "void * __cdecl
operator new[](unsigned int)" ([email protected]@Z)
wxmswd.lib(utils.obj) : error LNK2001: unresolved external symbol "void * __cdec
l operator new[](unsigned int)" ([email protected]@Z)
wxmswd.lib(app.obj) : error LNK2001: unresolved external symbol "void __cdecl op
erator delete[](void *)" ([email protected]@Z)
wxmswd.lib(utils.obj) : error LNK2001: unresolved external symbol "void __cdecl
operator delete[](void *)" ([email protected]@Z)
wxmswd.lib(imagxpm.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(datetime.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(scrlwing.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(paper.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(layout.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(ownerdrw.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(timercmn.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(imagbmp.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(image.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(dc.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(dcbase.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(slider95.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(utilscmn.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(sizer.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(statusbr.obj) : error LNK2001: unresolved external symbol __ftol2
wxmswd.lib(font.obj) : error LNK2001: unresolved external symbol __ftol2
arttest.exe : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.
Can someone please explain them to me? Why is MSVCRTD conflicting other libraries? Using the nmake from the .NET SDK does the same thing. Please help me, I'll give you a cookie :?.

User avatar
T-Rex
Moderator
Moderator
Posts: 1195
Joined: Sat Oct 23, 2004 9:58 am
Location: Zaporizhzhya, Ukraine
Contact:

Post by T-Rex » Fri Mar 25, 2005 8:33 pm

Hm.. Wiki says that
Note that the free tools don't seem to have the debugging libraries, so you can't do BUILD=debug. However, you can catch wxWidgets Debug messages and wxAsserts by adding DEBUG_INFO=0. You can debug the wxWidgets library and your programs and link to the release system librarires using
So, if your wx library was compiled with
BUILD=release SHARED=0 RUNTIME_LIBS=static
flags, then you must use them when compiling your applications

I've tried to build wx library with MSVC2003 Toolkit. The library was built successfully, but when I try to build samples, linker can't find wxmsw25_core.lib
LIBPATH variable is OK, it contains the path to vc_lib directory
I really don't know why it can't find *.lib files[/quote]

ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Post by ionstream » Sat Mar 26, 2005 2:54 am

Sweet mother of mercy I fixed it!

Here was my problem. I had an installation of Microsoft Visual C++ 6 Intro Edition. This had many, many environment variable problems. I uninstalled that, and it couldn't find nmake and lib. They were in the .NET SDK and the win64 directory, so no worries. Recompiling wxWidgets, and sure enough, it works! I've never been more ALIVE! (well, happy anyways.)


I also figured out how to use "clean", you need the -f parameter in front of "makefile.vc" so that nmake knows to use that file, and that "clean" is a parameter. Nifty!

ionstream
Earned a small fee
Earned a small fee
Posts: 23
Joined: Wed Jan 05, 2005 6:49 pm

Post by ionstream » Sat Mar 26, 2005 3:24 am

One last question, does anybody know the option to not include the standard libraries? Codeblocks keeps saying that MSVCRT is confliction with wxMsw.

EDIT: Never mind, I use /NOD:libc, which cause ADVAPI.dll and WSOCK32.dll to be discarded by /opt:ref...

EDIT (again): All is well in ionstream ville! I upgraded to 2.5.4 and fixed all of the problems! Now you guys don't have to help anymore, since sooo many of you were eager to respond...

Nodody gets the cookie.

Post Reply