Skip to content

Multiple linker errors in VisualStudio #37

@GoogleCodeExporter

Description

@GoogleCodeExporter
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions