If you provide the actual testcase that would help us assist you.

Possible problems include:

* Using extern "C" in one file but not the other, so the name-mangled one
is not found
* Not having a main() function, or not having your function reachable by
it, and not keeping it alive otherwise, so LLVM dead code elimination ends
up removing it.

There is no tutorial for this stuff, but see the test suite for many
examples of it. Look for a test in test_other.py for example that runs emcc
more than once and links them together.

- Alon



On Thu, Mar 20, 2014 at 4:55 PM, Jian Cheng <[email protected]>wrote:

> They have the same error.
>
> [jcheng@jcW530 hello]$ em++  hello_lib_test.cxx -o
> hello_lib_test.bc
>
> [jcheng@jcW530 hello]$ em++  hello_lib.cxx -o hello_lib.bc
> [jcheng@jcW530 hello]$ em++ hello_lib.bc hello_lib_test.bc -o
> hello_lib_test.html
>
> warning: unresolved symbol: _ZN6helloCC1Ev
> warning: unresolved symbol: _ZN6helloCD1Ev
>
>
> On Thursday, March 20, 2014 7:16:24 PM UTC-4, Trevor Linton wrote:
>>
>> What about using em++ rather than emcc?
>>
>> On Thursday, March 20, 2014 3:23:47 PM UTC-6, Jian Cheng wrote:
>>>
>>> Hi,
>>>
>>> I am new in emscripten. I would like to link emscripten with some
>>> libraries.
>>> However my codes have a lot of linking errors.
>>> After reading
>>> https://github.com/kripken/emscripten/wiki/Building-Projects
>>> I still cannot solve my problems.
>>>
>>> To make the question simple, I made a small hello_world example, where
>>> there is one class in hello_lib.h and hello_lib.cxx, and one main function
>>> in hello_lib_test.cxx.
>>>
>>> [jcheng@jcW530 hello]$ emcc  hello_lib_test.cxx -o
>>> hello_lib_test.bc
>>>
>>>
>>> [jcheng@jcW530 hello]$ emcc  hello_lib.cxx -o hello_lib.bc
>>> [jcheng@jcW530 hello]$ emcc hello_lib.bc hello_lib_test.bc -o
>>> hello_lib_test.html
>>> warning: unresolved symbol: _ZN6helloCC1Ev
>>> warning: unresolved symbol: _ZN6helloCD1Ev
>>>
>>> I cannot link hello_lib_test with hello_lib, and the output in
>>> hello_lib_test.html is not correct (it showed -1)
>>> Is there any tutorial for this? Thanks.
>>>
>>> best,
>>> Jian Cheng
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to