openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] C API calls in VS2005 Pro


From: Thomas Lock
Subject: [Openexr-devel] C API calls in VS2005 Pro
Date: Wed, 19 Jul 2006 15:43:58 -0400

Ok, so i think the only way i will get this resolved is by give you all the
information; I am using VS2005 Pro and i included 5 sections below that
should give all the information about how am compiling this. What i just
don't understand is why this is happening as a result of this one command
"fp = ImfOpenOutputFile(fileName, header, IMF_WRITE_RGBA );" The call from
the other application is working without any problems. Please some help, i
have been trying to get this one simple function to work, with zero headway.
Even tried to compile any of the examples and a get a minimum of 100+
ERRORS.

Tom.

FILES LOCATED IN SYSTEM32 DIRECTORY WHEN THIS FILE IS BEING EXCUTED

zlib1.dll
IlmImf.dll
IlmImfd.dll

SORUCE CODE

#include "stdafx.h"
#include "AppEXR.h"
#include "ImfCRgbaFile.h"

BOOL APIENTRY DllMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID
lpReserved)
{
    return TRUE;
}

extern "C" void WINAPI writeOpenEXR (char *filename, int width, int height,
float* Bits128)
{
    int LineWidth=width*4;
    float fwidth;
    const char fileName[] = "c:\\foo2.exr";
    ImfOutputFile *fp;
    ImfRgba *rgba;
 rgba = (ImfRgba *)malloc(width * height * sizeof(ImfRgba));
 fwidth = (float)width;
 ImfHeader *header;
 header = ImfNewHeader();
 ImfHeaderSetDisplayWindow(header, 0, 0, width - 1, height - 1);
 ImfHeaderSetDataWindow(header, 0, 0, width - 1, height - 1);
 ImfHeaderSetScreenWindowWidth(header, fwidth - 1);
 fp = ImfOpenOutputFile(fileName, header, IMF_WRITE_RGBA );

 if (!fp)
 {
  exit(-1);
 }

 ImfDeleteHeader(header);

    for(int h=0;h<height;h++)for(int b=0;b<width;b++)
 {
        ImfHalf half;

  int i=h*LineWidth+(b<<2);
  int j=h*b;

  ImfFloatToHalf(Bits128[i], &half);
  rgba[j].b = half;

  ImfFloatToHalf(Bits128[i + 1], &half);
  rgba[j].g = half;

  ImfFloatToHalf(Bits128[i + 2], &half);
  rgba[j].r = half;

  ImfFloatToHalf(Bits128[i + 3], &half);
  rgba[j].a = half;
    }

    ImfOutputSetFrameBuffer( fp, rgba, 1, width );
    ImfOutputWritePixels(fp, height );
    ImfCloseOutputFile(fp);

 free(rgba);
}


COMPILER RESULTS

------ Build started: Project: AppEXR, Configuration: Release Win32 ------
Linking...
   Creating library .\Release/AppEXR.lib and object .\Release/AppEXR.exp
Embedding manifest...
Build log was saved at "file://f:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\AppEXR\Release\BuildLog.htm"
AppEXR - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========


PROPERTIES COMMAND LINE IN C/C++ OPTIONS

/O2 /Ob1 /Ot /I "F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1\IlmImf" /I "F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1\Half" /I "F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1\Iex" /I "F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1\Imath" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D
"_USRDLL" /D "APPEXR_EXPORTS" /D "_VC80_UPGRADE=0x0600" /D "_WINDLL" /D
"_MBCS" /GF /FD /EHsc /MD /Gy /arch:SSE /fp:fast /J /Yu"stdafx.h"
/Fp".\Release/AppEXR.pch" /Fo".\Release/" /Fd".\Release/" /W3 /nologo /c /Gd
/TP /errorReport:prompt

COMMAND LINE IN LINKER OPTIONS

/OUT:".\Release/AppEXR.dll" /INCREMENTAL:NO /NOLOGO
/LIBPATH:"F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1-win32\lib\ilmimf" /LIBPATH:"F:\WORKSPACE\VB
WorkSpace\OpenEXR plugin\OpenEXR-1.2.1-win32\lib\ilmimfdll"
/LIBPATH:"F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1-win32\lib\half" /LIBPATH:"F:\WORKSPACE\VB
WorkSpace\OpenEXR plugin\OpenEXR-1.2.1-win32\lib\iex"
/LIBPATH:"F:\WORKSPACE\VB WorkSpace\OpenEXR
plugin\OpenEXR-1.2.1-win32\lib\imath" /LIBPATH:"F:\WORKSPACE\VB
WorkSpace\OpenEXR plugin\OpenEXR-1.2.1-win32\lib\zlib" /DLL /MANIFEST
/MANIFESTFILE:".\Release\AppEXR.dll.intermediate.manifest"
/DEF:".\AppEXR.def" /PDB:".\Release/AppEXR.pdb"
/IMPLIB:".\Release/AppEXR.lib" /MACHINE:X86 /ERRORREPORT:PROMPT odbc32.lib
odbccp32.lib IlmImf.lib Imath.lib Iex.lib Half.lib zlib.lib IlmImfdll.lib
IlmImfdlld.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib












reply via email to

[Prev in Thread] Current Thread [Next in Thread]