Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6684246
  • 博文数量: 1159
  • 博客积分: 12444
  • 博客等级: 上将
  • 技术积分: 12570
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-13 21:34
文章分类

全部博文(1159)

文章存档

2016年(126)

2015年(350)

2014年(56)

2013年(91)

2012年(182)

2011年(193)

2010年(138)

2009年(23)

分类: C/C++

2015-09-24 16:08:06

 

 


 

★★★★★上面的问题——解决了

--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/WorkflowListener.cpp

注释掉两行:(取消注释,会出现上面问题,有待解决)

 

    else if ( evt->getName() == "EndWorkflowEvent" )

{

        CM_TRACE_CODEPATH( "Event Received:[EndWorkflowEvent]")

        //processID = ((EndWorkflowEvent*)evt)->getProcessID();

        //sEvent = "COMPLETED";

}

 



+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

★★★★★ ( getenv  返回值为 NULL )


--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/engine/Workflow.cpp

CM_TRACE_CODEPATH( "Deleting TaskAction Object.")

delete taskAction; 设置断点

 

 

--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/WorkflowListener.cpp

        processID = ((EndWorkflowEvent*)evt)->getProcessID(); 设置断点

调用

--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/events/BaseWorkflowEvent.cpp

    return _WF->getProcess()->getProcessId();  设置断点

调用

--------> /opt/cBPM/criteria-lin/src/Criteria/Criteria.WorkflowEngine/engine/Workflow.cpp

WorkflowProcesses::WorkflowProcess* Workflow::getProcess() 设置断点

{

    return process;

}

--------> /opt/cBPM/criteria-lin/include/WorkflowEngine/Workflow.h

WorkflowProcesses::WorkflowProcess*    process;

 

★★★★★上面的问题——终于解决了( getenv  返回值为 NULL )Program works from commandline, but not from codeblocks

style="font-family:Calibri;font-size:12.0000pt;">

 

 

resander
I inserted the following three calls at the start of connectSrv routine (see a previous post on this thread):

char * odbcini = getenv ( "ODBCINI" ) ;
char * oraclehome = getenv ( "ORACLE_HOME" ) ;
char * ldlibrarypath = getenv ( "LD_LIBRARY_PATH" ) ;
 
char * getenv (const char *name)
returns a string that is the value of the environment variable name. 
If the environment variable name is not defined, the value is a null pointer. 


Starting codeblocks from Application menu

The odbcini and oraclehome variables are NULL after the getenv calls. This means they are not available for my program, which fails finding the ODBC driver and other library dependencies. The ldlibrarypath variable is .:, which is wrong.

Starting codeblocks from my HOME /home/ken and commandline as /usr/bin/codeblocks
Works.

Wikipedia says this about environment:

'In all Unix and Unix-like systems, each process has its own private set of environment variables. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child. At API level, these changes must be done between fork and exec.'

When I start codeblocks from the commandline my environment is inherited by codeblocks. Then if codeblocks starts my-prog by exec/fork the environment would be passed on again, which is what my-prog needs.

There is a predefined program variable extern char ** environ; which is an array of property strings in the environment. When starting codeblocks from the Application menu I put these to the screen with printf and could see the environment was different from mine. 

- there are fewer properties, especially the important ODBCINI, 
  ORACLE_HOME are missing

- LD_LIBRARY_PATH is .: which is different from my ldlibpath

- PWD is set to /home/ken/Projects/lsken2      my PWD is /home/ken

- HOME is /home/ken for both (can be used to chdir $HOME before starting
  codeblocks from menu)

 

 

-------------------------

 

-------------------------

 

++++++++++++++++++++++++++++++++++++++++++++++++++



resander:
I inserted the following three calls at the start of connectSrv routine (see a previous post on this thread):

char * odbcini = getenv ( "ODBCINI" ) ;
char * oraclehome = getenv ( "ORACLE_HOME" ) ;
char * ldlibrarypath = getenv ( "LD_LIBRARY_PATH" ) ;
 
char * getenv (const char *name)
returns a string that is the value of the environment variable name.
If the environment variable name is not defined, the value is a null pointer.


Starting codeblocks from Application menu

The odbcini and oraclehome variables are NULL after the getenv calls. This means they are not available for my program, which fails finding the ODBC driver and other library dependencies. The ldlibrarypath variable is .:, which is wrong.


Starting codeblocks from my HOME /home/ken and commandline as /usr/bin/codeblocks

Works.


Wikipedia says this about environment:

'In all Unix and Unix-like systems, each process has its own private set of environment variables. By default, when a process is created it inherits a duplicate environment of its parent process, except for explicit changes made by the parent when it creates the child. At API level, these changes must be done between fork and exec.'

When I start codeblocks from the commandline my environment is inherited by codeblocks. Then if codeblocks starts my-prog by exec/fork the environment would be passed on again, which is what my-prog needs.

There is a predefined program variable extern char ** environ; which is an array of property strings in the environment. When starting codeblocks from the Application menu I put these to the screen with printf and could see the environment was different from mine.

- there are fewer properties, especially the important ODBCINI,
  ORACLE_HOME are missing

- LD_LIBRARY_PATH is .: which is different from my ldlibpath

- PWD is set to /home/ken/Projects/lsken2      my PWD is /home/ken

- HOME is /home/ken for both (can be used to chdir $HOME before starting
  codeblocks from menu)
阅读(1406) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~