|
Hi
I want to compile source code of a program written under linux.
I want to compile the source under windows xp.
Is there any tool to do the port.? please suggest me any...
regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi
How about cygwin?
anyone familiar with it?
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Zainu wrote: How about cygwin?
it's been a while since i've used it, but i think that if you want to run the program on XP, cygwin is the way to go. but, if you want to compile the program on XP to run on a Linux machine, the process is very complicated - IIRC, you have to rebuild all the tools (gc, the linker, the libraries, maybe even the kernel) first.
a few years ago, i needed to build an EXE that could run on a specific Linux distribution, and i went down they cygwin path for a few days, trying to get it to work; but it quickly became far too much hassle. i ended up spending a couple hundred $ to buy a cheap PC, installed the Linux distribution on it and built the EXE there. then i moved the EXE to the target computer, and got on with my life.
|
|
|
|
|
What kind of program is it ? Was it planned to be cross-platform ? If no, then as far as I know you can't do that. But it all depends of the program itself. If it is a simple console application that doesn't use any linux API, then it is cross-platfrom. If it is a program that display a GUI for instance using the Linux API, then it won't work.
|
|
|
|
|
Zainu wrote: Is there any tool to do the port.?
Yes[^]
led mike
|
|
|
|
|
AHHH I just HAD to click on the link. When it popped up I spewed root beer on my
monitor.
Thanks man.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
cygwin is great.
I was using to compile a 3d game. For the past two days i was sitting on this.
The only problem is initial setting up of the libraries and headers and then too download the cygwin packages you require.
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
hi iam doing a project with my friends, and its about find the posbile path of the linklist
and one of the function is wrong
i got the struct
struct node
{
int v1;
int v2;
int w;
}first;
struct node[] *findposibility(int index) // is this wrong the way i call the node
{
struct node *curr;
struct node *a[5];
curr = first;
int i = 0;
while(curr->next != NULL)
{
if(index = curr->v1)
{
a[i] = cur;
i++;
}
curr == curr->next;
}
return a;
}
thanks
|
|
|
|
|
Where's the "next" member of node?
There's several problems involving uninitialized variables and your function definition.
What are you trying to do?
Mark
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
hi sory i forgot to put the next
and one of the function is wrong
i got the struct
struct node
{
int v1;
int v2;
int w;
struct node *next
}first;
struct node[] *findposibility(int index) // is this wrong the way i call the node
{
struct node *curr;
struct node *a[5];
curr = first;
int i = 0;
while(curr->next != NULL)
{
if(index = curr->v1)
{
a[i] = cur;
i++;
}
curr == curr->next;
}
return a;
}
thanks
|
|
|
|
|
One way to get your code to compile is like this (changes in red):
struct node
{
int v1;
int v2;
int w;
struct node *next;
} first;
struct <code>node **</code>findposibility(int index)
{
struct node *curr = <code>&</code>first;
<code>static</code> struct node *a[5];
int i = 0;
while(curr->next != NULL)
{
if(index <code>==</code> curr->v1)
{
a[i] = curr;
i++;
}
curr <code>=</code> curr->next;
}
return a;
}
There's still a couple problems:
1) first is not initialized
2) Is 5 the max number of hits you will ever encounter?
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
THANKS ITS HELP ME alot actually first i declare in another function but i want to ask u why i have to put static instead of struct node *a[5]?
|
|
|
|
|
arifliminto86 wrote: i want to ask u why i have to put static instead of struct node *a[5]?
That's the only way to "return a;" safely. If "a" is not static then it is a temporary variable
that only exists (its scope) in this case for the life of the function. If you return it, and
it doesn't exist after returning, then that's quite a problem.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Mark Salsbery wrote: There's still a couple problems:
Sure and the Titanic sort of sank.
led mike
|
|
|
|
|
|
led mike wrote:
Sure and the Titanic sort of sank.
he he he!
|
|
|
|
|
Hi, I'm having a hard time with MultiColumn listbox's. I'm trying to Create a Multi Column ListBox that basically displays continually changing data. So I'd like title buttons for each column, and then in each column the data that appears needs to be updated continuously. How do i do this?
By the way. I'm using VC++ 6.0. I know how to make the ListBox, I just don't know how to create titles for each column. Or atleast how to add/edit data to each column would be helpful.
-- modified at 10:00 Friday 30th March, 2007
------------------------
Impossible is Nothing
|
|
|
|
|
Use a ListView control [^] (or, if you plan to use MFC, the ListCtrl class [^])
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thats what I'm looking for! Thanks a lot man.
------------------------
Impossible is Nothing
|
|
|
|
|
You're welcome, man.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hello,
I am developing a windows service in VC++.Net2005 on windows XP.
I want the end product should be portable to all the windows OS(atleast to win98,Me,2K,XP and Vista).
In my windows service (which runs on Local System means as System's service), there is a requirement to access the current login user name. To get that i am using the GetUserName() of win32 API, but with this, i am only getting the Login-name as "SYSTEM" ( probably because of the reason that, my windows service is running in System's area(local system)).
Is it feasible to get the current login name instead of getting the user in which the my windows service is running. If possible.. any clues..
Thank you
Anee
|
|
|
|
|
Now, im not sure, but maybe this might work..
getenv("USERNAME");
(It gets the USERNAME value, which also can be seen by doing set in cmd (where loads of other values are))
/Johannes
|
|
|
|
|
Be very careful doing this. There are a number of issues that you must address. What if the user hasn't signed on yet? What if you have two users logged on at the same time and they are going back and forth using Fast User Switching? What if the user logs off?
Judy
|
|
|
|
|
Hello friends...
Thanks for your comments. I am taking help from the following article provided with Codeproject:
http://www.codeproject.com/vb/net/Windows_Service.asp
What i understand from this is, we can have access to the WMI. This WMI shows all the information regarding the various processes running in machine. As i want to get the username in which i am currently logged-in, So, i am using the Win32_Process (which gives the name of process explorer... and the substring of, name of process explorer contains the currently logged-in username(eg.. user_nameprocess.exe) . Using string operations... i am trying to extract that particular username part of the process explorer name.
Now,Taking help of this, i have added System.Management reference to my project (VC++.NET/windows XP) and then i got two files namely ROOT.CIMV2.Win32_Process.h/cpp with my project name. And in the ROOT.CIMV2.Win32_Process.cpp contains following lines of code:
#include Stdafx.h
#include ROOT.CIMV2.Win32_Process.h
After this i added System refrence through the project properties.
But while building this project, i am getting some errors in these new files ROOT.CIMV2.Win32_Process.h/cpp.
and command line options are:
C/C++ Command line options:
/Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\myservice.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W0 /nologo /c /Zi /clr:pure /TP /errorReport:prompt /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Management.dll" /FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll"
Linker Command Line Options:
/OUT:"D:\Apr\2\myservice\Debug\myservice.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\myservice.exe.intermediate.manifest" /DEBUG /ASSEMBLYDEBUG /PDB:"d:\Apr\2\myservice\debug\myservice.pdb" /SUBSYSTEM:CONSOLE /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT setupapi.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
And stdafx.h file looks like this:
#pragma once
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// TODO: reference additional headers your program requires here
#define _AFXDLL
/*I included this, bcoz if i don't, then i m getting an build error: D:\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]
*/
#pragma warning (disable:4430)
#include "ROOT.CIMV2.Win32_Process.h"
#include "afxdb.h"
#include <initguid.h>
#include <setupapi.h>
#include <dbt.h>
#include "cfgmgr32.h"
And if i put the #include _AFXDLL, then i am getting the following errors:
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
D:\Microsoft Visual Studio 8\VC\atlmfc\include\afxv_w32.h(242) : error C3641: 'DrawState' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\afxv_w32.h(260) : error C3641: 'DrawStatusText' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\PlatformSDK\include\winbase.h(1849) : error C3641: 'FreeResource' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\afxv_w32.h(274) : error C3641: 'UnlockResource' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(90) : error C3641: 'InterlockedExchangePointer' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(104) : error C3641: 'ATL::_AtlGetThreadACPFake' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(130) : error C3641: 'ATL::_AtlGetThreadACPReal' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(137) : error C3641: 'ATL::_AtlGetThreadACPThunk' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(147) : error C2440: '=' : cannot convert from 'UINT (__clrcall *)(void) throw()' to 'ATL::ATLGETTHREADACP'
Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(151) : error C2440: '=' : cannot convert from 'UINT (__clrcall *)(void) throw()' to 'ATL::ATLGETTHREADACP'
Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(158) : error C3641: 'ATL::_AtlGetConversionACP' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(594) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(613) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(631) : error C3641: 'AtlA2WHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(636) : error C3641: 'AtlW2AHelper' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atlconv.h(589) : error C3641: 'AtlDevModeW2A' : invalid calling convention '__stdcall ' for function compiled with /clr:pure or /clr:safe
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atltrace.h(64) : error C2440: 'default argument' : cannot convert from 'int (__cdecl *)(int,const char *,int,const char *,const char *,...)' to 'ATL::CTrace::fnCrtDbgReport_t'
Address of a function yields __clrcall calling convention in /clr:pure and /clr:safe; consider using __clrcall in target type
D:\Microsoft Visual Studio 8\VC\atlmfc\include\atltrace.h(143) : fatal error C1903: unable to recover from previous error(s); stopping compilation
NOTE: I have not used windows service Template (provided with VC++.Net 2005). I have just used the windows.h advapi32.dll.
Any kind of help or clue is greatly thankful...
Thanks
-- modified at 6:49 Monday 2nd April, 2007
Anee
|
|
|
|