LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 04-27-2010, 08:20 AM   #1
urfi
LQ Newbie
 
Registered: Feb 2010
Posts: 7

Rep: Reputation: 0
How to edit linux kernel source code in MS Visual Studio?


Hi, I want to edit linux kernel source code in MS Visual Studio. I saw the code and these are c files but there is no project file that i open it and whole project opens up. I can open each individual file but not the whole project.
Thanks in Advance.
 
Old 04-27-2010, 09:00 AM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by urfi View Post
I saw the code and these are c files but there is no project file that i open it and whole project opens up.
There is no project file that comes with the Linux kernel sources. If you want a project file, you will have to create it yourself.

Try using [File]->[New]->[Project From Existing Code...]. VS2005 supports this.
 
Old 04-27-2010, 09:20 AM   #3
urfi
LQ Newbie
 
Registered: Feb 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Ok but will that allow me to see dependency of files and see which function is defined where and being called where?
 
Old 04-27-2010, 09:39 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by urfi View Post
Ok but will that allow me to see dependency of files and see which function is defined where and being called where?
Don't know, really. This is Linuxquestions...most of us don't have alot of experience with Microsoft products. The best way to find out is to actually open the file(s), and see what happens, or contact Microsoft/ask on a Microsoft forum.
 
Old 04-27-2010, 01:41 PM   #5
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by urfi View Post
...will that allow me to see dependency of files and see which function is defined where and being called where?
If you use a recent version of Visual Studio (I tried it in VS2005) you will be able to
  • Go To Definition
  • Go To Declaration
  • Find All References
  • Go To Header File
If you are trying this with Visual Studio 6.0, it won't work because that version of Visual Studio requires you to build the project before you can get a "browser information database".
 
Old 04-27-2010, 01:44 PM   #6
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by TB0ne View Post
Don't know, really.
I will probably get the big smack down for saying this, but if you don't know, don't post a reply.

Yes, we get the occasional Windows person in here looking for help. And we actually have people who know both Windows and Linux who can answer their questions.
 
Old 04-27-2010, 01:46 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 04-27-2010, 03:03 PM   #8
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by urfi View Post
Ok but will that allow me to see dependency of files and see which function is defined where and being called where?
There are system-independent tools showing various dependencies. Start from CSCOPE: http://cscope.sourceforge.net/ ; there are other tools which I do not remember off the top of my head.
 
Old 04-27-2010, 06:16 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by David1357 View Post
I will probably get the big smack down for saying this, but if you don't know, don't post a reply.

Yes, we get the occasional Windows person in here looking for help. And we actually have people who know both Windows and Linux who can answer their questions.
Well, what did you contribute to answering the question?

Yes, there are people here that do know Windows. But that's not the focus of this forum, so directing someone with a Windows question to the right place isn't a bad thing. Yes, I'm sure there are folks who COULD answer it...but then what? More MS questions?? There are folks here that know Mac,too...going to answer those as well?

The focus of this site is Linux....staying on focus is important.

Last edited by TB0ne; 04-27-2010 at 06:20 PM.
 
Old 04-27-2010, 08:33 PM   #10
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by TB0ne View Post
Well, what did you contribute to answering the question?
I answered the question. Completely.

Quote:
Originally Posted by TB0ne View Post
Yes, there are people here that do know Windows. But that's not the focus of this forum, so directing someone with a Windows question to the right place isn't a bad thing.
Actually, the question was about how to navigate the Linux source using Visual Studio. To me, that is clearly a Linux question and this is the correct place to find the answer. Only a person like me who works on Linux kernel source one week and Windows driver source the next would know how to setup Visual Studio to properly handle Linux source code.
 
Old 04-27-2010, 11:38 PM   #11
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
Sorry, You have to use GCC to compile it.
Also you should use a *real* IDE like code:blocks.
 
Old 04-28-2010, 09:52 AM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by David1357 View Post
I answered the question. Completely.

Actually, the question was about how to navigate the Linux source using Visual Studio. To me, that is clearly a Linux question and this is the correct place to find the answer. Only a person like me who works on Linux kernel source one week and Windows driver source the next would know how to setup Visual Studio to properly handle Linux source code.
Sorry, I think you're wrong. Using Visual Studio on Windows to open Linux source code, doesn't make it a Linux question. By that definition, if I create a Word document on a Mac, and email it to someone, and they have problems viewing it on their Blackberry, that would make it a Mac question, right?

It's obviously not...what created the file, and what the file is for, makes no difference. The OP is having problems with a Windows program, on a Windows platform.
 
Old 04-28-2010, 10:17 AM   #13
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by TB0ne View Post
Sorry, I think you're wrong. Using Visual Studio on Windows to open Linux source code, doesn't make it a Linux question.
It does if you understand the second question:
Quote:
Originally Posted by urfi View Post
Ok but will that allow me to see dependency of files and see which function is defined where and being called where?
Modern versions of Visual Studio have the ability to navigate code similar to the way cscope works.

Quote:
Originally Posted by TB0ne View Post
By that definition, if I create a Word document on a Mac, and email it to someone, and they have problems viewing it on their Blackberry, that would make it a Mac question, right?
No. The two situations are not even remotely similar.

The true equivalent would be if someone was asking how to edit the source for a Windows driver using vim on a Linux box.

If someone posted such a question to a Windows forum, I would expect someone similar to you to admit they did not know the answer and then explain why the post is in the wrong forum. Hopefully, there would be someone as helpful as me to actually answer the question.
 
Old 04-28-2010, 01:00 PM   #14
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by David1357 View Post
It does if you understand the second question:

Modern versions of Visual Studio have the ability to navigate code similar to the way cscope works.


No. The two situations are not even remotely similar.

The true equivalent would be if someone was asking how to edit the source for a Windows driver using vim on a Linux box.

If someone posted such a question to a Windows forum, I would expect someone similar to you to admit they did not know the answer and then explain why the post is in the wrong forum. Hopefully, there would be someone as helpful as me to actually answer the question.
Oh yes...one can only hope. Really.
 
  


Reply

Tags
code, kernel, linux, ms, source, studio, visual



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid Question: Microsoft Visual Studio 6.0 (A.K.A. Visual Basic 6) Will it run? S0RD3N Linux - Software 8 05-07-2008 08:42 PM
MS Visual Studio .NET in Linux? cootetom Linux - Software 1 03-03-2007 03:04 PM
Problems when porting code from C++ under visual studio 6 to linux. Stor_G Programming 3 08-26-2004 07:19 AM
Linux clone for Visual Studio? JIV Programming 4 04-17-2003 09:06 PM
Is Visual Studio in Linux??? rob99 Linux - Software 6 01-22-2003 04:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:33 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration