1,105,447 Community Members

Programming c in microsoft visual studio 2010 professional, Help with linking files

Member Avatar
baldwindc
Light Poster
35 posts since Nov 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

I am taking a data structures class and we are using the standard gcc compiler on a unix system. This is fine and I have no troubles using it, but I would like to begin using an IDE for my labs. I am trying Visual Studio 2010 Professional with my .c files and am able to get very simple programs to compile and execute, however the current lab I am doing requires me to first compile the .c file into a .o file before linking it to another .o file using gcc filename1.o filename2.o -o filename. From what I understand the object files on unix and windows platforms differ, but I still do not understand exactly what a .object file is. This i can look up. What I would like to know, is there a good IDE for the c language ( linux or windows is fine) and if Visual Studio is the recontamination how would I go about compiling my file into an object file, linking it, and then running it.

Any help is appreciated. Thanks in advance.

Member Avatar
Banfa
Practically a Posting Shark
801 posts since Mar 2010
Reputation Points: 582 [?]
Q&As Helped to Solve: 134 [?]
Skill Endorsements: 12 [?]
Featured
 
0
 

You can use Visual Studio its OK. But if you are using Linux and Windows you may want to try something like Code:Blocks or Eclipse which are multi-platform and run on both Linux and Windows, that way you only have to learn the ins and outs of 1 IDE that you can use everywhere.

Both those IDEs use gcc on Linux and MinGW(a gcc port) on Windows.

Member Avatar
baldwindc
Light Poster
35 posts since Nov 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 3 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks. That helped. Using code blocks. Was still having some issues getting it to produce the .o file and then link to another but i just used a custom makefile. Will mark as solved.

Question Answered as of 3 Years Ago by Banfa
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: