Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6117277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:18:08+00:00 2026-05-23T15:18:08+00:00

I’ve been using VS2008/2010 for a while and I’m going to learn using Eclipse

  • 0

I’ve been using VS2008/2010 for a while and I’m going to learn using Eclipse Helions for C/C++ development (mainly C).

I am abit confused about libraries and includes though.

1) How do you properly include winsock2.h for example? I’ve tried this:

#ifndef CONFIG_H_
#define CONFIG_H_


/*  Windows-Build   */
#if defined(WIN32) || defined(_WIN32)
#include <winsock2.h>
#endif

SOCKET sock;

#endif /* CONFIG_H_ */

But the compiler dosn’t recognise SOCKET. Do you have to manually add the full path to winsock2 somewhere?

2) What about ws2_32.lib? Where do you include that in Eclipse? Do you have to add a path as well?

3) Having used VS mostly I’m new to makefiles. How do you include custom makefiles? Is there a good guide for starting with makefiles?

4) Is there a intellisense like in VS?

That’s what I can figure out right now.
Thanks!

EDIT:
In response to the first answer:

Building target: Filesharing_core.dll
Invoking: Cygwin C Linker
gcc -L"C:\cygwin\lib\w32api" -shared -o"Filesharing_core.dll"  ./src/test.o   -llibws2_32.a
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -llibws2_32.a
collect2: ld returned 1 exit status
make: *** [Filesharing_core.dll] Error 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:18:09+00:00Added an answer on May 23, 2026 at 3:18 pm

    First off, cygwin will usually use GCC as it’s compiler. That means that there’s no special windows support that you’ll find in the VS compiler and editor. Be prepared to get your hands dirty.

    Keep in mind that my CDT version is a bit old and I don’t have Cygwin installed so some of the things below might not be accurate. Also all the compiler options that I mention are detailled in the gcc manual.

    1) In your sample, nobody is defining WIN32 or _WIN32 (I don’t think GCC is going to do that for you but do check). To fix that, you’ll have to include the windows.h header which (I think) will take care of definning the correct macros. You could also use the -D compiler switch (configurable in your makefile or through the eclipse menus).

    If you encounter missing include errors once you’ve fixed the defines, I believe that the windows headers are located in the C:\cygwin\usr\include\w32api folder. To add that to your include path, simply open your project properties and navigate to C/C++ General > Paths and Symbols. Add the path to the GNU C group in the Includes tabs. Depending on how you configured your project, this might have already been done for you.

    If you’re building with your own makefile, you should still do the previous step because it will allow the indexer to find and parse those headers. To tell the compiler about the include folder, use the -I switch.

    2) I’m going to guess that ws2_32.lib is the lib file for winsock2. If this is the case, I’m not entirely sure who’s responsible for building it (is there a .dll you can use instead?). You might want to check your c:\cygwin\usr\lib folder or the c:\cygwin\usr\local\lib.

    If you’re using a managed project (eclipse builds the makefile for you) then go to your project properties and navigate to C/C++ Build > Settings. In the Tool Settings tab, go to the libraries item in the linker section. Just add the name of the lib file and the folder in the appropriate boxes.

    In your own makefile you’ll want to use the -l compiler switch to specify a library and the -L compiler switch to specify a search path.

    3) A good place to get started with makefiles would be the GNU make manual.

    One detail about running a Makefile on Windows: make sure to use the shell provided by Cygwin or MinGW. Otherwise, commands like rm won’t be defined and it’ll make your life very difficult.

    You might also want to consider CMake. It’s easier to use and scales better to larger projects.

    To use a hand-made makefile in your project, just create an new Makefile project and dump your Makefile file in the root of your project folder. That’s it.

    4) Yes there is but it’s not called intellisense. Just hit CTRL+Space anywhere in your source code to bring it up.

    Other fun tools can be found in the right-click menu. My personal favorites include CTRL+SHIFT+R to find and open a file, CTRL+SHIFT+T to find and open a type\variable\function\define and CTRL+O to find and goto a type\variable\function\define within the opened file.

    The indexer can go a little crazy sometimes (mostly when parsing C++ code). You can modify its behaviour by going in the Windows > Preferences menu at the top and navigating to the C/C++ > Indexer item.

    I hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.