Jump to content
Eternal Lands Official Forums
Zep

Cal3D

Recommended Posts

No, when I do that patch it doesn't export anything. Did you set any parameters?

177931[/snapback]

 

strange, Learners patch works perfectly for me, I used that and the msvc importer, I also set dev-c++ to dll

Edited by Zep

Share this post


Link to post
Share on other sites
No, when I do that patch it doesn't export anything. Did you set any parameters?

177931[/snapback]

I simply told dev-cpp I wanted to compile a .DLL and then had to patch that one line or it wouldn''t export anything.

Share this post


Link to post
Share on other sites
I simply told dev-cpp I wanted to compile a .DLL and then had to patch that one line or it wouldn''t export anything.

177941[/snapback]

 

Can you please tell me how you created the project? What I do is create a new blank DLL project, add all the .cpp files and tell it to compile, but it doesn't export anything.

 

-EDIT: You have to use "Import-Import Visual C++ Project"? I haven't got experience with Dev-C, but I just saw that.

 

-EDIT2: Ok, got it working.

Edited by mikeman

Share this post


Link to post
Share on other sites
Can you please tell me how you created the project? What I do is create a new blank DLL project, add all the .cpp files and tell it to compile, but it doesn't export anything.

 

-EDIT: You have to use "Import-Import Visual C++ Project"? I haven't got experience with Dev-C, but I just saw that.

 

-EDIT2: Ok, got it working.

177988[/snapback]

Yes, I imported the VC project and made sure it was trying to make a .DLL.

Share this post


Link to post
Share on other sites
My current executable and dll for P3 and higher under windows is available at http://www.other-life.com/downloads/elc-cal3d.zip.

 

One concern I have is whether or not my other development dlls (like SDL and ogg) are compatible with everyone elses.

 

A developer file has been uploaded to http://www.other-life.com/downloads/elc-cal3d-dev.zip which will contain the .a and .dll bundled. My cal3d does NOT have the custom cal3d_wrapper in it, just the normal, so you still need to compile in the custom cal3d_wrapper.

177876[/snapback]

And here is a low/older cpu version with sound disabled (some people don't have the same vorbis_d.dll I'm using) http://www.other-life.com/downloads/elc-P2-MMX.zip

Share this post


Link to post
Share on other sites
Yes, I imported the VC project and made sure it was trying to make a .DLL.

177994[/snapback]

 

Well, I did that, I edited platform.h as you said, and it still doesn't work. It exports some symbols, but not others(for example, nothing from CalMixer). I can't understand wtf is wrong.

Share this post


Link to post
Share on other sites
Well, I did that, I edited platform.h as you said, and it still doesn't work. It exports some symbols, but not others(for example, nothing from CalMixer). I can't understand wtf is wrong.

177997[/snapback]

My C & C++ compiler options:

-D__GNUWIN32__
-W -DWIN32
-DNDEBUG
-D_WINDOWS
-D_USRDLL
-DCAL3D_EXPORTS
-D_MBCS

and link options

-lkernel32
-luser32
-lgdi32
-lwinspool
-lcomdlg32
-ladvapi32
-lshell32
-lole32
-loleaut32
-lodbc32
-lodbccp32
-lodbc32
-lodbccp32

Share this post


Link to post
Share on other sites

Well I did it, it all built fine and when I run the program it said it couldn't find the entry point for some function in CAL3D.dll! I just can't seem to be able to build Cal3D properly, there are a lot of functions that are in Learner's cal3d.def and not in mine. Anyway, I'll just assume you guys built Cal3D correctly with Dev-C. I'm really tired, I'll post the new wrapper tommorrow. It's no big deal though, just a .cpp with 6 functions.

Share this post


Link to post
Share on other sites

nope didnt get it to build, linker still bombs about some cal stuff nt being in the lib. still, i didnt clone learners setup. i just used the one given to me by the vc++ project file...

Share this post


Link to post
Share on other sites

Ok guys, I'm almost ready but I still haven't been able to build Cal3D with all the exports that are needed. However, I now know what's wrong so any Dev-C experts give me your advice.

 

Specifically, I get no exports for the CalMixer class. That class is declared like any other:

 

class CAL3D_API CalMixer

{

.....

}

 

CAL3D_API is needed to export the classes, however CalMixer does not export at all. I saw that in model.h there is a forward declaration of it:

 

...

class CalMixer;

...

 

I changed that forward declaration into:

....

class CAL3D_API CalMixer;

...

 

and it exports it! And that happens for other classes that have forward declarations like this. What happens here? Do the forward declarations "override" the normal declarations? How can I fix that?

Share this post


Link to post
Share on other sites
Ok guys, I'm almost ready but I still haven't been able to build Cal3D with all the exports that are needed. However, I now know what's wrong so any Dev-C experts give me your advice.

 

Specifically, I get no exports for the CalMixer class. That class is declared like any other:

 

class CAL3D_API CalMixer

{

.....

}

 

CAL3D_API is needed to export the classes, however CalMixer does not export at all. I saw that in model.h there is a forward declaration of it:

 

...

class CalMixer;

...

 

I changed that forward declaration into:

....

class CAL3D_API CalMixer;

...

 

and it exports it! And that happens for other classes that have forward declarations like this. What happens here? Do the forward declarations "override" the normal declarations? How can I fix that?

178205[/snapback]

Interesting, wonder how mine managed to compile?

Share this post


Link to post
Share on other sites

The most interesting thing is that, in some classes that are declared this way, only some functions are exported: those short functions that are defined inside the class declaration in the header file. Those that are defined in the .cpp file don't get exported! The whole thing must look something like this:

 

***Mixer.cpp*****

#include "cal3d/error.h"
#include "cal3d/mixer.h"
--snippet from mixer.h:---
class CAL3D_API CalMixer
{
int foo(){return 0;}-->this gets exported
void executeAction(...);
}
-------------------------------

#include "cal3d/coremodel.h"
#include "cal3d/corebone.h"
#include "cal3d/coreanimation.h"
#include "cal3d/coretrack.h"
#include "cal3d/corekeyframe.h"
#include "cal3d/model.h"-->this has forward declaration: "class CalMixer";
#include "cal3d/skeleton.h"
#include "cal3d/bone.h"
#include "cal3d/animation.h"
#include "cal3d/animation_action.h"
#include "cal3d/animation_cycle.h"

//This doesn't get exported because CalMixer was redeclared without CAL3D_API prefix!

void CalMixer::executeAction(...){

}

 

Weird. How are we going to solve this for all the users without heavily editing Cal3D sources? How did you get it to compile, I checked your .def files and they're all there. Maybe there is a global compile parameter or something that ignores re-definition of classes?

Edited by mikeman

Share this post


Link to post
Share on other sites

Mine compiled great originally, but it crashed at startup, somewhere in some windows DLL.

I updated my DevCPP to the latest version, and then it didn't even compile, much less link.

I felt like giving up, but then I asked learner for his caled_wrapper.o file, and now it works great.

Share this post


Link to post
Share on other sites
In cal3d, the file platform.h at line 32, I changed it ti

#if (defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) ) || defined(__GNUWIN32__)

To always allow creating the DLL exports id DLL is desired. From my checking, that is the only thing I changed in cal3d to fet it to compile & link properly.

177764[/snapback]

 

hmm, no wonder i didnt get cal3d to work properly, missed the fact that learner both added a ( and ) around the original if statement and the || defined(__GNUWIN32__) stuff at the end.

 

edit:

 

still didnt help much tho. bombs out over those calgetmodel_getmixer and others...

Edited by duran

Share this post


Link to post
Share on other sites

hmm i fear that the latest version of devcpp have a flaw in the linking somewhere.

 

ie, i killed the glu error by manualy adding libglu32 to the linker, and i got libcal3d to be about 500k in size by adding libstdc++ to it. only problem i have now is that it cant find the calmixer links. more or less the same problem that mikeman is showing...

Share this post


Link to post
Share on other sites
hmm i fear that the latest version of devcpp have a flaw in the linking somewhere.

 

ie, i killed the glu error by manualy adding libglu32 to the linker, and i got libcal3d to be about 500k in size by adding libstdc++ to it. only problem i have now is that it cant find the calmixer links. more or less the same problem that mikeman is showing...

178553[/snapback]

 

I ran into the same issue earlyer today, And was unable to get a solution,

Maybe Learner can post the wrapper.o for all of us to use, At least temp.

Share this post


Link to post
Share on other sites

hmm, i found some 3.4.2 gcc packages in dev-c++'s updater. and when adding those (and modifying the default compiler settings) i got dev-c++ to produce a nice, fat .a when compiling cal3d as a dll.

 

still didnt get all the exports for some reason xP

 

i wonder what happens if i tell it to compile the whole thing as an .a rather then a dll...

Share this post


Link to post
Share on other sites
i wonder what happens if i tell it to compile the whole thing as an .a rather then a dll...

178574[/snapback]

 

As in static? I had the same issue, missing the same exports

Share this post


Link to post
Share on other sites

Learner, What version of gcc etc are you useing with dev-c++?

 

Maybe the discrepancys start there =)

Share this post


Link to post
Share on other sites

Wooo!!

 

Ok, I FINALLY got it working. I don't know how it will work for all of you, but I had this idea this morning and it worked like a charm from the very first time.

 

****BUILDING THE CAL3D.DLL*****

1)You need to change that line in platform.h like Learner did

2)You need to do something similar in cal3d_wrapper.h

3)I've made a "decls.h" file and included it in every .cpp file

 

Anyway, here are all the sources(and the .dev) that I used to build it:

http://mman.tfm.ro/CAL3D_LIB.zip

 

One note, I needed to copy all the .h files into my Dev-Cpp/Include/Cal3D dir because that's where it looks to find them. If all goes well, you'll get cal3d.dll and libcal3d.a

 

****BUILDING THE CAL3D_WRAPPER_ELC.DLL*****

I've uploaded the .cpp and .dev file, just build it and make sure it links to libcal3d.a you just created before.

http://mman.tfm.ro/CALWRAP_LIB.zip

If all goes well, you'll get cal3d_wrapper_elc.dll and libcal3d_wrapper_elc.a

 

 

****BUILDING THE CLIENT*****

There are some changes that I made in cal.c and cal.h. Here they are:

http://mman.tfm.ro/ELC_UPDATE.zip

Then, build the project and make sure that is linked to cal3d.a and libcal3d_wrapper_elc.a you created in the previous steps.

 

 

If all goes well, you'll get the executable. Put it in the Eternal lands dir, alongside with the 2 .dlls we made, and run it.

Edited by mikeman

Share this post


Link to post
Share on other sites
Wooo!!

178592[/snapback]

 

Im ganna Kiss you =) works flawlessly on win32. :P

Edited by Zep

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×