help with VC++

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
tadada
Posts:7
Joined:Sat Apr 19, 2008 8:15 pm
help with VC++

Post by tadada » Sat Apr 19, 2008 8:24 pm

I started OS development a little bit ago. Your tutorials are GREAT! When stuff in other tutorials didn't make sense your tutorials did.

I'm on " Operating Systems Development - Errors, Exceptions, Interruptions " (number 15) and when I go to compile I can't. VC++ExpressEdition says it says "LINK : fatal error LNK1181: cannot open input file 'user32.lib'"

I believe that the offending part is in the linking options with this command line of the lib part of the project: /ALIGN:512 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib. I suspect it needs all of them.

I found all of these libs in a SDK made by microsoft. The problem is how do I add them so it can find them when it goes to link.

Can anyone help me?

BTW: I had to skip trying tutorial 14 for the same reason.

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: help with VC++

Post by Mike » Sat Apr 19, 2008 11:51 pm

tadada wrote:VC++ExpressEdition says it says "LINK : fatal error LNK1181: cannot open input file 'user32.lib'"
It might be a project configuration problem. Or, rather, I hope so.

What happens if you try the project download in tutorial 14? (Assuming you are working on your own implementation)? i.e., download the demo and attempt to build it.
tadada wrote:/ALIGN:512 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
I personally do not like the ALIGN flag, but it should not effect your current problem. Everything else here is fine (Assuming that this is not the entire linker command line, anyways).
tadada wrote:BTW: I had to skip trying tutorial 14 for the same reason.
Just to make things easier for debugging, lets try to get this working with Tutorial 14 first :) Tutorial 15
uses Tutorial 14's code, so if we cannot get it working with Tutorial 14, it won't work for any later tutorial.

pathos
Moderator
Posts:97
Joined:Thu Jan 10, 2008 6:43 pm
Location:USA

Post by pathos » Sat Apr 19, 2008 11:52 pm

Well, I'm sure there's a way to fix it, but...

As for me, I had the same problem, and I just removed them from the command line. I'm not sure if that's the best way to do it though -- it may come back to haunt me one day.

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Sun Apr 20, 2008 12:06 am

pathos wrote:Well, I'm sure there's a way to fix it, but...

As for me, I had the same problem, and I just removed them from the command line. I'm not sure if that's the best way to do it though -- it may come back to haunt me one day.
Hm... Thats a nice solution :)

Considering that we never reference those libraries (as we cannot use Win32), I might remove those from the demos so no one runs into this problem again. Assuming this resolves the problem, anyways.

tadada
Posts:7
Joined:Sat Apr 19, 2008 8:15 pm

Post by tadada » Sun Apr 20, 2008 1:11 am

I'll try tutorial 14 again. If it doesn't work then I'll remove them.

EDIT: Indeed removing the /align 512 and the file names did allow it to compile but now I don't know how to use my compiled kernel. Also removing the same thing in tutorial 15 fixed it too. In the folders the closet I get is the KRNL.dll.intermediate.manifest
Image

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Post by Mike » Sun Apr 20, 2008 2:01 am

tadada wrote:EDIT: Indeed removing the /align 512 and the file names did allow it to compile but now I don't know how to use my compiled kernel.
After linking the kernel, it should be in a:\KRNL.dll

Use the bootloader from Stage 15 not 14 (Tutorial 15 includes a bug fix. 14 needs to be updated) to load and execute the kernel, and everything should run fine.

Please let us know if you run into problems :)

(Also, Tutorial 16 should be out very soon. It brings everything from the PIC and PIT tutorials together. I am also considering a small command-line interface)

Post Reply