lambdaX / miniz

Automatically exported from code.google.com/p/miniz
0 stars 0 forks source link

Multiple linker errors in VisualStudio #37

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Create new console project in VisualStudio2012
2.Add miniz.c and main.c
3.Addd "#include 'miniz.c' " before "main" function

What is the expected output? What do you see instead?
Expected-compilation success.Instead I am getting:

1>miniz.obj : error LNK2005: _mz_zip_reader_extract_to_mem_no_alloc already 
defined in main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_file_stat already defined in 
main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_get_filename already defined in 
main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_get_num_files already defined in 
main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_init already defined in main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_init_file already defined in 
main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_init_mem already defined in main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_is_file_a_directory already defined 
in main.obj
1>miniz.obj : error LNK2005: _mz_zip_reader_is_file_encrypted already defined 
in main.obj

etc.. 

Also,if I use prebuilt VS project which come with the library,it compiles and 
works fine.The problem only appears in a new project.

What version of the product are you using? On what operating system?

Windows7 64bit  VisualStudio 2012

Please provide any additional information below.

Original issue reported on code.google.com by michael....@idomoo.com on 14 Oct 2014 at 1:23

GoogleCodeExporter commented 9 years ago
Ok,please discard the issue.I excluded the miniz.c from the build and it 
compiled.

Original comment by michael....@idomoo.com on 14 Oct 2014 at 1:38