Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem building OpenEXR-2.2.1 in Visual Studio 2015 x64 #294

Closed
pssaransiva opened this issue Jun 7, 2018 · 5 comments
Closed

Problem building OpenEXR-2.2.1 in Visual Studio 2015 x64 #294

pssaransiva opened this issue Jun 7, 2018 · 5 comments
Labels
Needs Discussion To be discussed in the technical steering committee

Comments

@pssaransiva
Copy link

I have successfully compiled and built ilmbase-2.2.1 library in Visual Studio 2015 x64.
But I am having issues in linking the dwaLookups project (both debug & release). The project has the following preprocessor definition

WIN32 _WINDOWS _DEBUG HAVE_CONFIG_H ILM_IMF_TEST_IMAGEDIR="D:/SDK/OpenEXR/openexr-2.2.1/IlmImfTest/" OPENEXR_DLL ILMIMF_EXPORTS CMAKE_INTDIR="Debug"

Runtime library set to Multithreaded Debug DLL (/MDd) and linked the debug version of following libraries
Half.lib, Iex-2_2.lib, IlmThread-2_2.lib

The project has the following linking errors
`
1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl IlmThread::supportsThreads(void)" (_imp?supportsThreads@IlmThread@@YA_NXZ) referenced in function "int __cdecl cpuCount(void)" (?cpuCount@@yahxz)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl IlmThread::Thread::Thread(void)" (_imp??0Thread@IlmThread@@qeaa@XZ) referenced in function "public: __cdecl `anonymous namespace'::LutHeaderWorker::Runner::Runner(class A0x2e87040a::LutHeaderWorker &,bool)" (??0Runner@LutHeaderWorker@?A0x2e87040a@@qeaa@AEAV12@_N@Z)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl IlmThread::Thread::~Thread(void)" (_imp??1Thread@IlmThread@@UEAA@XZ) referenced in function "int public: __cdecl anonymous namespace'::LutHeaderWorker::Runner::Runner(class LutHeaderWorker::Runner &,bool)'::`1'::dtor$0" (?dtor$0@?0???0Runner@LutHeaderWorker@?A0x2e87040a@@qeaa@AEAV12@_N@Z@4HA)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl IlmThread::Thread::start(void)" (_imp?start@Thread@IlmThread@@QEAAXXZ) referenced in function "public: __cdecl `anonymous namespace'::LutHeaderWorker::Runner::Runner(class A0x2e87040a::LutHeaderWorker &,bool)" (??0Runner@LutHeaderWorker@?A0x2e87040a@@qeaa@AEAV12@_N@Z)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl IlmThread::Semaphore::Semaphore(unsigned int)" (_imp??0Semaphore@IlmThread@@qeaa@I@Z) referenced in function "public: __cdecl `anonymous namespace'::LutHeaderWorker::Runner::Runner(class A0x2e87040a::LutHeaderWorker &,bool)" (??0Runner@LutHeaderWorker@?A0x2e87040a@@qeaa@AEAV12@_N@Z)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl IlmThread::Semaphore::~Semaphore(void)" (_imp??1Semaphore@IlmThread@@UEAA@XZ) referenced in function "int public: __cdecl anonymous namespace'::LutHeaderWorker::Runner::Runner(class LutHeaderWorker::Runner &,bool)'::`1'::dtor$1" (?dtor$1@?0???0Runner@LutHeaderWorker@?A0x2e87040a@@qeaa@AEAV12@_N@Z@4HA)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl IlmThread::Semaphore::wait(void)" (_imp?wait@Semaphore@IlmThread@@QEAAXXZ) referenced in function "public: virtual __cdecl `anonymous namespace'::LutHeaderWorker::Runner::~Runner(void)" (??1Runner@LutHeaderWorker@?A0x2e87040a@@UEAA@XZ)

1>dwaLookups.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl IlmThread::Semaphore::post(void)" (_imp?post@Semaphore@IlmThread@@QEAAXXZ) referenced in function "public: virtual void __cdecl anonymous namespace'::LutHeaderWorker::Runner::run(void)" (?run@Runner@LutHeaderWorker@?A0x2e87040a@@UEAAXXZ)
Kindly help me to resolve this issue.

@meshula
Copy link
Contributor

meshula commented Jun 9, 2018

The develop branch as of this commit - 5e06341

has fixes for this issue. If you try it, please delete your existing cmake cache and regenerate before compilation.

@pssaransiva
Copy link
Author

I have downloaded the develop branch of the commit 5e06341 and tried.
I am still getting the same issues.

@Overdrivr
Copy link

Overdrivr commented Sep 20, 2018

I'm facing the same issue, I can INSTALL the project for Win32 (with Visual Studio 2017) but not x64. I get dwaLookups errors like this one:

Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol compress2 referenced in function "private: int __cdecl Imf_2_3::DwaCompressor::compress(char const *,int,class Imath_2_3::Box<class Imath_2_3::Vec2<int> >,char const * &)" (?compress@DwaCompressor@Imf_2_3@@AEAAHPEBDHV?$Box@V?$Vec2@H@Imath_2_3@@@Imath_2_3@@AEAPEBD@Z)	IlmImf	C:\Users\remib\Github\openexr\build\OpenEXR\IlmImf\ImfDwaCompressor.obj	1	

  • Build fails with issue above on the master branch, with a Win32 build, which was expected.
  • Build succeeds for a Win32 build on develop branch.
  • Build fails for a x64 build on develop branch

I have changed all platform-related flags in CMAKE to a x64 build, (and also add CMAKE_GENERATOR_PLATFORM=x64, I wonder why CMAKE does not expose this flag by default), all relevant flags are configured as such:

image

Is there something wrong with the Cmake config ?

@meshula
Copy link
Contributor

meshula commented Sep 20, 2018

That usually happens if cmake can't see the x64 toolset, for example, if you didn't run "x64 Native Tools Command Prompt for Visual Studio 2017". The best way to invoke cmake is to specify the toolset you want manually using the -G parameter, so you aren't subject to the defaults of the shell you are in.

cmake -G "Visual Studio 15 2017 Win64" etc etc

@cary-ilm cary-ilm added the Needs Discussion To be discussed in the technical steering committee label Jun 26, 2019
@kdt3rd
Copy link
Contributor

kdt3rd commented Jul 22, 2019

The cmake setup for OpenEXR has been completely overhauled to use "modern cmake" paradigms. This does require a newer version of cmake, but please report any new issues you may have. Thanks for the report.

@kdt3rd kdt3rd closed this as completed Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion To be discussed in the technical steering committee
Projects
None yet
Development

No branches or pull requests

5 participants