can I use a part of blender for my program?

Compiling, libraries, modules, coding guidelines and porting

Moderators: jesterKing, stiv

Post Reply
daejong
Posts: 3
Joined: Tue Jul 01, 2008 9:48 am

can I use a part of blender for my program?

Post by daejong » Tue Jul 01, 2008 10:09 am

hello, I'm going to build blender 2.46 in MSVC2005.
first, let me introduce my environment.

- Visual Studio 2005(not express version)
- Installed Python2.5, Quicktime SDK, DirectX SDK, platform SDK
- Installed scons, MingW
- Surce codes using Tortoise SVN

I read a guide for build in this env.
now I successed building with MSVC+scons, but actually I want to do is to build only with MSVC.

I had a hard work, and succeeded compile, but there are some linker errors found(hundreds of).
most errors start with
MSVCRTD.lib(MSVCR80D.dll) : error LNK2005:
msvcprtd.lib(MSVCP80D.dll) : error LNK2005:
LIBCMTD.lib(stdexcpt.obj) : error LNK2005:

like this. some msgs below:

1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _floor이(가) LIBCMTD.lib(floor_pentium4.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _memmove이(가) LIBCMTD.lib(memmove.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _exit이(가) LIBCMTD.lib(crt0dat.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _fprintf이(가) LIBCMTD.lib(fprintf.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _malloc이(가) LIBCMTD.lib(dbgheap.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _free이(가) LIBCMTD.lib(dbgheap.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _calloc이(가) LIBCMTD.lib(dbgheap.obj)에 이미 정의되어 있습니다.
1>MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _qsort이(가) LIBCMTD.lib(qsort.obj)에 이미 정의되어 있습니다.

that msgs saying about 'already defined symbols'. (korean)

I don't know what's problem, but I guess a duplicate of linking libraries are problem. but I can't handle this.

I thinks the projects using external lib files is only DNA_makesdna and blender. when I remove some libraries(ex: LIBCMTD.lib) in linker's input option, that project fails. so I build in original linker input option( libc.lib, libcd.lib, msvcrt.lib, libcmt.lib libcmtd.lib) that project makes, but blender project finally fails..
any ideas?


what I want to do is to make blender in library file, not executable.
so I want to use that lib file for my application.(blender window Interface is not needed to me)
my purpose is just use internal architecture of blender, and my app is a Direct3D MFC application what needs some modelling tech. for example, I want to modify Direct3D mesh in my application, with some modifiers(ex: subdivision surfaces)

SO I NEED TO BUILD BLENDER USING ONLY MSVC

I know this is very fool question, and I'm not sure you understand what I'm saying(for my poor english), but I need some help.
can I use blender module in my program? any ideas can help me.

thank you.
Last edited by daejong on Tue Jul 01, 2008 10:31 am, edited 2 times in total.

Caronte
Posts: 521
Joined: Wed Oct 16, 2002 12:53 am
Location: Valencia-Spain-Europe

Post by Caronte » Tue Jul 01, 2008 10:25 am

You can...

IF you program is OpenSource.

Check the license ;)
Caronte.
"Some Day, All Will Be Digital"
http://www.nicodigital.com

daejong
Posts: 3
Joined: Tue Jul 01, 2008 9:48 am

yeah

Post by daejong » Tue Jul 01, 2008 10:30 am

I know blender follows GPL and I don't want to sell my program :)
It's very poor program. thnx.

Stukfruit
Posts: 15
Joined: Sun Nov 04, 2007 8:56 am

Re: can I use a part of blender for my program?

Post by Stukfruit » Tue Aug 26, 2008 4:56 am

daejong wrote:what I want to do is to make blender in library file, not executable.
so I want to use that lib file for my application.(blender window Interface is not needed to me)
my purpose is just use internal architecture of blender, and my app is a Direct3D MFC application what needs some modelling tech. for example, I want to modify Direct3D mesh in my application, with some modifiers(ex: subdivision surfaces)
Well, I hate to be very negative and kill your enthusiasm, but I've tried something like that as well a long while ago. You can do quite a lot to go as far as making Blender work for you as a "library", but here's the thing: most parts of Blender were totally not made to act like a library.

That means you won't be able to:
  • To 'just write a new interface' and wrap all functionality into it.
    That's what I tried (yes, I like to be naive), and that's also where I failed. You actually can embed the modelling view (or other views) in your application by replacing/reworking GHOST-specific parts of the code, but it will be *very* hard to make all the tools and all that work. Writing your own tools and modifiers will probably require much less time (where 'time' equals 'years').
  • To use just a 'few' things like mesh objects, modifiers and all that belongs to it in your own program.
    Doing that means you'll have to rewrite at least 50% of the Blender UI code yourself. If it takes multiple people to rewrite the UI code in one year, I guess it takes multiple years to do what you're asking here all alone. Once again, I'd recommend you to write your own tools instead and use the techniques from Blender as a guideline in writing them.
It might become easier once Blender 2.50 is done, but I'm afraid it will still be a long way to get things to work as a "library".

Also, since you're using Direct3D, that would mean you would have to rewrite everything to display the meshes (that's also including many of the tools) to use D3D instead of OGL.

jesterKing
Site Admin
Posts: 1848
Joined: Fri Oct 18, 2002 12:48 pm
Location: Finland

Post by jesterKing » Tue Aug 26, 2008 6:46 am

Besides, what's wrong with using scons to initiate the build process? You still can use MSVS as your ide, if you want to. It's just easier to have it built with scons. Even our official releases are built with scons + msvc.

/Nathan

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest