Why am i not able to link my C/C++ libraries with NetBeans? - netbeans

I've downloaded C/C++ libraries from Cygwin, and set the environment variables according to the instructions here, in NetBeans.
I've also gone through this.
Actually I followed the same steps on a different machine and everything worked out fine.
But on my machine the associations aren't made.
for example: #include<stdio.h> says No such file or directory.
Any idea what the problem might be?
The Cygwin package I downloaded is also fine, I downloaded it twice.

If it's complaining about a #include, that's a compile issue, not a linking issue.
What happens if you create a new C/C++ application project and try to build it?
In the Build node of the project properties, is the correct Tool Collection selected? (Cygwin in your case). And the Tools -> Options, on the C/C++ tab, is that tool collection set up correctly?

You should check whether you have a file c:\cygwin\usr\include\stdio.h.

Related

No Includes directory in Project Explorer

I have just installed Eclipse CTD v2020.6 and ESP-IDF v4.1 and configured it in Windows 10. I can build and flash without any problem. But I don't know why I can't see the Includes directory in Project explore. Is it normal, if so is there any way I can add it there?
Along with that, I have noticed there is not C/C++ build section in Project Properties. :?: I am attaching the screenshots for reference.
If someone can help me with this, I will be grateful.
[

How to migrate eclipse project to atmel-studio?

I want to migrate the project in atmel-studio from eclipse cdt, as I started working on an embedded c/c++ project I understood that atmel-ice is not debugging properly in eclipse it's just helping me to flash firmware nothing more than that. So, Want to migrate my whole project to atmel-studio. So, I could debug it. Looking for help thanks.
As an option, look into the atmel-studio capability of debugging an externally produced elf. The tools I've used (keil, tensilica, IAR) all had ways to make a project that could debug an elf file produced externally. You may lose some magic like source parsing/intellisense or whatever, but I've found source line debugging works just fine.
I've never used Atmel Studio, but in searching the web, I found:
http://ww1.microchip.com/downloads/en/devicedoc/atmel-42167-atmel-studio_user%20guide.pdf
http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-ECD8A826-B1DA-44FC-BE0B-5A53418A47BD-en-US-5/index.html?GUID-4C53CCC3-659D-4030-A7FD-566B19C87747
Both of which say "File->Open Object file for debugging"

Eclipse can't find MinGW. Why?

I installed both correctly, but it doesn't matter if I set up the path to compiler correctly or not because it can't find gcc and g++. I checked it with explorer, they were at the correct location. I tried everything I could, even I ran Eclipse in backwards compatibility mode and as an administrator.
EDIT: I'll using Visual Studio 2012 for a while if Eclipse can't be at least as user friendly to having find a solution to the problem under one hour via web.
Download this , chose the desired compilers (gcc and g++) . Make sure you have the value C:\mingw64 in PATH variable under environment variables .
I had to reload my workspace in order to get Eclipse to recognize that.
Also, I had updated the Path variable.
Please follow the same in your case.
I couldn't make the Eclipse (LUNA) to find MinGW on my computer (there were no MinGW available in Preferences>C/C++/New C/C++ Project Wizard) even after I have specified PATH as "C:\MinGW\bin" in Preferences>C/C++/Build>Environment, so what I did afterwards was:
Create a simple "Hello world" C project without specifying any toolchains
(at this step I tried to Build All, and it failed)
Go to Project>Properties, suprisingly, here I could see MinGW GCC as an available choice for Current toolchain. Select it.
Now I could build and run the project
Hopefully, it helps!

How can Eclipse recognize MPI artifcats without errors?

I installed Eclipse for Parallel Applications and MPI v. 2.
I created inside Eclipse a new Hello World MPI project and run it using 4 processes. I can build and run it from Eclipse, it works.
Eclipse also recognizes MPI artifacts correctly.
I configured the includes as described here:
http://help.eclipse.org/juno/topic/org.eclipse.ptp.pldt.doc.user/html/includes.html
However I'm getting a lot of errors on MPI artifact on the source code, same errors as described in the above link:
The Indexer can't find your include file
"If the indexer can't find your MPI header file, you may see problems like the following:
If your MPI header file is located in a global area that automatically gets included in your project's include path location, such as /usr/include or /usr/local/include, then things will probably work just fine without further alteration. Building and indexing will probably both operate correctly.
If you do not use mpicc or a similar build command and need to specify include and libpath information on building and linking, you will probably want to set the PLDT preferences to point to your include path for MPI, in which case, the include and link arguments will be added to your build commands."
My code works but I think it is impossible to work with al these red lines on every MPI instruction.
So my question is: how can I configure Eclipse in order to recognize MPI functions without telling me that there are errors?
Using Ubuntu 64 bit with last version of MPI and Eclipse.
I found a fix:
Right click on project -> Properties -> C/C++ General -> Paths and Symbols
On tab "Includes" click on "GNU C" and then on "Add.."
"/usr/include/mpi"
rebuild
It sounds like Eclipse does not include directories recursively.
Source: http://tinyurl.com/nkq2gwp [pages 35-36]
The link you posted seems to have all the answers that you're going to get here. Are you sure that your "mpi.h" header file is in the location you put in your include path in Eclipse? It seems that you may have the wrong path.

Eclipse CDT Invalid Project Path

I have a C project that is built using a makefile, Eclipse constantly warns about "Invalid project path: Duplicate path entries", but I cannot figure out what the hell it wants me to do. I would like to disable this warning and continue with my life.
My application compiles and runs fine, with not a single warning except this one. Being a conscientious developer I am keen to fix this problem so I have the warm fuzzies only a clean build can bring.
This worked for me with Eclipse 3.7.2 and CDT 8.0.2:
Open the project properties | C/C++ Build | Discovery Options.
Click the button by Clear discovered entries now:.
Rebuild.
It is seems to be a new feature in CDT 8. I have had this "Invalid project path: Duplicate path entries" problem for years, and this is apparently the newly provided solution.
Before doing this there were duplicate paths under C/C++ General | Paths and Symbols | Includes tab. I could not get rid of these. They only appear when Show built-in values is checked, so they are apparently generated somehow. After doing the above they were replaced with a set that did not have duplicates. The only difference is that the same settings appeared under Assembly, GNU C, and GNU C++. Previously they were different sets. The ones for Assembly were empty, for example.
So far the problem has not returned.
This problem is a real pain to deal with. It doesn't work very well.
This is applicable to Eclipse 3.4.1 / CDT 5.0.1
From what I can tell, when you create a "C/C++ Project" within CDT, it will try to auto-detect your include paths. Great idea, but the implementation is horrid.
If you delete or rename a directory, the old directory is leftover. If you rename the project, the old directory is leftover. When Eclipse can't find that old directory, it gives you that warning.
My solution is turning the automated discovery off entirely and managing my include paths manually. You need this list of include paths for things like ctrl-click (auto-navigate to defines/functions/files/etc) and shading out #define blocks. It builds the index off this list.
Here's what you need to do:
Right click on your project in the project explorer and go to properties.
Go to C/C++ Build -> Discovery Options
Uncheck "Automate discovery of paths and symbols"
Now go to C/C++ General -> Paths and Symbols
You'll see under the Includes tab Assembly, C and C++ languages with corresponding auto-discovered include directories.
Go to all 3 languages and delete everything.
Open your makefile and transcribe your includes into the corresponding language.
A project rename will still cause the indexer to break. ${project_name} and other globals do not seem to work. If you're having trouble, use the "Workspace" button to browse to the directory you want to include, as that seems to always work but entering it manually does NOT.
Hit apply, then OK.
Right click your project, go to index->rebuild
Restart eclipse.
This should fix things forever. Any time something improperly is shaded out due to a #define or #ifdef block, it's because that list of files is outdated. You'll also know that list is outdated if you get "unresolved inclusions" on #include lines.
Doug Schaefer, hopefully Google indexes this, you find your name, and you fix this awful implementation. =)
I found this bug report to help my problem. I had moved some include paths and couldn't get rid of the old paths.
I've seen this problem too, old paths
are never deleted. To manually fix the
file you need to move/delete the
${projectname}.sc file found under
${workspace}/.metadata/.plugins/org.eclipse.cdt.make.core
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206372
Using Eclipse Luna and CDT 8.5
I fixed the issue by
Open the project properties | C/C++ General | Paths and Symbols
Look at the Source Location tab, I had renamed a directory and it was not updated in this list.
Rebuild
Here I just found another way to re-detect the path automatically:
Open "Workspace Settings-> C/C++ -> Build -> Settings -> Discovery"
Find "CDT Build-in Compiler Settings [Shard]"
Click "Clear Entries" and "Reset" button on the right
Rebuild projects and Done
Hope this will help.
Reference:
http://qing.blog.sina.com.cn/1802712302/6b7334ee33004def.html
It seems like a bug in CDT.
If you really want to get rid of it, you should try getting rid of the spaces in the project path; this was suggested in a search result for the error. If that doesn't work, you can try to open the .cproject file -it's where all the CDT settings lie- and check for an actual path with duplicate entries.
You should check if you have manually defined a symbol that eclipse can figure out from your makefile. I have a project that has a manually written makefile and the problem was solved by removing symbols that I had manually added to C/C++ General -> Paths and Symbols -> Symbols.
No needs to remove .metadata guys, just delete all path located in C/C++ General -> Paths and Symbols -> Symbols and replace them on using click buttom but don't give the path manually
Here's a late answer for Eclipse 4.4 (which does not have a Discovery option).
Delete the project's infoPath file. Eclipse or the ADT plugin (not sure which) will recreate it, and populate it with the correct paths.
You can find the project's infoPath file at <Eclipse workspace>/.metadata/.plugins/com.android.ide.eclipse.ndk/<project>.pathInfo.
I think Eclipse or the ADT plugin determines the new paths from two places: (1) the NDK directory set under Eclipse preferences, and (2) paths in Application.mk. All those paths become "Built-in" paths under Eclipse.
Also see How to change built-in C/C++ paths pointing to a deleted android-ndk-r9 installation?