vc++6.0 authoring, using dynamic libraries and static libraries under Windows

Source: Internet
Author: User

Windows under vc++6.0 Making , working with dynamic libraries and static libraries

First, vc++6.0 making and using static libraries

static library production

1. a new one in vc++6.0 for the Win32 Static Library Project and create a new . cpp and a . h(c++headerfile) files

2..cpp program directly according to the teacher to fight, notice here need to change the wrong, remove (Long)

3. The. h file needs to be written in its own format as follows. Taking head.h as an example

#ifndef _head_h_

#define _head_h_

unsigned long unsgn_pow (unsigned int,unsigned int);

#endif

4.Build

5. a . lib file is generated in the root Debug folder This is the static library we want .

Static library use

1.new a normal blank test CPP file (do not create a new project or you will get an error). Enter the test code. The simpler the test code, the better, the more

The teacher gave the code anyway I didn't read it. I changed the value of the assigned code to enter X, Y.

#include <stdio.h> #include <stdlib.h> #include "head.h" int main (void) {unsigned int x, y;unsigned long res;printf ("Ple input 2 number (int) \ n");scanf ("%d%d", &x,&y);Res =unsgn_pow (x, y);printf ("%u ^%u=%u\n", x, Y, res);Exit (0);}

2. include (#include "head.h") in the test code

3. Add the. lib file that you generated in the object/library module, input---.

(There are countless errors that should be made at once) here are some incorrect debugging methods.

There is no object/library module in the connection bar prompt for Lib not found

You may need to set the correct reference path in Tools/options

vc++6.0 authoring, using dynamic libraries and static libraries under Windows

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.