LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-04-2003, 12:21 PM   #1
jdmc020
LQ Newbie
 
Registered: Nov 2003
Location: Washington, DC
Distribution: RH9
Posts: 1

Rep: Reputation: 0
Question Compile Visual C++ project using gcc on Linux


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.

-Jon
 
Old 11-04-2003, 12:35 PM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
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.

Alex
 
Old 11-04-2003, 12:36 PM   #3
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 33
FWIW --

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:

man system

man execve

Threading is done via the pthread library:

man pthread_create
 
Old 11-04-2003, 12:39 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Being a lazy has its own disadvantages.

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.
 
Old 11-04-2003, 12:43 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc equivalent for Visual C++ function: PeekNamedPipe () m3rc_2004 Programming 1 07-29-2005 05:58 AM
Can I compile / build GnomeBasic project. Burgos Programming 1 04-20-2005 08:19 AM
Creating Pop-ups in Visual C++ (MFC Project) zWaR Programming 1 08-18-2004 02:22 PM
Thanks for helping me to compile my project... Musikolo Linux - Software 11 07-29-2003 11:07 AM
idea for a project: compile manager schatoor General 6 04-30-2003 12:21 AM


All times are GMT -5. The time now is 08:42 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration