|
The reason the VC++ static library project does not have the linkage option is that the static library does not have to link to any library, the source code file only needs to include the headers file to compile correctly.
The executable project that uses your C static library must link with both static libs in the link options.
modified 22-Jan-23 0:13am.
|
|
|
|
|
Thanks. Pragma's seem to the answer to all the weird VS behavior I have encountered such as fopen vs fopen_s etc.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
jmaida wrote: weird VS behavior I have encountered such as fopen vs fopen_s etc.
Again, that has nothing to do with Visual Studio, but only the code that you are writing.
|
|
|
|
|
A lot of members here at Code Project love to hate on Visual Studio for no intelligent reason at all.
"I got into a car crash this morning, I hate Visual Studio."
"I stubbed my toe getting out of bed this morning, Visual Studio sucks!!"
"I don't know what I am doing, it's Visual Studio's fault!"
the list literally goes on forever...

modified 22-Jan-23 5:07am.
|
|
|
|
|
Slacker007 wrote: A lot of members here at Code Project love to hate on Visual Studio for no intelligent reason at all.
But they express undying love for some other bit of technology? Which bit is that exactly?
|
|
|
|
|
|
Python?!? Hell no!
But there are much better tools out there than VS, specially if one is interested in programming just in C, without any of those C++isms...
|
|
|
|
|
Ralf Quint wrote: But there are much better tools out there than VS
Bash scripts and make?
|
|
|
|
|
No bash, and no make, if one can avoid it.
But for C programming, as per original post, there's for example Pelle's C, which is not only a fraction of the size of VS, but also Freeware. Commercially, then there is Embarcadero's Delphi/C++Builder/RAD Studio, and FreePascal/Lazarus are an Open Source Object Pascal option.
All of those are smaller and easier to use than VS. But it seems that some people just stick to VS because of their masochistic tendencies, just like a lot of macOS users think they just have to punish themselves by using XCode...
|
|
|
|
|
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
|
|
|
|
|
jmaida wrote: The problem is VS is way too complicated Well, I totally disagree with you on that. And I have been using it, or its predecessors, for almost thirty years. I have created complete applications, and static and dynamic libraries, using C, C++, C# and even VB.NET, so I also know what I am talking about.
|
|
|
|
|
|
|
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
|
|
|
|
|
Nah, it is not simple once you try to go outside defaults.
|
|
|
|
|
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.
|
|
|
|
|
If you want to do JUST C, try taking a look at Pelle's C. None of the C++ stuff, just by default, compliant with the latest C standard.
Freeware, but not Open Source. But certainly the price tag fits...
|
|
|
|
|
IT IS VS
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Understood. Thank you. Still not VS fan, but I have no choice.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
You're welcome. I happened to know the answer because I encountered the same problem some time ago.
|
|
|
|
|
Don't know if you will find it helpful, but here's an article on configuring Visual Studio for a C++ project. It deals with the same issue you face, and might give you more insights into Visual Studio's processes - maybe. DWinLib Build Process. It can be a pain to set up, but gives a lot of power when you've figured it out.
|
|
|
|
|
Thanx David. I will have a look. Shao also gave me some good tips.
"A little time, a little trouble, your better day"
Badfinger
modified 22-Jan-23 15:51pm.
|
|
|
|
|
I understand. The static library I am trying to create explicitly uses calls to another static library (which I did not create). I understand that both with be involved when used by a third application. I have been using CodeBlocks as my IDE of choice. Much more straight forward and has a great editor. Uses GCC compiler.
"A little time, a little trouble, your better day"
Badfinger
modified 22-Jan-23 15:55pm.
|
|
|
|
|
This has nothing to do with Visual Studio, but only the parameters you have set in your project. Including libraries, whether static or dynamic, is a standard part of VS project files.
|
|
|
|