Peter Windey | 1 Mar 02:55
Picon
Favicon

An issue with openEXR under MSVC 2005 express

I compiled IlmBase and openEXR so now I have directory structure looking this

 

Deploy

            Bin

            Include

            Lib

 

Now, in msvc2005 EE I made this small test program.

 

#include <ImfOutputFile.h>

#include <ImfInputFile.h>

#include <ImfChannelList.h>

#include <ImfStringAttribute.h>

#include <ImfMatrixAttribute.h>

#include <ImfArray.h>

 

#include <iostream>

 

        using namespace std;

        using namespace Imf;

    using namespace Imath;

 

        int main(int argc, char **argv){

               return 0;

        }

 

void

readGZ1 (const char fileName[],

        Array2D<half> &rPixels,

        Array2D<half> &gPixels,

        Array2D<float> &zPixels,

        int &width, int &height)

{

 

    InputFile file (fileName);

}

 

And at the overall options => projects and solutions => VC ++ Directories I added c:\deploy\include and  \lib for respectively the include files and library files. So he does find the header files, that’s not a problem. What I do get is this.

 

Linking...

main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Imf::InputFile::~InputFile(void)" (??1InputFile <at> Imf <at> <at> UAE <at> XZ) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1 <at> <at> YAXQBDAAV?$Array2D <at> Vhalf <at> <at> <at> Imf <at> <at> 1AAV?$Array2D <at> M <at> 2 <at> AAH3 <at> Z)

main.obj : error LNK2019: unresolved external symbol "public: __thiscall Imf::InputFile::InputFile(char const * const,int)" (??0InputFile <at> Imf <at> <at> QAE <at> QBDH <at> Z) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1 <at> <at> YAXQBDAAV?$Array2D <at> Vhalf <at> <at> <at> Imf <at> <at> 1AAV?$Array2D <at> M <at> 2 <at> AAH3 <at> Z)

main.obj : error LNK2019: unresolved external symbol "int __cdecl Imf::globalThreadCount(void)" (?globalThreadCount <at> Imf <at> <at> YAHXZ) referenced in function "void __cdecl readGZ1(char const * const,class Imf::Array2D<class half> &,class Imf::Array2D<class half> &,class Imf::Array2D<float> &,int &,int &)" (?readGZ1 <at> <at> YAXQBDAAV?$Array2D <at> Vhalf <at> <at> <at> Imf <at> <at> 1AAV?$Array2D <at> M <at> 2 <at> AAH3 <at> Z)

C:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\Debug\envmap.exe : fatal error LNK1120: 3 unresolved externals

Build log was saved at "file://c:\Documents and Settings\Peter\Mijn documenten\Visual Studio 2005\Projects\envmap\envmap\Debug\BuildLog.htm"

envmap - 4 error(s), 0 warning(s)

 

Now, I also went to the solutions options and added to additional libraries (Linker => General) c:\deploy\Lib and I also tried adding \bin there But the result remains the same. Anyone any idea which setting I’m forgetting?

 

Thanks in advance,

Peter


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.21.2/1304 - Release Date: 29/02/2008 8:18

_______________________________________________
Openexr-devel mailing list
Openexr-devel <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/openexr-devel
Florian Kainz | 1 Mar 03:30

Re: openexr gcc43 patch

Thanks for the patch.  The fix has been checked into CVS.

Florian

Rex Dieter wrote:
> Needed this small patch to build w/gcc-4.3
> 
> -- Rex
> 
> 
> ------------------------------------------------------------------------
> 
> diff -up openexr-1.6.1/exrmaketiled/main.cpp.gcc43 openexr-1.6.1/exrmaketiled/main.cpp
> --- openexr-1.6.1/exrmaketiled/main.cpp.gcc43	2007-04-24 20:08:45.000000000 -0500
> +++ openexr-1.6.1/exrmaketiled/main.cpp	2008-02-01 08:21:29.000000000 -0600
> @@ -44,7 +44,7 @@
>  
>  #include <iostream>
>  #include <exception>
> -#include <string>
> +#include <string.h>
>  #include <stdlib.h>
>  
>  using namespace Imf;
> diff -up openexr-1.6.1/exrenvmap/main.cpp.gcc43 openexr-1.6.1/exrenvmap/main.cpp
> --- openexr-1.6.1/exrenvmap/main.cpp.gcc43	2007-04-24 20:07:51.000000000 -0500
> +++ openexr-1.6.1/exrenvmap/main.cpp	2008-02-01 08:22:10.000000000 -0600
> @@ -45,6 +45,7 @@
>  #include <iostream>
>  #include <exception>
>  #include <stdlib.h>
> +#include <string.h>
>  
>  using namespace Imf;
>  using namespace std;
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Openexr-devel mailing list
> Openexr-devel <at> nongnu.org
> http://lists.nongnu.org/mailman/listinfo/openexr-devel
Paul Miller | 12 Mar 23:36
Gravatar

