Horde3D http://www.horde3d.org/forums/ |
|
[Newbie] how to compile and run something http://www.horde3d.org/forums/viewtopic.php?f=2&t=1711 |
Page 1 of 1 |
Author: | Inuart [ 04.09.2012, 23:11 ] |
Post subject: | [Newbie] how to compile and run something |
First, hello everyone! ![]() Second, I'm a n00b at deploying software on linux and I could use some clarifications on the building process. I find that the instructions here (Building on Linux with gcc) are great and easy to follow and I think I compiled Horde3D successfully But now.. now what? How do I have to arrange everything to make the "minimal app" at the bottom to work? The Horde3D.h file is in the Bindings/C++ folder, but I'm using C.. libHorde3D.so is created but there's no libHorde3D.a, will this have any consequence when I deploy my app? Thank you for your time! ![]() |
Author: | tshannon [ 06.09.2012, 02:35 ] |
Post subject: | Re: [Newbie] how to compile and run something |
Depending on how you want to build things, you may want to do a make install as well to put the horde header file and library in your /usr/local directories. The .so is the shared library, .a is the static library. You shouldn't need the .a. |
Author: | Inuart [ 09.09.2012, 20:32 ] |
Post subject: | Re: [Newbie] how to compile and run something |
If I want to compile everything at the same time to make a standalone executable what steps do I need to follow? |
Author: | shd [ 10.09.2012, 03:38 ] |
Post subject: | Re: [Newbie] how to compile and run something |
Inuart wrote: If I want to compile everything at the same time to make a standalone executable what steps do I need to follow? I assume you've already compiled Horde3D with: Code: $ cd $HORDE3D_DIR && cmake .. && make && sudo make install Just in case, make sure that ldconfig detects your Horde3D library: Code: # sudo ldconfig -p | grep Horde3D libHorde3DUtils.so (libc6,x86-64) => /usr/local/lib/libHorde3DUtils.so libHorde3D.so (libc6,x86-64) => /usr/local/lib/libHorde3D.so The procedure is simple, just create your test program: Code: $ echo ' #include <cstdio> #include "horde3d/Horde3D.h" int main() { printf("%s", h3dGetVersionString()); return 0; } ' > main.cpp and compile it Code: $ gcc main.cpp -lHorde3D -o test If it fails, that probably means you haven't added /usr/local/include to search path. Code: export CXX_FLAGS="$CXX_FLAGS -I/usr/local/include" and run the test Code: $ ./test You should see a string like `Horde3D 1.0.0 Beta5`. |
Author: | tshannon [ 10.09.2012, 16:16 ] |
Post subject: | Re: [Newbie] how to compile and run something |
Shd, that's actually a really nice and easy starting point for someone just making sure their build environment is correct. You should consider adding that to the Wiki. |
Author: | Inuart [ 12.09.2012, 14:00 ] |
Post subject: | Re: [Newbie] how to compile and run something |
Thank you very much for this info! I suspect my problem was that my source file was named main.c. Renaming it to main.cpp did the trick. I'll try to use these headers and see if I can use C instead of C++. Thank you for your help |
Author: | tshannon [ 12.09.2012, 16:25 ] |
Post subject: | Re: [Newbie] how to compile and run something |
Yeah, the horde headers are actually c++, which is why I rewrote them for the Go interface. I wouldn't use them as a header file for a c compiler though. I ripped out several things, and moved them into Go code. Specifically all the constants, which you'll need to do anything with the Horde API. If you're interested in Go code though I encourage you to look at it. You don't have to mess with a lot of the stuff you usually have to with C / C++. A compile is simply "go build". It feels more like a scripting or dynamic language, except you get the speed of a statically compiled one. http://tour.golang.org will walk you through the whole lanuage if you're interested. |
Author: | shd [ 12.09.2012, 19:04 ] |
Post subject: | Re: [Newbie] how to compile and run something |
tshannon wrote: Shd, that's actually a really nice and easy starting point for someone just making sure their build environment is correct. You should consider adding that to the Wiki. I'm glad you like my explanation. Anyway i can see a similar one on http://www.horde3d.org/wiki/index.php5?title=Building_Horde3D, so i don't really feel comfortable with modifying it. |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |