Page 1 of 1

Gcc arguments?

Posted: Fri Jun 17, 2016 10:49 pm
by X14U2NVX
Having followed the basic bullet installation tutorials, I can't seem to get the basicdemo's main.cpp function to compile or run. The standalone release executables, such as the ExampleBrowser work like a charm and there were no issues during the bullet source compile or installation (Ubuntu 14.04 LTS). However, when I go to compile basicdemo's main.cpp function, the compiler claims that there's an undefined reference to BasicExampleCreateFunc(CommonExampleOptions&), even though that function can be found in in the included BasicExample.h file. I am running gcc from a terminal in that directory, so I have no idea why it's reading BasicExample.h but is unable to find the function. I am unsure if this has to do with my additional gcc linking arguments, as I can't find a consistent answer on what needs to be included and what doesn't anywhere.

Is there a tutorial for compiling from terminal? How in the world can main claim that this is an undefined reference?

Re: Gcc arguments?

Posted: Sun Jun 19, 2016 12:10 pm
by pinkisntwell
"undefined reference" is a linker error so it has nothing to do with an .h file. Make sure you pass the appropriate -L and -l options to gcc and you will be fine. Note that for the -l argument it matters where it is placed in the command line. It should be put after its dependents.

Re: Gcc arguments?

Posted: Mon Jun 20, 2016 8:18 am
by benelot
Is there a reason why you do not use the premake or Cmake processes to compile? The premake being more up-to-date could do everything for you.

Re: Gcc arguments?

Posted: Mon Jun 20, 2016 7:35 pm
by X14U2NVX
I don't know why or how this issue came about, but I deleted the most recent version of bullet that I had downloaded (bullet3-master from github) and downloaded an older version instead. It worked like a charm. I guess something in my stack was making the compiled bullet3 libraries unusable...

I wasn't using Cmake because I was trying to create the absolute bare minimum standalone project according to tutorials: http://www.bulletphysics.org/mediawiki- ... ello_World and http://www.bulletphysics.org/mediawiki- ... Simple_Box but they were not compiling. I was reverting to an even simpler example (a source code example with no internal dependencies and it wasn't compiling/linking either). So I believed, and in a sense it was, a problem with my libraries and the code I was writing itself.

Re: Gcc arguments?

Posted: Tue Jun 21, 2016 4:17 pm
by benelot
Nice! So now it is working nicely? Cool that you are using the Simple Box tutorial, because it is a new tutorial we just recently made and there are more to come!I hope you liked it. Did you feel anything missing in it?