www.quadsoftware.com
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic
 Compiling 64bit plugins? « View previous topic :: View next topic » 
Author Message
duke2
PostPosted: Sun Jun 21, 2009 12:20 pm    Post subject: Compiling 64bit plugins? Reply with quote



Joined: 21 Mar 2008
Posts: 45

I'm proficient in C# but C++ is a bit foreign to me so bear with me - how do I compile to 64bit? I opened and converted the project to 2008/VS9 and the 32bit plugins compile ok, but if I try to compile the 64bit ones, nothing happens - no warning or anything.
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Jun 22, 2009 5:53 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

In the plugins solution (in Visual Studio) you should have Win32 and x64 platforms (to be chosen from the Build Manager). x64 is the 64 bit compilation, just select that and recompile, the plugins should output in the Plugins directory with the same name as their 32bit counterparts but with 64 suffix (example: ExpTxt64.plug). I will check the configuration now to see if there are any problems, from what I know all the compile configurations were thoroughly tested and they work.

Also if you are using other compiler, you just need to use the D_64BIT preprocessor define when compiling the plugins. Without this define the 32bit SDK is used.

Regards,
Adrian L.
Back to top
View user's profile Send private message
duke2
PostPosted: Mon Jun 22, 2009 6:31 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

ALicu wrote:
In the plugins solution (in Visual Studio) you should have Win32 and x64 platforms (to be chosen from the Build Manager). x64 is the 64 bit compilation, just select that and recompile, the plugins should output in the Plugins directory with the same name as their 32bit counterparts but with 64 suffix (example: ExpTxt64.plug). I will check the configuration now to see if there are any problems, from what I know all the compile configurations were thoroughly tested and they work.

Also if you are using other compiler, you just need to use the D_64BIT preprocessor define when compiling the plugins. Without this define the 32bit SDK is used.

Regards,
Adrian L.


I did change to x64 in the build manager and noticed the plugins had a 64 suffix, however mine didn't output. I'll check it out more tonight!
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Jun 22, 2009 7:33 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Ohh, are you referring to your own plugin? Then you need to create the 64bit platform compilation. For this (using Visual Studio) you need to go Configuration Manager (from menu: Build -> Configuration Manager...) and from "Active solution platform" and select New to create 64bit platform. Make sure you use D_64BIT preprocessor directive (in Project properties at C/C++ -> Preprocessor and add D_64BIT in Proprocessor Definitions list (command or semi colon separated). Also change the name of the output file. We've used 64 suffix for our plugins to differentiate from 32 bit. You can use the same folder, Plugins, the editor will load the platform that is currently running on.

You usually need to look at the default plugins configuration settings and use those. The only difference between 32 and 64bit compilation is the presence of D_64BIT to indicate that you are using 64bit when including the SDK headers.

Regards,
Adrian L.
Back to top
View user's profile Send private message
duke2
PostPosted: Mon Jun 22, 2009 10:06 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

Here's the completely descriptive error i'm getting:

http://www.youtube.com/watch?v=0G_snCSN3vA

And it's on an existing project. I'll probably make it a new one and do other things to it when I get over this hurdle!
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Jun 22, 2009 10:17 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hmm, I've saw that "Unexpected error" when there were no 64bit configurations made. Another cause may be that you don't have the 64bit support installed in Visual Studio. Did you installed the 64 compiler support for VS? Are you running on a 64bit O.S.?

Alternatively you can try to create a new config starting from 32bit and indicating x64 as platform and D_64BIT define. Let me know if this approach fix it.

If none of the above fix it, can you please send me the StandardPlugins8.sln file from SDK?
Back to top
View user's profile Send private message
duke2
PostPosted: Mon Jun 22, 2009 10:37 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

Well I think that's it! I hadn't installed the x64 compilers Embarassed

A better error message from VS would have been nice!
Back to top
View user's profile Send private message
ALicu
PostPosted: Mon Jun 22, 2009 10:43 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Yeah, I know, they errors can be so cryptic some time.
Glad I could help.
Back to top
View user's profile Send private message
ALicu
PostPosted: Tue Jun 23, 2009 12:27 pm    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

I've received your files. It seems that you are using Visual Studio 2008. So the compiled DLL is needing MSVCP90.dll and MSVCR90.dll (the C runtime for VS 2009). For this you need to put these dlls in the plugins folder and also put the proper manifests there (the manifest files you find in the VS2008 redistrib).

The current plugins are compiled with VS2005 (as can be seen from the Microsoft.VC80.CRT.manifest file from the plugins folder) so your dll may conflict with the existing ones. So maybe it is better, when compiling, to just statically link to the standard files. For this, when compiling the plugin, select from its properties C/C++ -> Code Generation -> Runtime Library the Multi-threaded (first) option for release and Multi-threaded Debug for debug build.

Let me know if using static libraries fix your issue.

Regards,
Adrian L.
Back to top
View user's profile Send private message
duke2
PostPosted: Wed Jun 24, 2009 10:57 am    Post subject: Reply with quote



Joined: 21 Mar 2008
Posts: 45

Sorry for all the probably elementary questions - I haven't had any experience doing anything other than doing c# in VS (as it's compiled on the fly in Unity). I did that, but now i'm getting these conflicts:

Code:

Error   1   error LNK2005: exit already defined in LIBCMT.lib(crt0dat.obj)   MSVCRT.lib   ImpRAW
Error   2   error LNK2005: __iob_func already defined in LIBCMT.lib(_file.obj)   MSVCRT.lib   ImpRAW
Error   3   error LNK2005: getenv already defined in LIBCMT.lib(getenv.obj)   MSVCRT.lib   ImpRAW
Error   4   error LNK2005: malloc already defined in LIBCMT.lib(malloc.obj)   MSVCRT.lib   ImpRAW
Error   5   error LNK2005: free already defined in LIBCMT.lib(free.obj)   MSVCRT.lib   ImpRAW
Error   6   error LNK2005: "private: __cdecl type_info::type_info(class type_info const &)" (??0type_info@@AEAA@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)   MSVCRT.lib   ImpRAW
Error   7   error LNK2005: "private: class type_info & __cdecl type_info::operator=(class type_info const &)" (??4type_info@@AEAAAEAV0@AEBV0@@Z) already defined in LIBCMT.lib(typinfo.obj)   MSVCRT.lib   ImpRAW
Warning   8   warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library   ImpRAW   ImpRAW
Error   9   fatal error LNK1169: one or more multiply defined symbols found   c:\Program Files (x86)\Grome 2\Plugins\ImpRAW64.plug   1   ImpRAW
Back to top
View user's profile Send private message
ALicu
PostPosted: Wed Jun 24, 2009 11:10 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Are you compiling with VS 2008? Do you statically link to the C runtime library (as described in the previous post)? If so, can you try to put LIBCMT.lib on ignore list (at project properties at Linker -> Input -> Ignore Specific Library). It seems that older c runtime library (libcmt) conflicts with the new one (MSVCRT.lib), that is the same functions are defined in both.
Back to top
View user's profile Send private message
ALicu
PostPosted: Wed Jul 01, 2009 9:02 am    Post subject: Reply with quote



Joined: 12 Feb 2007
Posts: 1326

Hi,

Can you please confirm if the above solution fixed your issue?

Regards,
Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group