Jump to content

How to compile xx.C with Qt Creator in Linux(centos7)?


Recommended Posts

Hi all,i am tying  compile the source without use the hcustom command.

 

it doesn't work.  it troubles me for a long time

#include <GU/GU_Detail.h>
#include <stddef.h>

namespace HDK_Sample {

static float densityFunction(const UT_Vector3 &P, void *data)
{
    // Return the signed distance to the unit sphere
    return 1 - P.length();
}

}

int main(int argc, char *argv[])
{
    GU_Detail		gdp;
    UT_BoundingBox	bounds;

    // Evaluate the iso-surface inside this bounding box
    bounds.setBounds(-1, -1, -1, 1, 1, 1);

    // Create an iso-surface
    gdp.polyIsoSurface(HDK_Sample::densityFunction, NULL, bounds, 20, 20, 20);

    // Save to sphere.bgeo
    gdp.save("sphere.bgeo", NULL);

    return 0;
}

/usr/include/SYS/SYS_AtomicImpl.h:443: error: #error "Unsupported platform"
 #error "Unsupported platform"
  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^

/usr/include/SYS/SYS_Math.h:1168: error: cast from 'const void*' to 'uint {aka unsigned int}' loses precision [-fpermissive]
     return (uint)ptr;
                  ^
....
Link to comment
Share on other sites

hcustom sets macro definitions for the platform and since they are missing you get:

/usr/include/SYS/SYS_AtomicImpl.h:443: error: #error "Unsupported platform"

Setup Qt to run hcustom or use the makefiles provided by SESI.

 

http://www.sidefx.com/docs/hdk13.0/_h_d_k__intro__tools.html

http://www.sidefx.com/docs/hdk13.0/_h_d_k__intro__compiling.html

Link to comment
Share on other sites

I've never used qt creator but it shouldn't be too hard to use other build systems. hcustom has options to output the options that it uses by using the --cflags and --ldflags command line options. Then you can just copy/paste those into the appropriate place of your project settings.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...