64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

Well, this is a strange one.

I'm building libHalf statically on a 32 bit kubuntu system and a 64 bit 
system. I'm linking it in with a shared library.

On the 32 bit system, everything is fine.

On the 64 bit system (kubuntu 6.0.6, full upgrade), when I attempt to 
link my shared library (again, with the 64 bit static libHalf.a), I get 
this link error:

/usr/bin/ld: /usr/local/lib/libHalf.a(half.o): relocation R_X86_64_32S 
against half::_eLut' can not be used when making a shared object; 
recompile with -fPIC
/usr/local/lib/libHalf.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Can anyone shed any light on this? What's the difference in behavior 
between the 32 bit and 64 bit systems (basically, IDENTICAL setups 
except for the bit size) and what exactly is it asking for?

Much appreciated!!

--

-- 
Paul Miller | paul <at> fxtech.com | www.fxtech.com | Got Tivo?
Paul Miller | 13 Mar 19:11
Gravatar

Re: 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

Paul Miller wrote:
> Well, this is a strange one.
> 
> I'm building libHalf statically on a 32 bit kubuntu system and a 64 bit 
> system. I'm linking it in with a shared library.
> 
> On the 32 bit system, everything is fine.
> 
> On the 64 bit system (kubuntu 6.0.6, full upgrade), when I attempt to 
> link my shared library (again, with the 64 bit static libHalf.a), I get 
> this link error:

A couple of people (thank you) pointed me in the right direction - I 
needed to manually tell the IlmBase configure script to enable PIC.

Since fPIC is apparently *required* on x64 Linux, I was wondering why 
the configure script didn't automatically enable it for me. Is that a 
bug or a feature?

--

-- 
Paul Miller | paul <at> fxtech.com | www.fxtech.com | Got Tivo?
Bob Friesenhahn | 13 Mar 20:23
Picon
Picon
Gravatar

Re: 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

On Thu, 13 Mar 2008, Paul Miller wrote:
>
> Since fPIC is apparently *required* on x64 Linux, I was wondering why the 
> configure script didn't automatically enable it for me. Is that a bug or a 
> feature?

Normally PIC is used in shared libraries, and not in archive (.a) 
files.  The only exception that I have heard of is AIX, which seems to 
use .a files as shared libraries.

Perhaps you need to use --enable-shared to build shared libraries and 
use the shared libraries?

Bob
======================================
Bob Friesenhahn
bfriesen <at> simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Paul Miller | 13 Mar 23:08
Gravatar

Re: 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

Bob Friesenhahn wrote:
> On Thu, 13 Mar 2008, Paul Miller wrote:
>>
>> Since fPIC is apparently *required* on x64 Linux, I was wondering why 
>> the configure script didn't automatically enable it for me. Is that a 
>> bug or a feature?
> 
> Normally PIC is used in shared libraries, and not in archive (.a) 
> files.  The only exception that I have heard of is AIX, which seems to 
> use .a files as shared libraries.
> 
> Perhaps you need to use --enable-shared to build shared libraries and 
> use the shared libraries?

I didn't want to use shared libs because then I'd have a dependency 
problem and have to deal with -rpath and such. With all of my 
(non-system) dependencies built statically, I can basically plop my app 
(and its plugins) anywhere and it'll work without setting env vars, 
which is much nicer (I think).

--

-- 
Paul Miller | paul <at> fxtech.com | www.fxtech.com | Got Tivo?
Ken McGaugh | 13 Mar 23:37

Re: 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

On 14/03/2008, at 9:08 AM, Paul Miller wrote:
> Bob Friesenhahn wrote:
>> On Thu, 13 Mar 2008, Paul Miller wrote:
>>>
>>> Since fPIC is apparently *required* on x64 Linux, I was wondering  
>>> why the configure script didn't automatically enable it for me. Is  
>>> that a bug or a feature?
>> Normally PIC is used in shared libraries, and not in archive (.a)  
>> files.  The only exception that I have heard of is AIX, which seems  
>> to use .a files as shared libraries.
>> Perhaps you need to use --enable-shared to build shared libraries  
>> and use the shared libraries?
>
> I didn't want to use shared libs because then I'd have a dependency  
> problem and have to deal with -rpath and such. With all of my (non- 
> system) dependencies built statically, I can basically plop my app  
> (and its plugins) anywhere and it'll work without setting env vars,  
> which is much nicer (I think).
>

You can still achieve that kind of portability while using shared  
libraries if you distribute the shared libraries with your app.  All  
you have to do is tell the linker that the shared libraries are  
relative to the executable by using a combination of the "-z origin"  
linker option and using $ORIGIN in your rpath.

For example, I have an app whose executable lives in a directory

     myApp/bin/myApp

And there are a bunch of shared libraries in

     myApp/lib

I set the rpath on myApp to

     $ORIGIN/../lib

and pass "-z origin" to the linker to activate it.  I've even  
distributed libstdc++ and libgcc_s with an app that way to reduce  
compiler version dependencies.

--Ken
Paul Miller | 14 Mar 01:17
Gravatar

Re: 64 bit libHalf - R_X86_64_32S _eLut and -fPIC question

Ken McGaugh wrote:
> On 14/03/2008, at 9:08 AM, Paul Miller wrote:
>> Bob Friesenhahn wrote:
>>> On Thu, 13 Mar 2008, Paul Miller wrote:
>>>>
>>>> Since fPIC is apparently *required* on x64 Linux, I was wondering 
>>>> why the configure script didn't automatically enable it for me. Is 
>>>> that a bug or a feature?
>>> Normally PIC is used in shared libraries, and not in archive (.a) 
>>> files.  The only exception that I have heard of is AIX, which seems 
>>> to use .a files as shared libraries.
>>> Perhaps you need to use --enable-shared to build shared libraries and 
>>> use the shared libraries?
>>
>> I didn't want to use shared libs because then I'd have a dependency 
>> problem and have to deal with -rpath and such. With all of my 
>> (non-system) dependencies built statically, I can basically plop my 
>> app (and its plugins) anywhere and it'll work without setting env 
>> vars, which is much nicer (I think).
>>
> 
> You can still achieve that kind of portability while using shared 
> libraries if you distribute the shared libraries with your app.  All you 
> have to do is tell the linker that the shared libraries are relative to 
> the executable by using a combination of the "-z origin" linker option 
> and using $ORIGIN in your rpath.

...

> and pass "-z origin" to the linker to activate it.  I've even 
> distributed libstdc++ and libgcc_s with an app that way to reduce 
> compiler version dependencies.

Hmm - I wasn't aware of the -z option. Cool, thanks!

--

-- 
Paul Miller | paul <at> fxtech.com | www.fxtech.com | Got Tivo?
Hai Nguyen | 20 Mar 19:34
Picon

Repository Access

Hi,


I was wondering how I could get read only access to the current CVS or SVN tree of OpenEXR if possible? I tried looking for the information on the web page - but I couldn't find it. 

Thanks,
- Hai 
_______________________________________________
Openexr-devel mailing list
Openexr-devel <at> nongnu.org
http://lists.nongnu.org/mailman/listinfo/openexr-devel
Florian Kainz | 20 Mar 21:40

Re: Repository Access

For instruction on how to get access to CVS, please see this web page:

	http://savannah.nongnu.org/cvs/?group=openexr

If you just want to browse the CVS repository or download individual files,
then go to this page:

	http://cvs.savannah.nongnu.org/viewvc/?root=openexr

Hai Nguyen wrote:
> Hi,
> 
> I was wondering how I could get read only access to the current CVS or 
> SVN tree of OpenEXR if possible? I tried looking for the information on 
> the web page - but I couldn't find it. 
> 
> Thanks,
> - Hai 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Openexr-devel mailing list
> Openexr-devel <at> nongnu.org
> http://lists.nongnu.org/mailman/listinfo/openexr-devel

Gmane