# Problems loading OBJ files into Cinder

**URL:** <https://discourse.libcinder.org/t/problems-loading-obj-files-into-cinder/622>\
**Category:** Uncategorized\
**Created:** [March 27, 2017, 3:54pm UTC](https://discourse.libcinder.org/t/problems-loading-obj-files-into-cinder/622 "2017-03-27T15:54:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![smokeredsky](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@smokeredsky](https://discourse.libcinder.org/u/smokeredsky)\
**Post date:** [March 27, 2017, 3:54pm UTC](https://discourse.libcinder.org/t/problems-loading-obj-files-into-cinder/622/1 "2017-03-27T15:54:55Z")

</div>

Hi

I’m quite new to Cinder but I need to load an obj file and can’t figure out what is going wrong.

When I copy the Satellite.obj file into the cinder/samples/data/models/ folder where the sample 8lbs.obj is and update the Resources.h file with this file name instead, I get the following error when compiling:

|error | void cinder::app::AppBase::executeLaunch()[137] Uncaught exception, type: cinder::app::ResourceLoadExc, what : Failed to load resource: Satellite.obj  
libc++abi.dylib: terminating with uncaught exception of type cinder::app::ResourceLoadExc: Failed to load resource: Satellite.obj

If instead I try and load it via the line

ObjLoader loader(loadFile("…/…/…/data/models/Satellite.obj"));

in the loadObj function, I get a EXC\_BAD\_ACCESS error at the line :

while( ! mStream-\>isEof() )

Both errors are the same even if I incorrectly spell the filename as a test so I think its a problem with finding the resource rather than the obj file itself.

What is the best way to import an obj file into Cinder?

The file that I’m trying to load is here:

> **[Dropbox - Link not found](https://www.dropbox.com/s/6c6mn63cnwcrtte/Satellite.obj?dl=0)**
>
> Dropbox is a free service that lets you bring your photos, docs, and videos anywhere and share them easily. Never email yourself a file again!

Thanks

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [March 27, 2017, 5:06pm UTC](https://discourse.libcinder.org/t/problems-loading-obj-files-into-cinder/622/2 "2017-03-27T17:06:17Z")

</div>

Hi,

Did you add the model to your project? Check the ‘Adding a Resource’ section here:  
[https://www.libcinder.org/docs/guides/resources/index.html](https://www.libcinder.org/docs/guides/resources/index.html)

You can also try using assets, which is a bit easier.

-Gabor

---

<div class="post-metadata">

**Author:** ![smokeredsky](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@smokeredsky](https://discourse.libcinder.org/u/smokeredsky)\
**Post date:** [March 27, 2017, 6:00pm UTC](https://discourse.libcinder.org/t/problems-loading-obj-files-into-cinder/622/3 "2017-03-27T18:00:32Z")

</div>

Great, thanks. That worked.

Adding the .obj file via the ‘Adding a Resource’ method worked when referencing the file in Resources.h and adding it into the assets folder worked using this line

ObjLoader loader(loadAsset(“Satellite.obj”));
