Discussion:
[Openexr-user] Windows Half.lib link errors
Wesley Smith
2008-01-13 22:12:02 UTC
Permalink
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.

2> Creating library ..\Release\Half.lib and object ..\Release\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
* _eLut" (?_eLut@@3PAGA)
2>Half.exp : error LNK2001: unresolved external symbol "union
half::uif * _toFloat" (?_toFloat@@***@half@@A)

I can't seem to figure out how to fix this issue. Any ideas? These
are my preprocessor defines:

WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS

I've also changed the target from a dynamic dll to a static lib.

thanks,
wes
James Burgess
2008-01-14 18:18:17 UTC
Permalink
Wes,
You should see in the Half project a "Pre-Build Event" called
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for IlmBase)

- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas? These
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
Wesley Smith
2008-01-14 18:26:02 UTC
Permalink
Hi James,
I definitely see that and those files are indeed being generated.
I'll look into the details of what is actually happenning and see if I
can figure out where it's going wrong. What the linker seems to
indicate though is the lack of existence of the symbol and AFAICT, I
should be getting syntax errors if the toFloat.cpp and eLut.cpp didn't
exist since they're declared (email coding here) something like:

static half::uif * _toFloat = #include "toFloat.cpp"

I will admit to not being incredibly familiar with the details of
windows building as I mostly use GCC and OSX, so we'll see how this
goes.

best,
wes
Post by James Burgess
Wes,
You should see in the Half project a "Pre-Build Event" called
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for IlmBase)
- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas? These
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
James Burgess
2008-01-14 18:34:10 UTC
Permalink
You sure you don't have OPENEXR_DLL defined? The editor will attempt
to grey out the code that is ifdef'd out but it is easily confused. I
suggest adding a #error or similar in half.cpp inside the appropriate
#ifdef to prove you are getting the right defines. You must not have
OPENEXR_DLL defined for a static build.

- James
Post by Wesley Smith
Hi James,
I definitely see that and those files are indeed being generated.
I'll look into the details of what is actually happenning and see if I
can figure out where it's going wrong. What the linker seems to
indicate though is the lack of existence of the symbol and AFAICT, I
should be getting syntax errors if the toFloat.cpp and eLut.cpp didn't
static half::uif * _toFloat = #include "toFloat.cpp"
I will admit to not being incredibly familiar with the details of
windows building as I mostly use GCC and OSX, so we'll see how this
goes.
best,
wes
Post by James Burgess
Wes,
You should see in the Half project a "Pre-Build Event" called
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for IlmBase)
- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas? These
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
Wesley Smith
2008-01-16 22:19:00 UTC
Permalink
Hi again,
I finally got back to working on this. I'm 100% positive I don't have
OPENEXR_DLL enabled. The appropriate section of code is indeed grayed
out and a well-placed #error message gets picked up. One question I
have though is about the build steps in the VC8 project. There are 3.

1) Build LUTs
2) Compile as usual
3) run a command createDLL

What is this last step doing exactly? I don't need DLLs as I want to
statically link OpenEXR in my project. Can I just get rid of it?

thanks,
wes
Post by James Burgess
You sure you don't have OPENEXR_DLL defined? The editor will attempt
to grey out the code that is ifdef'd out but it is easily confused. I
suggest adding a #error or similar in half.cpp inside the appropriate
#ifdef to prove you are getting the right defines. You must not have
OPENEXR_DLL defined for a static build.
- James
Post by Wesley Smith
Hi James,
I definitely see that and those files are indeed being generated.
I'll look into the details of what is actually happenning and see if I
can figure out where it's going wrong. What the linker seems to
indicate though is the lack of existence of the symbol and AFAICT, I
should be getting syntax errors if the toFloat.cpp and eLut.cpp didn't
static half::uif * _toFloat = #include "toFloat.cpp"
I will admit to not being incredibly familiar with the details of
windows building as I mostly use GCC and OSX, so we'll see how this
goes.
best,
wes
Post by James Burgess
Wes,
You should see in the Half project a "Pre-Build Event" called
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for IlmBase)
- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas? These
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
Nick Porcino
2008-01-16 22:33:53 UTC
Permalink
CreateDLL turns your library into a DLL. Definitely not what you want, I
think!

-----Original Message-----
From: openexr-user-bounces+nporcino=***@nongnu.org
[mailto:openexr-user-bounces+nporcino=***@nongnu.org] On
Behalf Of Wesley Smith
Sent: Wednesday, January 16, 2008 2:19 PM
To: James Burgess
Cc: openexr-***@nongnu.org
Subject: Re: [Openexr-user] Windows Half.lib link errors

Hi again,
I finally got back to working on this. I'm 100% positive I don't have
OPENEXR_DLL enabled. The appropriate section of code is indeed grayed
out and a well-placed #error message gets picked up. One question I
have though is about the build steps in the VC8 project. There are 3.

1) Build LUTs
2) Compile as usual
3) run a command createDLL

What is this last step doing exactly? I don't need DLLs as I want to
statically link OpenEXR in my project. Can I just get rid of it?

thanks,
wes
Post by James Burgess
You sure you don't have OPENEXR_DLL defined? The editor will attempt
to grey out the code that is ifdef'd out but it is easily confused. I
suggest adding a #error or similar in half.cpp inside the appropriate
#ifdef to prove you are getting the right defines. You must not have
OPENEXR_DLL defined for a static build.
- James
Post by Wesley Smith
Hi James,
I definitely see that and those files are indeed being generated.
I'll look into the details of what is actually happenning and see if I
can figure out where it's going wrong. What the linker seems to
indicate though is the lack of existence of the symbol and AFAICT, I
should be getting syntax errors if the toFloat.cpp and eLut.cpp didn't
static half::uif * _toFloat = #include "toFloat.cpp"
I will admit to not being incredibly familiar with the details of
windows building as I mostly use GCC and OSX, so we'll see how this
goes.
best,
wes
Post by James Burgess
Wes,
You should see in the Half project a "Pre-Build Event" called
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for IlmBase)
- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with VS2008.
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas?
These
Post by James Burgess
Post by Wesley Smith
Post by James Burgess
Post by Wesley Smith
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
Wesley Smith
2008-01-21 17:35:39 UTC
Permalink
Hi everyone,
Thanks for all of the help. I finally solved the problem by getting
rid of the CreateDLL post-build step from the VC projects and
rebuilding everything clean.

best,
wes
Post by Nick Porcino
CreateDLL turns your library into a DLL. Definitely not what you want, I
think!
-----Original Message-----
Behalf Of Wesley Smith
Sent: Wednesday, January 16, 2008 2:19 PM
To: James Burgess
Subject: Re: [Openexr-user] Windows Half.lib link errors
Hi again,
I finally got back to working on this. I'm 100% positive I don't have
OPENEXR_DLL enabled. The appropriate section of code is indeed grayed
out and a well-placed #error message gets picked up. One question I
have though is about the build steps in the VC8 project. There are 3.
1) Build LUTs
2) Compile as usual
3) run a command createDLL
What is this last step doing exactly? I don't need DLLs as I want to
statically link OpenEXR in my project. Can I just get rid of it?
thanks,
wes
Post by James Burgess
You sure you don't have OPENEXR_DLL defined? The editor will attempt
to grey out the code that is ifdef'd out but it is easily confused. I
suggest adding a #error or similar in half.cpp inside the appropriate
#ifdef to prove you are getting the right defines. You must not have
OPENEXR_DLL defined for a static build.
- James
Post by Wesley Smith
Hi James,
I definitely see that and those files are indeed being generated.
I'll look into the details of what is actually happenning and see if
I
Post by James Burgess
Post by Wesley Smith
can figure out where it's going wrong. What the linker seems to
indicate though is the lack of existence of the symbol and AFAICT, I
should be getting syntax errors if the toFloat.cpp and eLut.cpp
didn't
Post by James Burgess
Post by Wesley Smith
static half::uif * _toFloat = #include "toFloat.cpp"
I will admit to not being incredibly familiar with the details of
windows building as I mostly use GCC and OSX, so we'll see how this
goes.
best,
wes
Post by James Burgess
Wes,
You should see in the Half project a "Pre-Build Event"
called
Post by James Burgess
Post by Wesley Smith
Post by James Burgess
"Building LUT Files..." I think that toFloat.cpp and eLut.cpp get
compiled via that. (I'm refering to the 1.6 project file for
IlmBase)
Post by James Burgess
Post by Wesley Smith
Post by James Burgess
- James
Post by Wesley Smith
Hi,
I'm trying to get OpenEXR to build properly on Windows with
VS2008.
Post by James Burgess
Post by Wesley Smith
Post by James Burgess
Post by Wesley Smith
The one stumbling block I have is with the static LUT exports for data
type conversion.
2> Creating library ..\Release\Half.lib and object ..\Release
\Half.exp
2>Half.exp : error LNK2001: unresolved external symbol "unsigned short
2>Half.exp : error LNK2001: unresolved external symbol "union
I can't seem to figure out how to fix this issue. Any ideas?
These
Post by James Burgess
Post by Wesley Smith
Post by James Burgess
Post by Wesley Smith
WIN32
NDEBUG
_WINDOWS
HALF_EXPORTS
I've also changed the target from a dynamic dll to a static lib.
thanks,
wes
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
_______________________________________________
Openexr-user mailing list
http://lists.nongnu.org/mailman/listinfo/openexr-user
Continue reading on narkive:
Loading...