Horde3D

Next-Generation Graphics Engine
It is currently 19.03.2024, 09:16

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Trouble compiling sample
PostPosted: 12.09.2013, 16:39 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
When I try to compile the "chicago" app.cpp with MinGW, I get the following errors:
Code:
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x163): undefined
reference to `_imp__h3dInit'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x171): undefined
reference to `_imp__h3dutDumpMessages'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x18f): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x1a6): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x1bd): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x1d4): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x1eb): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x209): undefined
reference to `_imp__h3dAddResource'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x232): undefined
reference to `_imp__h3dAddResource'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x25b): undefined
reference to `_imp__h3dAddResource'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x284): undefined
reference to `_imp__h3dAddResource'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x2ad): undefined
reference to `_imp__h3dAddResource'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x2d6): more undef
ined references to `_imp__h3dAddResource' follow
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x335): undefined
reference to `_imp__h3dutLoadResourcesFromDisk'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x358): undefined
reference to `_imp__h3dAddCameraNode'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x378): undefined
reference to `_imp__h3dAddNodes'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x3d9): undefined
reference to `_imp__h3dSetNodeTransform'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x3ee): undefined
reference to `_imp__h3dAddNodes'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x44f): undefined
reference to `_imp__h3dSetNodeTransform'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x46c): undefined
reference to `_imp__h3dSetNodeFlags'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x499): undefined
reference to `_imp__h3dAddLightNode'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x4fa): undefined
reference to `_imp__h3dSetNodeTransform'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x520): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x546): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x563): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x589): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x5af): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x5d5): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x5fb): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x621): undefined
reference to `_imp__h3dSetNodeParamF'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x65f): undefined
reference to `CrowdSim::init()'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x6bd): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x6e8): undefined
reference to `_imp__h3dSetOption'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x715): undefined
reference to `CrowdSim::update(float)'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x791): undefined
reference to `_imp__h3dSetNodeTransform'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x7be): undefined
reference to `_imp__h3dutShowFrameStats'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x7ea): undefined
reference to `_imp__h3dGetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x84f): undefined
reference to `_imp__h3dutShowText'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x8a2): undefined
reference to `_imp__h3dutShowText'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x8bd): undefined
reference to `_imp__h3dGetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x8e1): undefined
reference to `_imp__h3dGetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x9b3): undefined
reference to `_imp__h3dShowOverlays'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x9c6): undefined
reference to `_imp__h3dRender'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x9cd): undefined
reference to `_imp__h3dFinalizeFrame'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x9d4): undefined
reference to `_imp__h3dClearOverlays'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0x9db): undefined
reference to `_imp__h3dutDumpMessages'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xa1e): undefined
reference to `_imp__h3dRelease'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xa4d): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xa70): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xa92): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xab4): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xaee): undefined
reference to `_imp__h3dSetupCameraView'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xb0f): undefined
reference to `_imp__h3dResizePipelineBuffers'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xb30): undefined
reference to `_imp__h3dResizePipelineBuffers'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xbc7): undefined
reference to `_imp__h3dGetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xc03): undefined
reference to `_imp__h3dSetNodeParamI'
C:\Users\Mikolaj\AppData\Local\Temp\ccrPRLFd.o:app.cpp:(.text+0xc2d): undefined
reference to `_imp__h3dSetNodeParamI'
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../libmingw32.a(main.o): In function
 `main':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMai
n@16'
collect2: ld returned 1 exit status


The command I use to compile this is:
Code:
g++ -o app.exe app.cpp

I put Horde3D.h and Horde3DUtils.h into the folder with the rest of the code of "chicago".
This error is, as far as I'm concerned, caused by not including some linker flags and/or not putting some files into the correct directory, please correct me if I'm wrong.


Top
 Profile  
Reply with quote  
PostPosted: 12.09.2013, 18:16 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Why don't you use cmake and the provided CMake files?


Top
 Profile  
Reply with quote  
PostPosted: 12.09.2013, 18:39 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
I simply have more experience with MinGW, I never used Cmake before so I don't really know what to do with the Cmake files. Thanks anyways, I'll try. I'd appreciate some info on how to use the CmakeLists.txt :).


Top
 Profile  
Reply with quote  
PostPosted: 12.09.2013, 19:32 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
I used Cmake and it didn't compile. This time, it said:
Code:
The C compiler identification is unknown
The CXX compiler identification is unknown
Check for working C compiler: c:/MinGW/bin/gcc.exe
Check for working C compiler: c:/MinGW/bin/gcc.exe -- broken
CMake Error at C:/C++/new_age/cmake-2.8.11.2-win32-x86/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "c:/MinGW/bin/gcc.exe" is not able to compile a simple test
  program.

  It fails with the following output:

   Change Dir: C:/C++/new_age/engine/Horde3D/Samples/Chicago/CMakeFiles/CMakeTmp

 

  Run Build Command:c:/MinGW/bin/mingw32-make.exe
  "cmTryCompileExec1656454833/fast"

  c:/MinGW/bin/mingw32-make.exe -f
  CMakeFiles\cmTryCompileExec1656454833.dir\build.make
  CMakeFiles/cmTryCompileExec1656454833.dir/build

  mingw32-make.exe[1]: Entering directory
  `C:/C++/new_age/engine/Horde3D/Samples/Chicago/CMakeFiles/CMakeTmp'

  C:\C++\new_age\cmake-2.8.11.2-win32-x86\bin\cmake.exe -E
  cmake_progress_report
  C:\C++\new_age\engine\Horde3D\Samples\Chicago\CMakeFiles\CMakeTmp\CMakeFiles
  1

  Building C object
  CMakeFiles/cmTryCompileExec1656454833.dir/testCCompiler.c.obj

  c:\MinGW\bin\gcc.exe -o
  CMakeFiles\cmTryCompileExec1656454833.dir\testCCompiler.c.obj -c
  C:\C++\new_age\engine\Horde3D\Samples\Chicago\CMakeFiles\CMakeTmp\testCCompiler.c


  mingw32-make.exe[1]: ***
  [CMakeFiles/cmTryCompileExec1656454833.dir/testCCompiler.c.obj] Error 1

  mingw32-make.exe[1]: Leaving directory
  `C:/C++/new_age/engine/Horde3D/Samples/Chicago/CMakeFiles/CMakeTmp'

  mingw32-make.exe: *** [cmTryCompileExec1656454833/fast] Error 2

 

 

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
 


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Configuring incomplete, errors occurred!


Top
 Profile  
Reply with quote  
PostPosted: 12.09.2013, 19:43 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Your compiling toolchain seems to be broken.
Normally the cmake files should be working out of the box. See also the wiki pages for more details about using cmake.


Top
 Profile  
Reply with quote  
PostPosted: 14.09.2013, 21:32 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
I managed to create a makefile using Cmake, but:
-When i try to compile it to an executable using the command mingw32-make, i get these errors:
Code:
Linking CXX executable Chicago.exe
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lHorde3D
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lHorde3DUtils
c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe: cannot find -lglfw
collect2: ld returned 1 exit status
mingw32-make[2]: *** [Chicago.exe] Error 1
mingw32-make[1]: *** [CMakeFiles/Chicago.dir/all] Error 2
mingw32-make: *** [all] Error 2

-When i compiled glwf, it compiled successfully, but I can't find an executable anywhere! Thanks for any help :)


Top
 Profile  
Reply with quote  
PostPosted: 14.09.2013, 21:45 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
The errors says that next to glfw also the Horde3D and the Horde3DUtils libraries are missing. Are you sure that the compilation of the chicago sample finished successfully after you comiled glfw? Normally the missing Horde3D libraries should still cause an error.

But I still don't understand, why you are not able to compile all the things right out of the box.

I just tested a MinGW build a few days ago, and after I made sure, that sh.exe from the MSYS tools was not accessible by the PATH environment variable (CMake does not like that), it worked out of the box.

Did you downloaded a zip package from the sourceforge page or did you check out one of the repositories (development branch on github or the trunk from SourceForge SVN).


Top
 Profile  
Reply with quote  
PostPosted: 15.09.2013, 18:56 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
I managed to compile the samples by giving up on compiling each one on its own and compiling them together. However, they don't work on other computers because libgcc_s_dw2-1.dll is missing. I tried to add -static-libgcc but it still caused the same error.


Top
 Profile  
Reply with quote  
PostPosted: 21.09.2013, 13:14 
Offline

Joined: 12.09.2013, 16:29
Posts: 6
I managed to compile everything. Getting ready for adding bullet physics. Thanksfor your help!


Top
 Profile  
Reply with quote  
PostPosted: 22.09.2013, 05:16 
Offline

Joined: 08.01.2008, 14:57
Posts: 66
Could you explain the solution, please?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group