Author Topic: Arc Sythesis site code not working  (Read 6212 times)

Offline crinkle

  • Multiple posting newcomer
  • *
  • Posts: 11
Arc Sythesis site code not working
« on: August 13, 2014, 11:10:08 pm »
Hello there I have started again trying to learn C++. I am trying to get the hang of graphics programming so have thrown away a lot of stuff I found which only mentions how to make very simple games which work through the console, which I've already previously done. I need something a bit better now, I need graphics, graphics turn me on!

So I started looking at the http://www.arcsynthesis.org/gltut/ series again and this time got as far as downloading the tutorials and the pre-make utility.

I even managed to get premake to compile the code into a codeblocks compatible format. But when I go into the code and run the framework.cpp. It fails to run with "You must select a "host" application to run a library". I have no idea how to solve this.

I'm not sure if this has something to do with the http://www.arcsynthesis.org/gltut/Building%20the%20Tutorials.html
page, as it gives only the very vaguest hints as to what to do with the downloads, and quite frankly, it doesnt tell you what to do with (whatever file it makes) when you premake the opengl library files.

Can anyone offer help (or a step by step list) of everything I need to do to be able to run the tutorials after I premake it (in codeblocks)

What I did:

* Download Tutorial files, premake and the Unofficial OpenGL SDK, and unzip them
* Ran premake on a tutorial to make it codeblocks freindly.
* Ran premake on the OpenGl stuff to do... something?
* Opened codeblocks and ran said tutorial.... got error message.

So can someone advise where I went wrong?

Offline pirx67

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Arc Sythesis site code not working
« Reply #1 on: August 14, 2014, 02:16:35 am »
I had a look at the linked web pages and I'll try to give some hints. From my understanding your problems don't have do with Code::Blocks.
Btw. are you using Windows or Linux?

Quote
I even managed to get premake to compile the code into a codeblocks compatible format. But when I go into the code and run the framework.cpp. It fails to run with "You must select a "host" application to run a library". I have no idea how to solve this.

I think you did the second step before the first because there is no framework.cpp file in the Unofficial OpenGL SDK @ http://glsdk.sourceforge.net/docs/html/index.html that you need to install (and build) first. It seems that framework.cpp belongs to the tutorial source tree.

Quote
* Ran premake on a tutorial to make it codeblocks freindly.
* Ran premake on the OpenGl stuff to do... something?

Well premake will build a Code::Blocks workspace file and some project files for you in the SDK folder that later can be used to build the SDK.
On my machine called in the SDK source directory it looks like this:
Code
pirx67@hal2006:~/Src/OpenGL/glsdk_0_5_2$ premake4 codeblocks
Building configurations...
Running action 'codeblocks'...
Generating glsdk.workspace...
Generating glload/glload.cbp...
Generating glimg/glimg.cbp...
Generating glfw/glfw.cbp...
Generating freeglut/freeglut.cbp...
Generating glutil/glutil.cbp...
Generating glmesh/glmesh.cbp...
Done.

It generates a workspace file and some project files for Code::Blocks.

You should then open the generated workspace file and be able to build the SDK using Code::Blocks via Menu "Build->Build workspace".
(Not tested here ...) There will be build dependencies to the OpenGL headers.

After all you should be able to call "premake4 codeblocks" in every tutorial directory. Using the generated workspace/project files you should
be able to build them.

For further assistance you should ask the people that published the referenced book @http://www.arcsynthesis.org/gltut/ and / or the guys of the OpenGL SDK because your problems don't have so much to with Code::Blocks (remember the forum's rules).

Hope that helps,
    pirx67


Offline crinkle

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Arc Sythesis site code not working
« Reply #2 on: August 14, 2014, 08:08:44 am »
Ok I've ran the opengl workspace files and compiled that.

Can you advise what to do next? did it make a file which I have to place anywhere?

Again I tried running the program and got the same error message, so something still needs to be done...

Offline pirx67

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Arc Sythesis site code not working
« Reply #3 on: August 14, 2014, 10:51:48 am »
Quote
Ok I've ran the opengl workspace files and compiled that.

Well, that shows in my opinion that premake4 is able to generate valid workspace/project files for Code::Blocks.

We're still OT. I think you should read the build information given @http://www.arcsynthesis.org/gltut/Building%20the%20Tutorials.html Tutorial Building
thoroughly. Quoted from there:
Quote
Each tutorial directory has a premake4.lua file; this file is used by Premake to generate the build files for that tutorial. Therefore, to build any tutorial, you need only go to that directory and type premake4 plat, then use those build files to build the tutorial.

Each tutorial will generally have more than one source file and generate multiple executables. Each executable represents a different section of the tutorial, as explained in that tutorial's documentation.

That section also mentions framework.cpp:
Quote
If you look at any of the tutorial source files, you will not find the main function defined anywhere. This function is defined in framework/framework.cpp; it and all of the other source files in the framework directory is shared by every tutorial. It does the basic boilerplate work: creating a FreeGLUT window, etc.

I interpret this as framework/framework.cpp only providing a library not a standalone program. Therefore you shouldn't try to compile and run that.
It's only meant as supporting library for the real tutorials.

Go in one of the tutorial subdirectories and build the associated project. It should use the mentioned framework stuff.

Btw. this is all guesswork based on the documentation cited. Please direct further questions to the guys responsible for that software.

Cu,
    pirx67

Offline crinkle

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Arc Sythesis site code not working
« Reply #4 on: August 14, 2014, 06:32:00 pm »
Thanks for the help, I tried, but still not working. When I go into the tutorials subdirectory code and run it, the error given is now a build error of:

Code
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lglloadD
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lglimgD
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lglutilD
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lglmeshD
c:/program files (x86)/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../../mingw32/bin/ld.exe: cannot find -lfreeglutD

I guess then its impossible to learn graphics programming in c++ without paying 1000s to take an educational course (goodbye bedroom coders), as no one knows how to do it! This looked like the one good place that every said was good to learn this stuff, but they have only the vaguest setup instructions, and worst of all, theres no way to contact the people that made it. And here, the general c++ forums too, everyone says its someone else's fault and no one can help.

Goddammit... :(

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Arc Sythesis site code not working
« Reply #5 on: August 14, 2014, 06:48:31 pm »
Well, first thing you need to learn is how to use the compiler and linker. Your output says everything: the linker can't find library files.
Find directory which contains libglloadD.a library file and enter this path in linker search path in the CodeBlocks project properties.
Repeat for other libraries if necessary.
And don't panic if something is not working. Believe me, you can learn what you need yourself.

BTW, avoid installing MinGW in Program Files or in other paths containing spaces. You may encounter some errors.

Offline pirx67

  • Multiple posting newcomer
  • *
  • Posts: 40
Re: Arc Sythesis site code not working
« Reply #6 on: August 15, 2014, 11:20:51 am »
After downloading the tutorial from http://bitbucket.org/alfonse/gltut/downloads and unpacking it I saw that a stripped down
version of the Unofficial OpenGL SDK sits already in the tree under glsdk. How it came there refer to get_externals.lua.

The generated Code::Blocks workspace and project files for the tutorials (i. e. "Tut 01 Hello Triangle") set their linker search paths into
that directory. If you have built the stuff in glsdk successfully your building of "Tut 01 Hello Triangle" should work as expected.

If you downloaded an Unofficial OpenGL SDK on your own and built it then move it to the glsdk in the tutorial tree because
it is expected there by the Code::Blocks project files.

Cu,
    pirx67

See the screen shot for the Code::Blocks linker search paths set in the generated project file of "Tut 01 Hello Triangle".