Build an engine or Use One

Fillbert
Unregistered
 
Post: #31
I DLed the LW 6.0-6.5 SDK and in there where some files Called lwo2.h and .cpp and they had fucntions in them to load into an lwObject and that all I have so far. I'm planning on using the idea/source from another loader which used the same lwo2.h and then converted the data into a easier to use object.
-Fillbert
Quote this message in a reply
Fillbert
Unregistered
 
Post: #32
OK I think I might of compiled and linked it. All I did was make a new target with all the LW files in it. I choose library for the target. I then clciked the box for the newly created library thing on my other target. I also added it in the file list for libaryies inthe target. but I still gt the link error. What do I do?
Quote this message in a reply
henryj
Unregistered
 
Post: #33
Quote:Originally posted by Fillbert
OK I think I might of compiled and linked it. All I did was make a new target with all the LW files in it. I choose library for the target. I then clciked the box for the newly created library thing on my other target. I also added it in the file list for libaryies inthe target. but I still gt the link error. What do I do?

1. Check that it built ok. Look in the Products list in your lwo project and make sure the library isn't red. Check this in the libraries list in your main project also.

2. What did you call it? The lightwave site says libserve.a the linker might not like it if it doesn't have lib at the start and .a at the end.

3. Did you set up the compiler flags for the os and architecture as it says in the sdk?

4. In the terminal do...

nm /path/to/the/library

and see if the symbol that the linker is complaining about is listed.


While you're at it post the error here.
Quote this message in a reply
Fillbert
Unregistered
 
Post: #34
Quote:Originally posted by Fillbert
I should probably post this on other thread but I got the LW SDK and I got the files from that that load a LightWaev object. I also got the code for the program in teh link above. Thanks SkyHawk. But the when I try to load I get one error which in undefined sysmbols? I've got no clue on this one

Code:
StandaloneExecutable /Users/nathan/ModelLoader/build/ModelLoader
ld: warning prebinding disabled because of undefined symbols
ld: Undefined symbols:
lwGetObject(char*, unsigned*, int*)

    /usr/bin/g++3  -o "/Users/nathan/ModelLoader/build/ModelLoader"  "-L/Users/nathan/
ModelLoader/build"  "-F/Users/nathan/ModelLoader/build"  -filelist "/Users/nathan/ModelLoader/
build/ModelLoader.build/ModelLoader.build/Objects-normal/LinkFileList"  "-arch" "ppc" "-prebind"
"-lstdc++"

...failed StandaloneExecutable.LinkUsingFileList /Users/nathan/ModelLoader/build/ModelLoader ...


And the code from my program is:
Code:
#include <iostream>
#include <lwo2.h>
int main (int argc, const char * argv[])
{
    // insert code here...
    unsigned int one;
    int two;
    char *name = "Pencil.lwo";
    lwObject *temp;
    temp = lwGetObject(name,one,two);
    if(temp != NULL)
    std::cout << "Hello, World!\n";
    return 0;
}

Thank you very much to all so far...
Quote this message in a reply
Fillbert
Unregistered
 
Post: #35
Which SDK are you looking at? I DL the 6.5 one. I didn't see anything on compiling the library, can you point me to it.
Quote this message in a reply
henryj
Unregistered
 
Post: #36
I just went to the sdk docs on the lightwave site. I think it's for 7.5.
Quote this message in a reply
Fillbert
Unregistered
 
Post: #37
Quote:Originally posted by henryj
3. Did you set up the compiler flags for the os and architecture as it says in the sdk?


How do I do so?
Quote this message in a reply
Feanor
Unregistered
 
Post: #38
Quote:Originally posted by Fillbert
How do I do so?

I strongly recommend that you read the docs on Project Builder, especially the build settings, and have a look at the manual for the gcc compiler tools (gcc, cpp, ld) at the GCC Homepage.

Most of the build flag settings for this SDK are probably going to have to be entered as command-line flags to the compiler and the linker -- these go in the "additional compiler flags" and "additional linker flags" sections of the target settings. The particular flags are discussed in the compiler manual (and a few important ones are mentioned in the Apple docs available from the help menu). Apple's docs on Project Builder can be very enlightening. I recommend that you browse through all of them -- they really aren't that well organized, so you just have to know your way around them. They are sometimes self-contradictory. There is also a Project Builder mailing list (and archives) when you have specific questions.
Quote this message in a reply
henryj
Unregistered
 
Post: #39
In Target settings:GCC Compiler Settings:Other C Compiler Flags

-D_MACOS -D_PPC_
Quote this message in a reply
Fillbert
Unregistered
 
Post: #40
I've tried everything you guys have saisd and nothing has worked so far.I thank you guys so much for tryign though. I'm so frusterated with this. Here is a link to the my PB file: http://homepage.mac.com/Fillbert/ModelLoader.sit If anyone would take a look and see if they can fix it that would be so cool. thanks for everything so far.
-fillbert
Quote this message in a reply
henryj
Unregistered
 
Post: #41
Note the extern bit...

#include <iostream>

extern "C"
{
#include "lwo2.h"
}

int main (int argc, const char * argv[])
{
// insert code here...
unsigned int one;
int two;
char *name = "Pencil.lwo";
lwObject *temp;
temp = lwGetObject(name,one,two);
if(temp != NULL)
std::cout << "Hello, World!\n";
return 0;
}

The problem was that your main is a cpp file so it expects function names to be in cpp (mangled) format which your lib wasn't because it was compiled with the c compiler.
You also need to add clip.c to the project. I've had a look at the lwo source and can't figure out how it would be useful for anything. I hope you've got some docs.
Quote this message in a reply
Fillbert
Unregistered
 
Post: #42
I jsu threw the files in there for the rest of the peopel I have them all. Thank you so much. I can't believe that I over looked something like that thank you so much.
Quote this message in a reply
Member
Posts: 304
Joined: 2002.04
Post: #43
nice catch henryj

Quote:Originally posted by henryj
I've had a look at the lwo source and can't figure out how it would be useful for anything. I hope you've got some docs.


yeah - me too. If you have the docs Filbert either post them or provide a link if possible. Also:

temp = lwGetObject(name, one, two);

probably should be:

temp = lwGetObject(name, &one, &two);


hth,
Codemattic
Quote this message in a reply
Post Reply