Click to See Complete Forum and Search --> : Linker errors
Vaderman
July 15th, 2004, 09:02 AM
I'm having extreme problems in porting my code to VC 7 (from VC 6) mainly regarding linker errors.
Does anyone know why I'm getting errors that :
1) Cannot find PCH files and
2) why it cannot find obj files
My project within VC 6 compiles beautifully and without linker errors but porting it over to VC 7 is like a dogs dinner!! never have i encountered so many problems in doing, in the words of M$, a reletively easy task!
Regards
John
notyetguru
July 16th, 2004, 02:29 AM
try to delete ure release folder made up by VC6 and recompile the whole thing with vc7. do the same for debug built if ure also interested to compile and link for debug.
Vaderman
July 16th, 2004, 03:56 AM
I've deleted all the Release and Debug directories and just imported my source files but it still gives me errors about missing PCH files. I ended up having to do a quick fix in my Property setup in that I've set up the option of Generate Preprocessed File with the flag set to Without Line Numbers ( /EP /P). This can be found in Configuration Properties ->C++->Preprocessor. If I remove this flag it complains like 'ell!!
Also, I'm getting LINK : error LNK2001: unresolved external symbol _wWndMainCRTStartup. It had originally been set up as WndMainCRTStartup.
I have no idea as to why its throwing up all these problems. Microsoft stated that porting legacy code was easy!! YEAH, RIGHT!
notyetguru
July 16th, 2004, 04:31 AM
when u started ure app in vc6, did u check shared dll option or used statically link dll. it's possible that ure app, when ure trying to build it in vc7 is unable to link to one or more dll's that u used in vc6.
i never tried to convert from vc6 to vc7, but i encountered some similar linking problems.
Vaderman
July 16th, 2004, 05:56 AM
I have about 40+ projects within a solution and 39 of these are statically linked Dlls, but I don't understand why the options should all of a sudden throw up a linker error of WndMainCRTStartup from within my main project. :confused:
Any Ideas, as I've completely run out of them!
MrViggy
July 16th, 2004, 11:59 AM
Did you just open the VC6 DSW file? Or, did you create a new project in VC7, then add all your source files?
It sounds like there is a project setting "mismatch" between the VC6 and VC7 versions. I've upgraded a number of projects, and it was as easy as opening the DSW in VC7, and letting Visual Studio do all the "conversion".
Viggy
Vaderman
July 16th, 2004, 12:05 PM
I created a new project in VC7 and added the source files, and projects. A colleague of mine has done the same and he's got it to work first time! :o so I dunno wots the difference as I've had a look at his property settngs and they match!
MrViggy
July 16th, 2004, 12:39 PM
Well, then you really shouldn't be complaining about "upgrading" from VC6 to VC7. You're not upgrading anything, you're trying to compile older source code on a new compiler.
Go back to your original VC6 project, and open the DSW file inside of VC7. This should import all of the project settings properly, converting settings where it needs to.
Viggy
MrViggy
July 16th, 2004, 12:42 PM
Just to add: If opening the DSW inside VC7 doesn't work, then consider starting over from the "New Project" wizard. You're making your job harder then it really is.
Viggy
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.