ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a complicated project that has been developed using Microsoft Visual C++ 6. I would like to continue developing the project on a Linux OS system. Other than the fact that they exist, I am completely ignorant of Makefiles.
My question is: Is there a way to compile the code w/o writing a makefile from scratch? Is there a utility that takes (as input) a Visual C++ workspace (.dsw), project (.dsp), or exported makefile (.mak) and generate a gcc-approved Makefile? I have found TONS of info about going the other way (from *nix to Windows), but nothing really about getting my Visual C++ project to compile on a Linux system, generating Linux-executable files. Any help/pointers/clues would be appreciated.
Also note that (because I am basically a very lazy man) I haven't actually tried to compile my code on the Linux box, I have merely copied all of the source code to it.
Well, you can always just do a "gcc *.c -o executable_name", assuming all your source files are in the same directory. Although you'll want to set up a proper build system, at least this would tell you whether or not gcc will compile your code.
I don't know of any project file conversion utilities, but if you use a Linux IDE (e.g. Ajunta), you could quite easily make a new project and add your source files to it. The IDE would then build a makefile for you automatically.
Btw, makefiles don't have to be "gcc-approved" in any sense - they're processed by the 'make' utility, which is a completely separate program.
A lot of calls in VC6 are not portable - and the _int64 datatype is not portable either - it's a long long in unix C99.
Generally, any of the library calls that start with _ are not portable.
Unless you like pages of error messages, you probably want to do something about portability first. Compile second. You can get help on all of the common library calls, eg., system() by typing:
Rarely porting from MS tools/windows program to gnu tools/linux program is very straightforward. Meaning that most of the time you have to understand the internals of the program code to get the conversion done. While you are walking in the internals, constructing the nesessary toolchain to get compilation done is not that hard anymore.
Some googling guides me to some tools like dsp2make, but as said, converting the makefile is usually only very minor problem compared to the actual porting.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.