.h files are includes in .c files
// myfile.c
//
#include "myheader.h"
// rest of c program here
Then run your compiler against all the *.c files. It will create *.obj files which can be used by the linker to create the executable file.
Beyone that, how to do all the above depends on the compiler and operating system you are using.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
What compiler are you using? If you use Microsoft Visual C++ 2005 Express, the download includes project files.
If that is your compiler, then the compiler will spew out a whole bunch of warnings about using deprecated C functions. you can disable the warning with a pragma. put this at the top of link-includes.h. Otherwise everyting compiled and linked ok for me using VC Express compiler.
#pragma warning(disable: 4996)
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Don't laugh at me.
I am using turbo c compiler. It is an ancient software.
I also try to use Borland 5.5. But that gives many error when I compile .c file.
:cheesy: :cheesy: :cheesy: :cheesy: :cheesy: :cheesy: :cheesy:
trash those old ancient compilers! you can get pretty goodfree compilers, such as the Express I mentioned previously or Dev-C++ from www.bloodshed.net .
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
You are also ancient dragon.
Are you good?
It is just joke.
Please guide me.
Sorry -- I couldn't resist the laughter.
you cannot use TC because it is too old and does not know about long file names -- file names that are longer than 8 characters followed by a perios and 3 characters for the extension. That is the ancient MS-DOS format. The files in the download you are trying to compile have long filenames.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
>> would like to test that api program in c, not vc.
you won't test it with Turbo C. See my previous post (I changed it so you might have to re-read it)
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
first you have to know how to create projects with that compiler. You cannot use just one of the *.c files from that library, but you have to compile all of them and link them all together. There are 29 *.c files that you must compile and link together. If that is a command-line driven compiler you will probably have to create a makefile that contains all the instructions your compiler needs to compile all those *.c files and create the executable program. If you would get the free copy of VC the IDE will do that for you. If you have IDE with Borland then it might do it too.
You should not have copied the *.h files into your compiler's include directory. That directory should just contain the files that are supplied by your compiler. Compilers have options to tell it where else to look for include files. VC++ has -I flag, such as "I\c:\mydirectory\include" will tell the compiler other .h files are located.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Remove the files you copied into the bcc5/bin and include directories and try following steps below. I used the Visual Studio Command line so the compiling commands in bcc may be different.
1. Extract all the files to any directory you want. I used a directory called lnk41b so the directory tree was like this.
lnk41b
├─data
│ └─words
├─Debug
├─include
├─Release
└─src
2. open the link-includes.h file and add the following lines and save.
///////////////// Add these lines
#ifndef WIN32
#define WIN32
#endif
////////////////////////////////////////////
#ifndef _LINKINCLUDESH_
#define _LINKINCLUDESH_
3. move the following files in the src directory to another directory. Dont delete them you will need them later.
api-example.c
constituent-example.c
www-parse.c
4. Go to the src directory in the command-prompt and compile the remaining files in the src folder as folllows.
src> cl /EHsc *.c /I ..\include
5. move the api-example.c file back into the src directory.
6. delete the parse.obj file in the src directory.
7. compile the api-example.c file as follows.
src> cl /EHsc api-example.c /I ..\include /link *.obj
8. Copy the contents of the data directory to the src directory.
9. run the api-example.exe file in the command-prompt.
src> api-example.exe
I am from a developing country
where are you from? :cheesy:
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
Moe: does that Borland 5.5 compiler support long filenames (it too is pretty old) If it does NOT then you will have to get a different compiler. Otherwise if it does then it should be ok.
Ancient Dragon
Retired & Loving It
30,050 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343