VS 2022 is not C friendly
-
I TOTALLY disagree. The code I am working with is just a simple basic C libary. In VS I chose static library, etc. The problem is VS is way too complicated, trying to do to many things for too many types of language applications. I have used VS off and on for years so I know what I am talking about. I came back to it because of potential conversion of a large graphics application that will be "potentially" ported to it. I am quickly changing my mind as to whether it is worth it or not. The application is mostly window's agnostic.
"A little time, a little trouble, your better day" Badfinger
Ever seen a simple IDE?
-
Ever seen a simple IDE?
-
I have been trying to create a static library (in C) that uses another published static library. No where does VS do I have link options to include that library. VS SUCKS
"A little time, a little trouble, your better day" Badfinger
Try again, you can still write a static lib in C in VS2022. You don't need to use pragmas either. While I'm not a fan of VS these days as it's too bloated, at least be fair and do the research before saying something sucks because it can't do something - when it can. We're supposed to be mature professionals. Supposed to be...
Jeremy Falcon
-
It makes a lot sense to nest libraries. I have used that approach many times. Everyone has. My Font library uses GLFW library to handle rendering. The font library is used by a higher level application to handle I/O to screen. My biggest problem with VS is that it cannot see my includes files and libraries. Grrr. #include fails not matter how I reference that the directory it is located in. D:\code\glfw3.3.8\include NOT A TYPO ANYWHERE VS BAD
"A little time, a little trouble, your better day" Badfinger
You can link to static lib from a static lib in VS in C. I've done it, but I'm not gonna tell you how. Why? Because of your attitude. Life's too short. Keep on Googling.
Jeremy Falcon
-
If you selected 'static library project' it is set to CREATE a static library. It has everything to do with _understanding_ VS. If you need one static library to depend upon another then you must understand _how_ to add the dependency to VS. Setting the project type does not make it recursively able to link to other projects of that same type. I believe you would have had to add the dependency to Borland products in a similar manner. (At least I recall having to do so in the past - just the extension differed if memory serves. Or COFF vs LIB, or something.) And, logically, it is more common for an executable to link to the libraries, not one library to link to another. I've never heard of nested libraries, but I suppose it is possible.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
David O'Neil wrote:
If you selected 'static library project' it is set to CREATE a static library
Home dude isn't here to learn. He's here to rant.
Jeremy Falcon
-
The irony is, I love doing C in VS Code. But, it's harder to get that going property with debugging, etc. than doing C in VS.
Jeremy Falcon
-
jmaida wrote:
My biggest problem with VS is that it cannot see my includes files and libraries.
The steps for each step are outlined in the article I linked to. After dragging the include files into VS you must still specify the paths in the include section of the project settings, and you have to set libraries in another place in the settings as I outline there. Pretty simple once you understand it, but learning that was not as simple as it could have been - I agree with that. It would be nice if dragging a file into the explorer automatically added the appropriate path to the settings, but would require looking at relative paths as well as absolute, since both are acceptable in the project settings page.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
Typo in the post it's #include GLFW/glfw3.h (with <> brackets. If I explicit put them this post incorrect displays them) which VS flags with red underline of #include which is the signal it cannot find the file even though I have the complete path d:\code\glfw3.3.8\include in the additional includes field of the applications properties and it is a valid path to the required file VS says it cannot find the file and recommends I use some strange application called vcpkg to install it Like I say VS ______s
"A little time, a little trouble, your better day" Badfinger
-
Try again, you can still write a static lib in C in VS2022. You don't need to use pragmas either. While I'm not a fan of VS these days as it's too bloated, at least be fair and do the research before saying something sucks because it can't do something - when it can. We're supposed to be mature professionals. Supposed to be...
Jeremy Falcon
guys. I am not ranting. I have done all the suggestions, checked all the boxes, VS will not recognize the include statement it's frustration. It's not the static library issue anymore. I used the GLFW test program example from their website. Simple C program. VS will flag their include as not found even when the path is fulled included as additional include GLFW folks are also working it.
"A little time, a little trouble, your better day" Badfinger
-
Typo in the post it's #include GLFW/glfw3.h (with <> brackets. If I explicit put them this post incorrect displays them) which VS flags with red underline of #include which is the signal it cannot find the file even though I have the complete path d:\code\glfw3.3.8\include in the additional includes field of the applications properties and it is a valid path to the required file VS says it cannot find the file and recommends I use some strange application called vcpkg to install it Like I say VS ______s
"A little time, a little trouble, your better day" Badfinger
If you read my post, I said to use quotation marks around the include, not '<' and '>', so
#include "somefile.h"
. There is a big difference. And don't put an '=' or a ' ' inside the include file (so not#include "somefile somefile.h="""
- just#include "somefile.h"
. It isn't VS - it is GIGO.Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
guys. I am not ranting. I have done all the suggestions, checked all the boxes, VS will not recognize the include statement it's frustration. It's not the static library issue anymore. I used the GLFW test program example from their website. Simple C program. VS will flag their include as not found even when the path is fulled included as additional include GLFW folks are also working it.
"A little time, a little trouble, your better day" Badfinger
So you're the type that argues all day long - got it. You may wish to read your original post again. Clearly, you think that's not ranting. It is... but whatever.
Jeremy Falcon
-
If you read my post, I said to use quotation marks around the include, not '<' and '>', so
#include "somefile.h"
. There is a big difference. And don't put an '=' or a ' ' inside the include file (so not#include "somefile somefile.h="""
- just#include "somefile.h"
. It isn't VS - it is GIGO.Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Nah, it is not simple once you try to go outside defaults.
-
Like Jeremy, I can guarantee it isn't something on VS's end. It is responsible for more pieces of software than you or I can count to in a day. It must be something on GLFW's end with malformed headers. Does the header immediately include another header that is at another location? Is that malformed? Go that direction or another with GLFW taking responsibility, quit blaming VS. Build the code in my article on your end and go through all the instructions. Then create a GLFW project starting one file at a time without using any CMAKE or any other shortcuts. You will figure it out that way. You will never figure it out just by blaming VS.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Like Jeremy, I can guarantee it isn't something on VS's end. It is responsible for more pieces of software than you or I can count to in a day. It must be something on GLFW's end with malformed headers. Does the header immediately include another header that is at another location? Is that malformed? Go that direction or another with GLFW taking responsibility, quit blaming VS. Build the code in my article on your end and go through all the instructions. Then create a GLFW project starting one file at a time without using any CMAKE or any other shortcuts. You will figure it out that way. You will never figure it out just by blaming VS.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
I will. Thank you. I blame VS because 1. Have 2 copies of exactly the same C file. 2. Put them into VS "exactly" the same way (here is where the rub is, because VS makes that more complicated than it should be as "exactly" is not what has happened) 3. one works fine, the other does not. 4. Did a difference on .project files. Not "exactly" the same. That is what I am trying to resolve. If it is user error then shame on VS for making it easy to do.
"A little time, a little trouble, your better day" Badfinger
-
So you're the type that argues all day long - got it. You may wish to read your original post again. Clearly, you think that's not ranting. It is... but whatever.
Jeremy Falcon
I do not like to argue all day long. I am looking for helpful input. I have received it and I have taking everyone's advice, but I still cannot get VS to behave. Frustrating. OK. You can call it ranting. So what. I am an extremely experienced C programmer (I have also written code in C, Fortran, Cobol, Algol, PL/I ...) as well. Writing C code since K&R first publication, so feel qualified to complain. I am retired now and doing some experimenting using GLFW's VS libraries to facilitate porting a large body of work to VS for programmers at a former employer. I will calmly say VS is not a user/programmer friendly application. I have used it on and off since it first came out and it keeps getting worse. But I will solve this problem.
"A little time, a little trouble, your better day" Badfinger
-
I will. Thank you. I blame VS because 1. Have 2 copies of exactly the same C file. 2. Put them into VS "exactly" the same way (here is where the rub is, because VS makes that more complicated than it should be as "exactly" is not what has happened) 3. one works fine, the other does not. 4. Did a difference on .project files. Not "exactly" the same. That is what I am trying to resolve. If it is user error then shame on VS for making it easy to do.
"A little time, a little trouble, your better day" Badfinger
Find the main header that controls everything. Make a single VS project with just that. Comment out all of the included headers. Even comment out the code. Get that to compile. Then uncomment one header and get that to compile. Etc. etc. If it is a big project it will take quite a while. I have gone through a process like that before. It wasn't fun, but I found the stupid effing mistake. It was my own mistake.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Ever seen a simple IDE?
-
Find the main header that controls everything. Make a single VS project with just that. Comment out all of the included headers. Even comment out the code. Get that to compile. Then uncomment one header and get that to compile. Etc. etc. If it is a big project it will take quite a while. I have gone through a process like that before. It wasn't fun, but I found the stupid effing mistake. It was my own mistake.
Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver
-
Code Blocks is more straight forward
"A little time, a little trouble, your better day" Badfinger
CB is specialized for C/C++ and Fortran, so it will be far simpler than VS, but again, it is not simple. BTW it was my first IDE, so I have some newbie dev experience with it, it was not hell, but it still required serious effort to configure.
-
I do not like to argue all day long. I am looking for helpful input. I have received it and I have taking everyone's advice, but I still cannot get VS to behave. Frustrating. OK. You can call it ranting. So what. I am an extremely experienced C programmer (I have also written code in C, Fortran, Cobol, Algol, PL/I ...) as well. Writing C code since K&R first publication, so feel qualified to complain. I am retired now and doing some experimenting using GLFW's VS libraries to facilitate porting a large body of work to VS for programmers at a former employer. I will calmly say VS is not a user/programmer friendly application. I have used it on and off since it first came out and it keeps getting worse. But I will solve this problem.
"A little time, a little trouble, your better day" Badfinger
Ok... whatever.
Jeremy Falcon