Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. VS 2022 is not C friendly

VS 2022 is not C friendly

Scheduled Pinned Locked Moved The Lounge
visual-studio
80 Posts 14 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jmaida
    wrote on last edited by
    #1

    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

    S L P S J 6 Replies Last reply
    0
    • J jmaida

      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

      S Offline
      S Offline
      Shao Voon Wong
      wrote on last edited by
      #2

      You can try to link the static lib by specifying this pragma statement in any c source file.

      #pragma comment(lib, "c:\\your_folder\\your_lib.lib")

      1 Reply Last reply
      0
      • J jmaida

        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

        S Offline
        S Offline
        Shao Voon Wong
        wrote on last edited by
        #3

        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.

        J 3 Replies Last reply
        0
        • S Shao Voon Wong

          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.

          J Offline
          J Offline
          jmaida
          wrote on last edited by
          #4

          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

          L 1 Reply Last reply
          0
          • S Shao Voon Wong

            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.

            J Offline
            J Offline
            jmaida
            wrote on last edited by
            #5

            Understood. Thank you. Still not VS fan, but I have no choice.

            "A little time, a little trouble, your better day" Badfinger

            S D 2 Replies Last reply
            0
            • J jmaida

              Understood. Thank you. Still not VS fan, but I have no choice.

              "A little time, a little trouble, your better day" Badfinger

              S Offline
              S Offline
              Shao Voon Wong
              wrote on last edited by
              #6

              You're welcome. I happened to know the answer because I encountered the same problem some time ago.

              1 Reply Last reply
              0
              • J jmaida

                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

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                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.

                P J 2 Replies Last reply
                0
                • J jmaida

                  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

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  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.

                  S J 3 Replies Last reply
                  0
                  • L Lost User

                    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.

                    S Offline
                    S Offline
                    Slacker007
                    wrote on last edited by
                    #9

                    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... :sigh:

                    J 1 Reply Last reply
                    0
                    • L Lost User

                      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.

                      P Offline
                      P Offline
                      PIEBALDconsult
                      wrote on last edited by
                      #10

                      All of which may be true, but... A developer may complain that accomplishing such-n-such is difficult/tricky/whatever -- and C falls into that category. Then Microsoft comes along and says that Visual Studio will make it easy (and it definitely makes many things easy). But if VS doesn't make that one thing easy, then it SUCKS!, I mean it won't satisfy that developer's immediate need. I don't use Visual Studio much because it generally doesn't do anything I need done, not because I don't like it. What little C I still do, I don't do with Visual Studio. I really like C#, which in part may have been designed specifically for Visual Studio, so VS is very good for C# (and .net). I miss Turbo C.

                      L J 2 Replies Last reply
                      0
                      • P PIEBALDconsult

                        All of which may be true, but... A developer may complain that accomplishing such-n-such is difficult/tricky/whatever -- and C falls into that category. Then Microsoft comes along and says that Visual Studio will make it easy (and it definitely makes many things easy). But if VS doesn't make that one thing easy, then it SUCKS!, I mean it won't satisfy that developer's immediate need. I don't use Visual Studio much because it generally doesn't do anything I need done, not because I don't like it. What little C I still do, I don't do with Visual Studio. I really like C#, which in part may have been designed specifically for Visual Studio, so VS is very good for C# (and .net). I miss Turbo C.

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        PIEBALDconsult wrote:

                        A developer may complain that accomplishing such-n-such is difficult/tricky/whatever

                        That is an essential part of the job, and why documentation and help systems are created. I come from an age before Google, so I had to learn the hard way - mainly by buying, and studying, the books.

                        P 1 Reply Last reply
                        0
                        • L Lost User

                          PIEBALDconsult wrote:

                          A developer may complain that accomplishing such-n-such is difficult/tricky/whatever

                          That is an essential part of the job, and why documentation and help systems are created. I come from an age before Google, so I had to learn the hard way - mainly by buying, and studying, the books.

                          P Offline
                          P Offline
                          PIEBALDconsult
                          wrote on last edited by
                          #12

                          'Xactly. Me too. Kids these days expect everything to be handed to them. I also learned on OpenVMS, which has a debugger, but it's practically unusable.

                          N C 2 Replies Last reply
                          0
                          • J jmaida

                            Understood. Thank you. Still not VS fan, but I have no choice.

                            "A little time, a little trouble, your better day" Badfinger

                            D Offline
                            D Offline
                            David ONeil
                            wrote on last edited by
                            #13

                            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](https://www.codeproject.com/Articles/5292382/DWinLib-Build-Process). It can be a pain to set up, but gives a lot of power when you've figured it out.

                            Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver

                            J 1 Reply Last reply
                            0
                            • S Slacker007

                              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... :sigh:

                              J Offline
                              J Offline
                              jschell
                              wrote on last edited by
                              #14

                              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?

                              D 1 Reply Last reply
                              0
                              • L Lost User

                                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.

                                J Offline
                                J Offline
                                jmaida
                                wrote on last edited by
                                #15

                                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

                                L J 2 Replies Last reply
                                0
                                • L Lost User

                                  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.

                                  J Offline
                                  J Offline
                                  jmaida
                                  wrote on last edited by
                                  #16

                                  IT IS VS

                                  "A little time, a little trouble, your better day" Badfinger

                                  1 Reply Last reply
                                  0
                                  • L Lost User

                                    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.

                                    J Offline
                                    J Offline
                                    jmaida
                                    wrote on last edited by
                                    #17

                                    I selected static library project, set the parameters that were given. It has everything to do with VS.

                                    "A little time, a little trouble, your better day" Badfinger

                                    D 1 Reply Last reply
                                    0
                                    • D David ONeil

                                      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](https://www.codeproject.com/Articles/5292382/DWinLib-Build-Process). It can be a pain to set up, but gives a lot of power when you've figured it out.

                                      Our Forgotten Astronomy | Object Oriented Programming with C++ | Wordle solver

                                      J Offline
                                      J Offline
                                      jmaida
                                      wrote on last edited by
                                      #18

                                      Thanx David. I will have a look. Shao also gave me some good tips.

                                      "A little time, a little trouble, your better day" Badfinger

                                      1 Reply Last reply
                                      0
                                      • S Shao Voon Wong

                                        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.

                                        J Offline
                                        J Offline
                                        jmaida
                                        wrote on last edited by
                                        #19

                                        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

                                        1 Reply Last reply
                                        0
                                        • P PIEBALDconsult

                                          All of which may be true, but... A developer may complain that accomplishing such-n-such is difficult/tricky/whatever -- and C falls into that category. Then Microsoft comes along and says that Visual Studio will make it easy (and it definitely makes many things easy). But if VS doesn't make that one thing easy, then it SUCKS!, I mean it won't satisfy that developer's immediate need. I don't use Visual Studio much because it generally doesn't do anything I need done, not because I don't like it. What little C I still do, I don't do with Visual Studio. I really like C#, which in part may have been designed specifically for Visual Studio, so VS is very good for C# (and .net). I miss Turbo C.

                                          J Offline
                                          J Offline
                                          jmaida
                                          wrote on last edited by
                                          #20

                                          Ah Turbo C. I miss thee.

                                          "A little time, a little trouble, your better day" Badfinger

                                          R 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups