[ODE] Making an MSVC project that uses ODE & drawstuff

John DeWeese deweese at ict.usc.edu
Wed Mar 12 14:45:02 2003


(actual post stuck at moderator, sorry for impending duplicates)

That's a weird link error. I assume the library is in your path 
implictly or explicitly, and you're referring to it by proper name. 
Might want to try moving it to a local directory anyway, which is 
preferable to a system install. Anyway, I used a different build system.

I'm reposting an archive message from a certain Sir Jeffrey Weber on 
how to use ODE with MSVC7. The summary is, tool with the command-line 
build using the _VS command line_ (it has all the paths to the msvc7 
tools), then use the library and include in a separate msvc7 project. I 
actually couldn't get the ode/contrib/msvc7 project to build at all, 
but the step-by-step worked great. I will prepare an updated version of 
these instructions and post it to the wiki and back here too.

In the mean time, here it is, maybe marked up a bit:

I recently worked thru compiling the ODE.  I know many others have also 
had
problems with it so I thought I'd lay out the steps I took.

STEP 1:
Downloaded ode and put it in the root of "C:\" (example: C:\ode-0.035\)

STEP 2:
Opened user-settings file (in the config folder) and set the following:
PLATORM=msvc  (I was compiling to a .lib)
PRECISION=DOUBLE
BUILD=release
WINDOWS16=0

STEP3:
Downloaded Make.exe from the link provided in the ode documentation. 
Put the
"Make.exe" file in the root of the "ode-0.035" folder.

STEP4:
Opened "c:\ode-0.035\ode\src\error.cpp" and commented out all the 
"exit(1);
I also had to comment out the "abort(1)" functions.
(It may be better to redefine these according to some compile-time 
flags)

STEP5:
Added a lib folder to the root of "ode-0.035". Without this folder, I 
got an
error.

STEP6:
Opened the VS.Net command prompt. (NOT the windows command prompt.) 
cd'd to
c:\ode-0.035

STEP7:
make ode-lib

This  compiles to ode.lib and places it in the .lib file created in 
step 5.

That's it. Hope this helps some people. And if you figure out how to 
compile
without having to comment out those exit(1) and abort(1) functions let 
me
know.

(END MESSAGE)

Regarding the type of msvc7 project, just choose a command line or 
windows project. Doesn't really matter. However, I had problems setting 
the stack size when in debug mode - it's like it ignores the stack 
option, so boxstack crashes if you hold down 'x'. Release mode just 
slows down if you hold 'x'. Can't figure this one out, but doesn't 
matter for now.

   - John DeWeese

On Wednesday, March 12, 2003, at 10:46 AM, Pete Graves wrote:

> I have been playing with ODE for a while now, but I have been 
> replacing the test_blah.cpp files, and running "make ode-test" to 
> compile an executable.
>
> I have tried creating projects in Visual Studio .NET, and KDevelop 
> without success. I'm not very experienced with either of these IDEs. I 
> have compiled ODE okay with GNU make (either in Windows or Linux), and 
> copied the include/ and lib/ directories:
>
> - in Windows: to C:\Program Files\Microsoft Visual Studio .NET\Vc7\
> - in Linux: to /usr/local/
>
> Then, if I make an empty project and try to build:
>
> #include <ode/ode.h>
> #include <drawstuff/drawstuff.h>
> #include <iostream>
>
> int main()
> {
>  dWorldID world;
>  world = dWorldCreate();
>  std::cout << "Hello world!" << endl;
>  return 0;
> }
>
> I get "error LNK2019: unresolved external symbol _dWorldCreate 
> referenced in function _main"
> (This is from MSVC, KDevelop says something similar)
>
> Could someone give me newbie instructions for setting up a project in 
> VS.NET, KDevelop, or any suitable (free) IDE that I can use to write 
> my own programs.
>
> What type of project should I create in VS.NET to use drawstuff and 
> ode? Do I need to set anything else to where I've put the ODE files?
>



   - John DeWeese