Dll not found while linking statically

120 views
Skip to first unread message

Platon Vin

unread,
Nov 5, 2023, 6:20:57 AM11/5/23
to ode-users
The following code does not work:

#define dSINGLE
#include <ode/ode.h>

int main()
{  
    printf("start\n");
    dInitODE2(0);
}

printf is not being executed (produces same results with dInitODE() )

However, it successfully compiles.
Using gdb i found that
"
[Thread 19024.0x1174 exited with code 3221225781]
[Thread 19024.0x242c exited with code 3221225781]
During startup program exited with code 0xc0000135.
"
which as far as i know ussually means that dll library is not found
i am using "gcc .\client\test_ode.c -o .\test.exe -O0 -Iincludes -Llibs -l:libode_singled.a -g" for compiling this program. "libs" folder is where  libode_singled.a (configured for gmake and compiled with -O0) is placed, and "ode" is inside "includes" and containes all the headers
So.. What is wrong? 

BTW, im on windows, gcc version is 12.1.0

Vaillancourt

unread,
Nov 5, 2023, 11:50:47 AM11/5/23
to ode-users
Hello!

I'm not familiar with the toolset you use as I'm used to the VS setup, but if you're able to compile (and link) and you have your .exe produced, you'll typically want to have the DLLs of ode in the same directory of ODE.

So make sure your test.exe has access to all the DLLs it requires first.

Good luck!

-Vaillancourt

Platon Vin

unread,
Nov 6, 2023, 11:51:18 AM11/6/23
to ode-users
That helped, thanks! But i still do not get why do i need to link with static library and use the dynamic version.
Also, could you help me with using ODE? I init it, create world, set gravity in world, create space, create body, set its speed and position, enable it, enable gravity for it, give it mass and even shape (geometry) but on update (step) nothing changes. Even if body had non-zero speed and posiotion on creation when i check its always zero (even without any steps done). I did not find any modern ODE C examples so i tried understanding .cpp demos, but seems like i didn't get it

*code*
#define dSINGLE
#include <ode/ode.h>
#include <windows.h>
#include <assert.h>

int main()
{  
    printf("start\n");
    dInitODE();
   
    dWorldID world = dWorldCreate();
    dWorldSetGravity(world, 0.1, 0.1, -10.0);
    dWorldSetDamping(world, 1e-4, 1e-5);
    dSpaceID space = dHashSpaceCreate(0);

    dMass mass = {};
    dBodyID  body  = dBodyCreate(world);
    dBodySetPosition(body, 1.0, 1.0, 1.0);
    dBodySetLinearVel(body, 1.0, 1.0, 1.0);
    dBodySetAngularVel(body, 0, 0, 0);
    dBodySetGravityMode(body, 1);
    dBodyEnable(body);

    // dMassSetZero(&mass);
    mass.mass = 1.0;
    dMassSetSphere(&mass, 1.0, 1.0);
    dBodySetMass(body, &mass);

    dGeomID geom = dCreateSphere(space, 1.0);
    dGeomSetBody(geom, body);

    dVector3* pos = dBodyGetPosition(body);
    printf("pos %.1f %.1f %.1f %.1f\n", pos[0], pos[1], pos[2], pos[3]);
    dVector3* vel = dBodyGetPosition(body);
    printf("vel %.1f %.1f %.1f %.1f\n", vel[0], vel[1], vel[2], vel[3]);

    for (int i=0; i < 100; i++)
    {
        dVector3 grav;
        assert(dBodyIsEnabled(body)==1);
        dWorldGetGravity(world, &grav);
        printf("grav %.1f %.1f %.1f %.1f\n", grav[0], grav[1], grav[2], grav[3]);

        assert(dBodyGetGravityMode(body)==1);


        dVector3* frc =  dBodyGetForce(body);
        printf("force_before %.1f %.1f %.1f %.1f\n", frc[0], frc[1], frc[2], frc[3]);

        Sleep(50); //50 ms
        assert(dWorldStep(world, 0.05) == 1);

        frc =  dBodyGetForce(body);
        printf("force_after %.1f %.1f %.1f %.1f\n", frc[0], frc[1], frc[2], frc[3]);


        frc =  dBodyGetForce(body);
        printf("grav %.1f %.1f %.1f %.1f\n", frc[0], frc[1], frc[2], frc[3]);
        pos = dBodyGetPosition(body);
        printf("pos %.1f %.1f %.1f %.1f\n", pos[0], pos[1], pos[2], pos[3]);
        printf("pos %.1f %.1f %.1f %.1f\n\n", pos[0], pos[1], pos[2], pos[3]);
    }

    dWorldDestroy(world);
}

воскресенье, 5 ноября 2023 г. в 19:50:47 UTC+3, Vaillancourt:
Message has been deleted

Danny Chapman

unread,
Nov 6, 2023, 1:51:52 PM11/6/23
to ode-users
ODE is an amazing physics engine, capable of producing great results (when suitably modified etc!) - I used it for WeightShift which was used in a number of high-profile films/shows (His Dark Materials, The Tomorrow War etc). 

