flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > [solved] Mingw32 error undefined reference to

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 01 Sep 2024, 10:00
How fix this error ?

Temp\ccou1WU1.o:demo_space.cpp:(.text+0x29): undefined reference to `dRandReal'
Temp\ccou1WU1.o:demo_space.cpp:(.text+0x65): undefined reference to `dRandReal'
Temp\ccou1WU1.o:demo_space.cpp:(.text+0x90): undefined reference to `dRandReal'
Temp\ccou1WU1.o:demo_space.cpp:(.text+0xcc): undefined reference to `dRandReal'

My bat file:
Code:
g++ -L C:\Users\Roma\Downloads\ode-0.16.5\ode-0.16.5\lib\Release\libode.a -I C:\Users\Roma\Downloads\ode-0.16.5\ode-0.16.5\include\ demo_space.cpp -o "C:\Users\Roma\Downloads\ode-0.16.5\demo_space.o" -std=c++11 

    
Post 01 Sep 2024, 10:00
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4024
Location: vpcmpistri
bitRAKE 01 Sep 2024, 15:56
You could verify the ode library was built correctly, including the missing function with:
Code:
nm C:\Users\Roma\Downloads\ode-0.16.5\ode-0.16.5\lib\Release\libode.a | grep dRandReal    
... but the commands to include the library are incorrect, try:
Code:
g++ demo_space.cpp -o "C:\Users\Roma\Downloads\ode-0.16.5\demo_space.o" -I "C:\Users\Roma\Downloads\ode-0.16.5\ode-0.16.5\include" -L "C:\Users\Roma\Downloads\ode-0.16.5\ode-0.16.5\lib\Release" -lode -std=c++11    
... the -L option should just be a directory.
Then use the -lode option to link the libode.a library.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 01 Sep 2024, 15:56
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 01 Sep 2024, 16:14
Nice i get couple errors. Only 5 errors !
Temp\ccIW9iAu.o:demo_space.cpp:(.text+0x623): undefined reference to `dsSetViewpoint'
Temp\ccIW9iAu.o:demo_space.cpp:(.text+0x83a): undefined reference to `dsSetColor'
Temp\ccIW9iAu.o:demo_space.cpp:(.text+0x852): undefined reference to `dsSetColor'
Temp\ccIW9iAu.o:demo_space.cpp:(.text+0x86b): undefined reference to `dsDrawBox'
Temp\ccIW9iAu.o:demo_space.cpp:(.text+0x97c): undefined reference to `dsSimulationLoop'
Post 01 Sep 2024, 16:14
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4024
Location: vpcmpistri
bitRAKE 01 Sep 2024, 16:32
-ldrawstuff
Post 01 Sep 2024, 16:32
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 01 Sep 2024, 16:49
C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -ldrawstuff: No such file or directory
Post 01 Sep 2024, 16:49
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4024
Location: vpcmpistri
bitRAKE 01 Sep 2024, 17:08
The manual says the DrawStuff library is just for the demos. Perhaps it has not been built or is located elsewhere.
Post 01 Sep 2024, 17:08
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 01 Sep 2024, 19:16
I delete all drawStuff functions and compiled demo_plane2d.o

How compiled demo_plane2d.o to exe file ?
Post 01 Sep 2024, 19:16
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4024
Location: vpcmpistri
bitRAKE 01 Sep 2024, 19:26
My guess would be to follow the manual install instructions.
I've never used to the library before.
Post 01 Sep 2024, 19:26
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 01 Sep 2024, 19:29
I get errors:
demo_plane2d0.o:crtexe.cSad.text+0x400): multiple definition of `WinMainCRTStartup'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.text+0x400): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.text+0x410): multiple definition of `mainCRTStartup'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.text+0x410): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.text+0x420): multiple definition of `atexit'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.text+0x420): first defined here
ld.exe: demo_plane2d0.o:cygming-crtbeg:(.text+0x450): multiple definition of `__gcc_register_frame'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/crtbegin.o:cygming-crtbeg:(.text+0x0): first defined here
ld.exe: demo_plane2d0.o:cygming-crtbeg:(.text+0x4f0): multiple definition of `__gcc_deregister_frame'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/crtbegin.o:cygming-crtbeg:(.text+0xa0): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.CRT+0x10): multiple definition of `__mingw_pcinit'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.CRT$XIAA+0x0): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.bss+0x20): multiple definition of `hmod_libgcc'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/crtbegin.o:cygming-crtbeg:(.bss+0x0): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.CRT+0x4): multiple definition of `__mingw_pcppinit'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.CRT$XCAA+0x0): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.idata+0x440): multiple definition of `_imp___ZTVN10__cxxabiv121__vmi_class_type_infoE'; demo_plane2d0.o:crtexe.cSad.idata+0x440): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.bss+0x0): multiple definition of `__mingw_module_is_dll'; C:/MinGW/bin/../lib/gcc/i686-w64-mingw32/14.1.0/../../../../i686-w64-mingw32/lib/../lib/crt2.o:crtexe.cSad.bss+0x0): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.idata+0x438): multiple definition of `_imp___ZTVN10__cxxabiv117__class_type_infoE'; demo_plane2d0.o:crtexe.cSad.idata+0x438): first defined here
ld.exe: demo_plane2d0.o:crtexe.cSad.idata+0x43c): multiple definition of `_imp___ZTVN10__cxxabiv120__si_class_type_infoE'; demo_plane2d0.o:crtexe.cSad.idata+0x43c): first defined here
Post 01 Sep 2024, 19:29
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1769
Roman 02 Sep 2024, 02:55
Its my mistake.
I create file Demo.o, but must exe
I changed o to Demo.exe
Now run exe.
Post 02 Sep 2024, 02:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.