I located the problem may caused by the parameter of Py_InitializeEx(int
* initsigs*), I found that when I call Py_Initialize() it just initiates a 
call the Py_InitializeEx(1). 
The document says:
*This function works like Py_Initialize() 
<https://docs.python.org/2/c-api/init.html#c.Py_Initialize> if initsigs is 
1. If initsigs is 0, it skips initialization registration of signal 
handlers, which might be useful when Python is embedded.*
So I pass "0" instead of "1" and the error disappeared.


On Tuesday, June 23, 2015 at 2:45:11 PM UTC-7, ZengRui Wang wrote:
>
> Hi Alon,
>
> When I do llvm-nm on python.bc I located the main in the following 
> position:
>          U lseek
>          U lstat
>          d lstrip__doc__
>          d lstrip__doc__1750
>          d lstrip__doc__4350
>    *      T main---------------------------------------->Here*
>          t make_filename
>          t make_new_set
>          d makeargvobject.empty_argv
>          U malloc
>          d map_doc
>          d mapp_methods
>          d marshal_doc
>          t marshal_dump
>          t marshal_dumps
>          t marshal_load
>          t marshal_loads
>          d marshal_methods
>          t match_copy
> How could I tell which source file initiate it? Also I notice that there 
> is also a bitcode file* libpython2.7.a *, I linked this file instead of 
> python.bc and compiled it, no error occurs at compile time. But when I ran 
> the html file, it shows me the following error with exceptions:
>
> Calling stub instead of sigaction()
> Module.printErr @ simplesmartbodyd.html:1245
> _sigaction @ simplesmartbodyd.js:14718
> _Py_InitializeEx @ simplesmartbodyd.js:448715
> _Py_Initialize @ simplesmartbodyd.js:1414597
> __Z10initPythonNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE 
> @ simplesmartbodyd.js:461056
> _main @ simplesmartbodyd.js:498182
> callMain @ simplesmartbodyd.js:1417256
> doRun @ simplesmartbodyd.js:1417291(anonymous function)
>
> What this error message means?
> Thank you!
> On Tuesday, June 23, 2015 at 2:19:18 PM UTC-7, Alon Zakai wrote:
>>
>> You can use llvm-nm on object files to see where that duplicate symbols 
>> starts out in.
>>
>> - Alon
>>
>>
>> On Tue, Jun 23, 2015 at 10:09 AM, ZengRui Wang <[email protected]> 
>> wrote:
>>
>>> Hi, 
>>>
>>> I have compiled boost::python and the python libraries using the 
>>> instruction here 
>>> https://github.com/kripken/emscripten/tree/master/tests/python, and 
>>> then linking the python.bc to my project as a static library. However it 
>>> shows me the error message:
>>>
>>> link error in 
>>> 'C:\Users\zwang\SmartBody-Javascript\core\smartbody\simplesmartbody\python.bc':
>>>  
>>> Linking globals named 'main': symbol multiply defined!
>>> 1>  Traceback (most recent call last):
>>> 1>    File "C:\Program Files\Emscripten\emscripten\1.30.0\\emcc", line 
>>> 1238, in <module>
>>> 1>      shared.Building.link(linker_inputs, in_temp(target_basename + 
>>> '.bc'), force_archive_contents=len([temp for i, temp in temp_files if not 
>>> temp.endswith(STATICLIB_ENDINGS)]) == 0)
>>> 1>    File "C:\Program 
>>> Files\Emscripten\emscripten\1.30.0\tools\shared.py", line 1429, in link
>>> 1>GCCLINK : assert os.path.exists(target) and (output is None or 'Could 
>>> not open input file' not in output), 'Linking error : ' + output
>>> 1>AssertionError : Linking error : 
>>> 1>
>>> 1>Build FAILED.
>>>
>>> I understand it is result of the same function declaration in python.bc 
>>> library and I searched all the source code with the same int main 
>>> definition and deleted them:
>>> Two files in Modules/zlib folder:* example.c and minigzip.c*( I 
>>> encountered this situation before)
>>> One file in Modules/_ctypes/libffi/testsuite/libffl.call folder: 
>>> *cls_dbls_struct.c*
>>> And some *make_buildinfo.c* files in PC and PC build even though I 
>>> think they are irrelevant, I deleted them too.
>>>
>>> However, when I compile it again and link the compiled python.bc, the 
>>> error is still there.
>>> What do I miss?
>>>
>>> Thanks! 
>>>
>>> -- 
>>> 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