However, I'm leaving this group because I'm fed up with seeing Oleh's offensive, arrogant and often unhelpful posts (not just the one below, but previously too). I would encourage the other admins to consider whether he should have a role here.

- Danny

On Monday, 6 November 2023 at 18:31:16 UTC Oleh Derevenko wrote:

Don’t help him. He’s a Russian. Russians are not people – they are just like wild animals.

 

Oleh Derevenko

-- Skype with underscore

 

From: ode-...@googlegroups.com <ode-...@googlegroups.com> On Behalf Of Platon Vin
Sent: Monday, November 6, 2023 6:51 PM
To: ode-users <ode-...@googlegroups.com>
Subject: [ode-users] Re: Dll not found while linking statically

 

Ви нечасто отримуєте електронні листи від plat...@gmail.com. Дізнайтеся, чому це важливо

That helped, thanks! But i still do not get why do i need to link with static library and use the dynamic version.
Also, could you help me with using ODE? I init it, create world, set gravity in world, create space, create body, set its speed and position, enable it, enable gravity for it, give it mass and even shape (geometry) but on update (step) nothing changes. Even if body had non-zero speed and posiotion on creation when i check its always zero (even without any steps done). I did not find any modern ODE C examples so i tried understanding .cpp demos, but seems like i didn't get it




This e-mail may contain privileged and confidential information. If you are not the intended recipient, be aware that any use, disclosure, copying or distribution of this e-mail or any attachments is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you.
Message has been deleted

Platon Vin

unread,
Nov 8, 2023, 4:02:03 PM11/8/23
to ode-users
Lmao im not even from russia. I'm trying to find physics engine that works with my C project and on every single forum i was ignored except ODE but once i ask for help someone just bullied me because of me being russian while im actually not russian
понедельник, 6 ноября 2023 г. в 22:23:47 UTC+3, Oleh Derevenko:

Danny,

 

I can understand that you don’t understand me. Just Russians HAVE TO feel drawbacks of what they are doing or otherwise they are going to destroy the world. Russia is an empire with nuclear weapons. And the primary aim of every empire is to expand and get control of entire world around them. They have been doing this for centuries and will continue to do this as long as they exist. Their sense of life is an imaginary glory and turning everyone around into Russians to be like them. And human life is nothing in front of this “great goal”. They form their children’s minds starting from kindergartens, they go to war and kill just because their country is paying for this, and they accept death just because their “emperor” Putin told them to.

 

Oleh Derevenko

-- Skype with underscore

 

From: ode-...@googlegroups.com <ode-...@googlegroups.com> On Behalf Of Danny Chapman
Sent: Monday, November 6, 2023 8:52 PM
To: ode-users <ode-...@googlegroups.com>
Subject: Re: [ode-users] Re: Dll not found while linking statically

 

ODE is an amazing physics engine, capable of producing great results (when suitably modified etc!) - I used it for WeightShift which was used in a number of high-profile films/shows (His Dark Materials, The Tomorrow War etc). 

 

However, I'm leaving this group because I'm fed up with seeing Oleh's offensive, arrogant and often unhelpful posts (not just the one below, but previously too). I would encourage the other admins to consider whether he should have a role here.

 

- Danny

Gabriel Silva Moreira

unread,
Dec 11, 2023, 2:04:29 PM12/11/23
to ode-...@googlegroups.com
Fuck you Oleh

Em seg., 6 de nov. de 2023 às 16:23, 'Oleh Derevenko' via ode-users <ode-...@googlegroups.com> escreveu:

Danny,

 

I can understand that you don’t understand me. Just Russians HAVE TO feel drawbacks of what they are doing or otherwise they are going to destroy the world. Russia is an empire with nuclear weapons. And the primary aim of every empire is to expand and get control of entire world around them. They have been doing this for centuries and will continue to do this as long as they exist. Their sense of life is an imaginary glory and turning everyone around into Russians to be like them. And human life is nothing in front of this “great goal”. They form their children’s minds starting from kindergartens, they go to war and kill just because their country is paying for this, and they accept death just because their “emperor” Putin told them to.

 

Oleh Derevenko

-- Skype with underscore

 

From: ode-...@googlegroups.com <ode-...@googlegroups.com> On Behalf Of Danny Chapman
Sent: Monday, November 6, 2023 8:52 PM
To: ode-users <ode-...@googlegroups.com>
Subject: Re: [ode-users] Re: Dll not found while linking statically

 

ODE is an amazing physics engine, capable of producing great results (when suitably modified etc!) - I used it for WeightShift which was used in a number of high-profile films/shows (His Dark Materials, The Tomorrow War etc). 

 

However, I'm leaving this group because I'm fed up with seeing Oleh's offensive, arrogant and often unhelpful posts (not just the one below, but previously too). I would encourage the other admins to consider whether he should have a role here.

 

- Danny



This e-mail may contain privileged and confidential information. If you are not the intended recipient, be aware that any use, disclosure, copying or distribution of this e-mail or any attachments is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you.

--
You received this message because you are subscribed to the Google Groups "ode-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ode-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ode-users/AS4PR07MB88999946DE5683C67E668740DDAAA%40AS4PR07MB8899.eurprd07.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages