Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » UPP_MAIN__ is not exported to env in linux
Re: UPP_MAIN__ is not exported to env in linux [message #6331 is a reply to message #6327] Tue, 07 November 2006 00:16 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 702
Registered: December 2005
Location: Budapest, Hungary
Contributor
I fixed this for normal run and the debug session.

In Ide/Host.cpp, the end of void LocalHost::Launch(const char *_cmdline, bool console) method is:
	pid_t pid = fork();

	if(pid == 0)
	{
		int from = 0;
		Vector<const char *> env;
		const char *envptr = environment;
		while(envptr[from])
		{
			env.Add(&envptr[from]);
			from += strlen(&envptr[from]) + 1;
		}
		env.Add(NULL);
		const char **envp = env.Begin();
		execve(args[0], args, (char *const *)envp);
	}
	sPid().Add(pid);

#endif


An other pace, where I had to change for debug run is Web/sproc.cpp in void LocalSlaveProcess::Open(const char *command, const char *envptr) method:
#if DO_SVRLOG
	SVRLOG(args.GetCount() << "arguments:");
	for(int a = 0; a < args.GetCount(); a++)
		SVRLOG("[" << a << "]: <" << (args[a] ? args[a] : "NULL") << ">");
#endif//DO_SVRLOG

	SVRLOG("running execve, app = " << app << ", #args = " << args.GetCount());

	int from = 0;
	Vector<const char *> env;
	while(envptr[from])
	{
		env.Add(&envptr[from]);
		from += strlen(&envptr[from]) + 1;
	}
	env.Add(NULL);
	const char **envp = env.Begin();
	
	execve(app_full, args.Begin(), (char *const *)envp);
	SVRLOG("execve failed, errno = " << errno);
	printf("Error running '%s', error code %d\n", command, errno);
	exit(-errno);
#endif

I'm not very good in pointer aritmethic, so tests are needed. Currently, this fix is working fine on my Ubuntu Linux 606 system.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to compile thrid-party packages?
Next Topic: Slow Linking under Linux
Goto Forum:
  


Current Time: Tue Jul 15 17:24:02 CEST 2025

Total time taken to generate the page: 0.03242 seconds