简体   繁体   中英

Freeimage ANSI C Codeblock Windows - linking - newbie

It's begining for me so please forgive me language and knoweledge.

I use ANSI C, CodeBlock and Windows.

I am following README.minGW but in the begining I encounter on problem with

gcc -oFreeImageTest.exe FreeImageTest.c -lFreeImage

What do I exactly here? I get error:

gcc: error: FreeImageTest.c: No such file or directory

I need make a program Which load pictures and showing position from exif gps.

I am loooing too for any examples in C using this library but I can't here.

Please, help me.

Create a folder in the folder where you installed free image, like this

在此处输入图片说明

Below is a codeblocks project file. Copy and paste this into a file with the extension .cbp in the folder you created

Open the project file in codeblocks

Build

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
    <FileVersion major="1" minor="6" />
    <Project>
        <Option title="free_image_cb" />
        <Option pch_mode="2" />
        <Option compiler="gcc" />
        <Build>
            <Target title="Debug">
                <Option output="../bin/free_image_cb" prefix_auto="1" extension_auto="1" />
                <Option object_output="obj/Debug/" />
                <Option type="1" />
                <Option compiler="gcc" />
                <Compiler>
                    <Add option="-g" />
                </Compiler>
            </Target>
            <Target title="Release">
                <Option output="../bin/free_image_cb" prefix_auto="1" extension_auto="1" />
                <Option object_output="obj/Release/" />
                <Option type="1" />
                <Option compiler="gcc" />
                <Compiler>
                    <Add option="-O2" />
                </Compiler>
                <Linker>
                    <Add option="-s" />
                </Linker>
            </Target>
        </Build>
        <Compiler>
            <Add option="-Wall" />
            <Add option="-fexceptions" />
            <Add directory="../Dist/x32" />
        </Compiler>
        <Linker>
            <Add library="FreeImage" />
            <Add directory="../Dist/x32" />
        </Linker>
        <Unit filename="../Examples/Generic/BatchLoad.cpp" />
        <Extensions>
            <code_completion />
            <envvars />
            <debugger />
        </Extensions>
    </Project>
</CodeBlocks_project_file>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM