Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[Manta] Re: RE: CMake DLL generation and .lib linking error


Chronological Thread 
  • From: "James Bigler" < >
  • To:
  • Subject: [Manta] Re: RE: CMake DLL generation and .lib linking error
  • Date: Thu, 30 Oct 2008 13:48:06 -0600
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=NJhFxh9szJ9auortIwcS6BvQDWl1hqbvP7gXY9bP98n/x7OPWV4fl3mLRBYpoy3NJI 7elySHAFMiE1+ibyY+9ZAXk1cIle4OnffoMZuHT1xSRxf3lf5PaTk9/aNjd9hLuePc69 Qk6n+/K2OVUnpM5l9QkW36KV1cjbmLNVjmMZI=

When I was working on a plugin that used Manta, I built the Manta libraries as static, then linked them all into the final plugin (which was a dll).  This way I could get access to all the classes without having to export any Manta things.  I didn't attemp to load any of the scene files, because the plugin generated the scene geometry I needed.  This worked on Mac, Linux and Windows.

James

On Thu, Oct 30, 2008 at 1:28 PM, Bo Huang < "> > wrote:

Right now I am working within Manta to load at run time scenes such as scene_0.dll, rather than compiling scene_0.cc into Manta at compile time. When that works the program I am developing that uses Manta will come next. The intention is to use Manta purely as Dlls rather than Libs, which would presumably sidestep the duplicated static variable problem I posted earlier. I think this would work because there would be no static linkage.

 

I see that either I stick __declspec(dllexport) to all classes.

 

Or, like you suggested, export the class Thread, which contains that static member threadids. Since Thread is part of the project Manta_Core and the desire is to get Manta_Core.dll, I would probably have to export all classes in this project?

 

 


From: Abe Stephens [mailto: " target="_blank"> ]
Sent: Thursday, October 30, 2008 12:55 PM
To: " target="_blank">
Cc: Bo Huang
Subject: Re: [Manta] CMake DLL generation and .lib linking error

 

The CMake variable is BUILD_SHARED_LIBS. Take a look at /CMakeLists.txt line:33.

 

The code doesn't contain the declspec modifiers to export/import symbols on Windows... so the default build is static. Come to think of it, could you get away with a static build of all the Manta libraries and then explicitly export a small number of symbols used by the program you are embedding Manta within?

 

Abe

 

On Oct 30, 2008, at 10:43 AM, Bo Huang wrote:



Which flags in CMake dictates creation of DLLs rather than Libs?

 

I just noticed my MSVC projects generate .libs such as Manta_Core.lib rather than Manta_Core.dll. I could manually convert them but the settings will be gone when CMake regenerates the .vcprojs.

 

Also:

 

When I manually converted the vcproj for Manta_core from generating .lib to .dll, Winnm.lib was not linked and caused linking error for the timeBeginPeriod() function. I notice that this lib is mentioned in Core/CMakelist.txt, but doesn't seem to have made a difference.

 

Thanks

 

Bo

 





Archive powered by MHonArc 2.6.16.

Top of page