Pharamond

Hi,

I didní»t know where to post my simple question. I hope there is someone who will answer.

Since today I got the WinDDK, building samples works so the environment is set up properly. Then I just tried to compile a simple C file after certain errors I ended with this:

G:\WinDDK\6001>

cl /IG:\WinDDK\6001\inc\crt G:\tmp\temp8.C /link G:\WinDDK\6001\lib\crt\i386\libcmt.lib G:\WinDDK\6001\lib\crt\i386\oldnames.lib G:\WinDDK\6001\lib\wlh\i386\kernel32.lib

1. Is there a (system-) variable I can change to tell the compiler where it should search for files to be included (In my case just the stdio.h is needed.)

2. Is there a faster way to link to the different libraries

3. How can I use the í░/MTí▒ switch (Error message: LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'.)

Thanks.



Re: Visual C++ General Caní»t use compiler options correctly

Bite Qiu - MSFT

Which version of visual c++ are you using From your description, It is not clear that whether you have to use command line or not, if you have to use command line, then why if you can access the IDE, then these problems should be relatively easy to solve. So please provide more information so that we can better help.

thanks

rico






Re: Visual C++ General Caní»t use compiler options correctly

Holger Grund

Pharamond wrote:

Hi,

I didní»t know where to post my simple question. I hope there is someone who will answer.

Since today I got the WinDDK, building samples works so the environment is set up properly. Then I just tried to compile a simple C file after certain errors I ended with this:

G:\WinDDK\6001>

cl /IG:\WinDDK\6001\inc\crt G:\tmp\temp8.C /link G:\WinDDK\6001\lib\crt\i386\libcmt.lib G:\WinDDK\6001\lib\crt\i386\oldnames.lib G:\WinDDK\6001\lib\wlh\i386\kernel32.lib

1. Is there a (system-) variable I can change to tell the compiler where it should search for files to be included (In my case just the stdio.h is needed.)

Yes, there are environment variables for these things (INCLUDE, LIBPATH, CL, ...) These are typically set by batch files setting up the environment, but you can also set them globally (just be cautios with multiple toolchains installed).

Pharamond wrote:

2. Is there a faster way to link to the different libraries

Do you mean with less typing on the command line You could set the library search path (either via #1 or via a command line switch). Also, the standard compilers emit /DEFAULTLIB directives automatically for certain things and others are lifted implicitly (including all of the libraries you named explicitly). I guess, the DDK toolchain does the same.

Pharamond wrote:

3. How can I use the í░/MTí▒ switch (Error message: LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'.)

Again the same resolution as #2. Set the LIBPATH environment variable or the use the /LIBPATH linker switch.

-hg





Re: Visual C++ General Caní»t use compiler options correctly

Pharamond

Thanks for your replies.

@Bite Qiu

Ií»m a real novice and not compliant with the rules here. I first placed my message to the í░Building Development and Diagnostic Tools for .Netí▒ area because I could not found a proper forum for my question and then someone placed the message here. Actually Ií»m not working with any graphical IDE and for the time being I doní»t want any because I doní»t like this í░remaining under the hoodí▒.

@Holger Grund

Yes I did mean í░less typing on the commandí▒ and there is such a batch file and there are even several shortcuts for the different platforms like Windows 2000, XP, Server 2003 and 2008 calling this file so I thought I need not to care about anything but things didní»t work like I expected them to work. I hope I will not be thrown out by the MSDN community by writing the following . In Java you just need two variables and access to the compiler and you got the full functionality of the standard API therefore I searched the batch file for such (similar) variables to avoid writing out every single search path but the file was really overwhelming, I didní»t know what to extend. Now Ií»ll try your suggestions outíş





Re: Visual C++ General Caní»t use compiler options correctly

Simple Samples

Pharamond wrote:

1. Is there a (system-) variable I can change to tell the compiler where it should search for files to be included (In my case just the stdio.h is needed.)

2. Is there a faster way to link to the different libraries

3. How can I use the í░/MTí▒ switch (Error message: LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'.)

The DDK documentation would answer those questions, but the answers are likely to be brief since the assumption is that you are familiar with VC. There should be something somewhere explaining how to build the samples.

Microsoft has a tendency to provide samples that are built using makefiles. A device driver though can be built using the interactive tools for creating a project and setting the settings (VS 2005 calls settings properties). One of the first things worth learning is how to create a driver project using VS that does not use a makefile. It might take time to learn but it will save time later. I don't know what samples there are in the documentation and such but you could start with a simple "hello" sample. Then try to create a project that uses one of the more advanced samples but get it built without a makefile.






Re: Visual C++ General Caní»t use compiler options correctly

Pharamond

Now it runs. Makefile had been the keyword... it will take me some time to become familiar with it but thats the point.
Thanks everybody