Eclipse CDT using CygwinGCC toolchain cannot debug if app links with dll? - c

Why wouldn't my Eclipse CDT find an x.dll where I specified via
C C++ General/Paths and Symbols/Libraries (this is the lib name without extension x)
C C++ General/Paths and Symbols/Library Paths (this is full path to dll)?
I'm on Windows 8.1, using CygwinGCC toolchain, debugging via gdb.
The app.exe is built OK, Eclipse project seems to see the dll at this point (for example, if I misspell the dll name, it complains and fails to build). However, when I try to debug the app, I get an ugly unhandled exception message right at startup.
When I manualy copy the needed x.dll to sit in the same directory as app.exe, then I can debug with no problems.

Related

Eclipse will not run C programs

I just recently installed the CDT plugin for Eclipse in Windows 8 and I'm getting the error:
"Launch failed. Binary not found."
Now I've looked into this and I have installed cygwin with gcc and set that up in Eclipse settings. I went to Window>Preferences>New C/C++ Project Wizard>Makefile Project and checked Cygwin PE Parser (and just in case I checked PE Windows Parser as well).
Then I went to Window>Preferences>Build>Environment and added my PATH variable there. I made sure to add C:\cygwin64\bin to my PATH in my system settings, and I know this is valid because I checked that location and I have successfully run gcc through the command line as well as the cygwin terminal. On top of this, if I build my project in Eclipse and then navigate to that directory outside of Eclipse and run the .exe that it creates by double-clicking on it, it also runs properly.
I'm at a loss for why Eclipse can't run it but everything else can...Any suggestions?
right click your project in eclipse "project explore" -> Run as -> Run configuration
=>select your project name then check "Main" tab, in C/C++ application file. is it point to your binary file?
E.g:
Debug/TestProj.exe

Eclipse Juno, CDT, ARM, path issues on OS X

I'm using Eclipse Juno, trying to get the ARM toolchain working. What I have installed:
Eclipse Juno
Zylin Embedded CDT Plugin
GNU ARM Eclipse plugin
Summon-Arm-Toolchain, installed in the default ~/sat/ directory.
When I create a new C project using the Summon toolchain, the following error appears: 'Program "arm-none-eabi-gcc" not found in path.' The error location is "[Discovery Options] page in project properties." I've tried setting the Eclipse-level (Eclipse->Preferences->C/C++->Build->Environment) PATH and the project-level PATH to include this path, both relatively (~/sat) and absolutely /Users/alterscape/sat), but nothing seems to fix the problem. I've also tried manually adding the full path in the Discovery Options page. Is there a known fix? If not, is there a way to echo $PATH inside Eclipse to see what it thinks its path is?
So, here's the story: Eclipse CDT does NOT automatically re-check errors to see if they go away after you apply changes to your path. You have to manually re-build. This came as a surprise to me because I am used to my Java toolchain checking/updating errors as I make configuration changes. It isn't entirely obvious that you need to re-run Build Project to see if your changes fixed the error, but that's the path forward.

How to make a run configuration in eclipse using CDT

I'm trying to compile a code i made in C in Debian using CDT for Eclipse and i'm having the famouse Binary not found error when i try to compile the code. I already build the code by pressing Ctrl+B and the Debug folder appears, and the code doesn't have any syntax error, but the error still there. After that i tried to make a run configuration for my project but i'm not sure about what to put where it say's C/C++ Application. Which is the best configuration for this problem?
I'm using Debian Squeeze, Eclipse CDT and GCC as compiler
If you have successfully built your project and have an executable you can run (no build errors, project properly configured as executable), just press a "search project" or "browse" button in "debug configurations" dialog and point it to your executable.

ntddk.h no such file or directory

I am using CODE::BLOCKS in windows XP. Tried to write a device driver. But right after creating a project, I got below error. I did below settings, but still getting the error as
"ntddk.h no such file or directory". I have tried with all compilers (Project built option), but it is still there.
Please help.
Created the project like:- File->New->Project->Kernel Mode Driver->Next->Next...
If, like most people using Code::Blocks on Windows, you use MingW-TDM (commonly detected as "GNU GCC Compiler" by Code::Blocks, and bundled with the "easy install" package), the file ntddk.h is located in the ddk subfolder of the system include folder.
Thus, you either have to add the ddk folder to the include search path, or write #include <ddk/ntddk.h>, either will work.
Your list of compilers does not seem to include the DDK compiler
Do you have the windows DDK installed?
NOTE: I know nothing about codeblocks but you will need the DDK compiler to compile windows drivers.

Problem creating an exe from C

I've made a small application in C with Netbeans.
I've ran the application in Netbeans and it created an exe.
I used that exe and it worked fine on my comp but when I move it to other comp it says:
"This application failed to start because cygwin1.dll was not found. Re-installing the application may fix this problem."
How can i create the exe so that it runs anywhere?
The problem is you're using Cygwin GCC to compile your code. Cygwin provides a unix-like environment
if you're not doing anything Unix-y you can recomplie -mno-cygwin - see Can you statically compile a cygwin application?
if you are using Unix calls you'll need to distribute cygwin1.dll along with your app
or you can recompile with a different compiler, e.g. a GCC that targets mingw32 not cygwin, or one of the free (as-in-beer) Microsoft compilers from the platform SDK or Visual Studio Express downloads.

Resources