Zipping files

This is a discussion on Zipping files within the C Programming forums, part of the General Programming Boards category; I added them in my MSVC++ include directory and they are seen. However, when I compile I get 57 errors ...

  1. #16
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    I added them in my MSVC++ include directory and they are seen. However, when I compile I get 57 errors in those header files.

    Why wouldn't you keep the header files local to your project? If you package it up, won't you need to include those as well?

  2. #17
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    using libraries is usually simple.
    1) ensure headers are where they should be. Thats in your include dir or a sub-dir of it.
    2) either add the .lib to your project or add it in your libraries section of project options.

    Thats normally enough. The header files declare functions that are implemented in the .lib and your compiler should be able to find the functions implementation now.

    As for putting those headers in your source directory it is not necessary. The only headers in your source directory should be ones you have written yourself for your own classes usually.

    What are the errors you are getting?
    Have you tried adding the dll to the project too? you probably dont need to do that but it might do the trick.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #18
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Thanks for the explaination!

    What I've currently done is create a lib directory in my project file structure (/projectRoot/lib/). In there I've added the .lib and .dll files from zlib. Then, I went into VC and did Project -> Add to Project -> Files and selected both of those files (.lib and .dll). I'm still getting the errors as mentioned above.

    About the errors, they look like syntax errors in the header files themselves. Here are a few examples...

    Code:
    Compiling...
    main.c
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2143: syntax error : missing ')' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2143: syntax error : missing '{' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2059: syntax error : ')'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2061: syntax error : identifier 'OF'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2059: syntax error : ';'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(34) : error C2146: syntax error : missing ')' before identifier 'opaque'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2143: syntax error : missing ')' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2143: syntax error : missing '{' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2059: syntax error : ')'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2061: syntax error : identifier 'OF'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2059: syntax error : ';'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(35) : error C2146: syntax error : missing ')' before identifier 'opaque'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2143: syntax error : missing ')' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2143: syntax error : missing '{' before '*'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2059: syntax error : ')'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2061: syntax error : identifier 'OF'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2059: syntax error : ';'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(36) : error C2146: syntax error : missing ')' before identifier 'opaque'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(37) : error C2061: syntax error : identifier 'OF'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(37) : error C2059: syntax error : ';'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(37) : error C2146: syntax error : missing ')' before identifier 'opaque'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(38) : error C2061: syntax error : identifier 'OF'
    c:\program files\microsoft visual studio\vc98\include\ioapi.h(38) : error C2059: syntax error : ';'

  4. #19
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    yep they certainly look like syntax errors. I thought you would be having linking errors. Id say you have 3 choices. Either try to fix the code yourself, or find a port of it for your specific compiler, or email the code authors to ask about the problems.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #20
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Originally posted by Stoned_Coder
    yep they certainly look like syntax errors. I thought you would be having linking errors. Id say you have 3 choices. Either try to fix the code yourself, or find a port of it for your specific compiler, or email the code authors to ask about the problems.
    I think option 1 is def out. I'm not sure what you mean by option 2. I'll probably end up going with option 3. I went to the zlib website, where you can download the source. In their FAQ, it gives you a site were you can get a precompiled windows dll. So I went ahead with that and in their package, you get the lib, dll, and h files. I'll probably email the guy giving out the windows dll first. Maybe I should try and compile the source myself. :dunno:

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Create Copies of Files
    By Kanshu in forum C++ Programming
    Replies: 13
    Last Post: 05-09-2009, 07:53 AM
  2. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  3. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  4. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM
  5. Folding@Home Cboard team?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 398
    Last Post: 10-11-2005, 08:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21