Codelite not recognizing ns-3 files - c++

I'm pretty new with C++ development, and I wanted to use an IDE. I downloaded codelite, and everything was working fine.
The issue
Recently I started development an App for the NetworkSimulator3 or Ns3, that runs with Waf(https://waf.io/). Using the codelite just for my app, and doing the build&Run on the terminal with waf seems wrong.
In the end, codelite is not recognizing a butch of files of ns3, and keep pointing errors.
What I tried to do
I tried adding all Ns3 files in a single workspace, together with my app files, in hopes that everything would work. Instead I still got a bunch of "No such file or directory" errors, although these files exist and are added on the IDE
On the import, Ns3 demands us to call it like this:
#import <ns3/packet.h>
Although the .h is inside another folder:
src/network/model/packet.h
There are a few wscripts files that probably work on these bindings, although I'm not 100% sure.
So I also tried:
Adding the .h in the same folder of my app
Creating a new virtual folder called ns3, and adding the headers there
Including the folder with the headers in the compiler's include paths
Including the folder with the headers in the linker like it was a library
Nothing worked so far
I just wanted to open the Ns3 on an IDE so I could work without several errors showing. Maybe even with some autocomplete?
Could you guys help me figure this out?
Edit
I also added a "Custom build", so I can execute and build my project using waf, but the IDE errors didn't disappear

On the import, Ns3 demands us to call it like this: #import <ns3/packet.h> Although the .h is inside another folder: src/network/model/packet.h
Headers imported with <ns3/header.h> are copied from src/module/(model/helper) to build/ns3 when you build ns-3. You need to add build/ as an include folder (e.g. -I/path/to/ns-3-dev/build), which will make <ns3/header.h> work correctly.
Not sure on the other issues, since I've never tried CodeLite.
I just wanted to open the Ns3 on an IDE so I could work without several errors showing. Maybe even with some autocomplete?
If I may recommend, try the CMake buildsystem. Clone the code and create a cmake cache folder (e.g. mkdir cmake_cache), then generate the CodeLite project (e.g. cd cmake_cache && cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -G "CodeLite - Ninja" .., or -G "CodeLite - Unix Makefiles") and then open the project in cmake_cache with CodeLite. :)
Update: just read on their blog that exporting compile commands is required for code completion when using cmake.
https://codeliteide.blogspot.com/2014/02/codelite-ide-60-cmake-and-clang-code.html

Related

Missing libgcc_s_seh-1.dll starting the .exe on Windows

Intro
I have a CMake-based C++ project. Until now I build and ran the project via CLion. Everything worked fine until I tried to run the .exe-file directly (not via CLion).
Problem
When I navigate to the cmake build directory in order to start my program via the executable file, it fails with the following message in the popup: Cannot continue the code execution because libgcc_s so-1.dll was not found. Reinstalling the program may resolve the issue.
I have the following questions
If I interpret the error message correctly, then this dll is missing on my computer. So I ask myself, why does my program still work when I start it via the development environment (CLion), although the error message expressly states that the source code requires this dll?
Is it the fault of my application/source code that the error appears or rather the current state of my computer? If the former, how can I prevent this error from appearing for other users?
What is the best way to fix this error? It's obvious that I need to download this dll, but where is the best place to put it (which directory and environment variable to use on Window)?
Which source is trustworthy to download this dll? I don't want to download any malware under this dll-name.
Optional: What kind of library is that? What functionalities does it offer?
Additional information
I use CMake as my build tool, CLion as the IDE and MinGW as the compiler.
What I have did so far?
I made sure it still works through the IDE.
I found this dll does not exist in the MinGW installation folder.
I searched the web for more information. Unfortunately, there are only pages unknown to me that only offer the download of this dll. That doesn't satisfy me.
I found the cause of my problem: I had two MingGW installations on my machine. Once the installation that comes with CLion and a separate one. The latter did not have the required dll. However, CLion used its own installation, which in turn owns the DLL. So the solution was to remove the separate installation and include the path to the CLion installation's bin/ directory in the PATH environment variable.
This file is part of MinGW-w64 when using SEH as exception model (as opposed to Dwarf or SJLJ). You need to distribute the .dll files your .exe file(s) depend on in the same folder as the .exe file(s).
If you don't have that file, then you probably have been using libraries compiled with different versions of GCC/MinGW(-w64). I recommend building everything with the same compiler to ensure stable binaries.
Tools like Dependency Walker can help you figure out which .dll files your .exe file depends on.
Or use the command line tool copypedeps -r from https://github.com/brechtsanders/pedeps to copy the .exe files along with it's dependencies.

Cannot get gfwl source package to work in vscode

I wanted to learn OpenGl because I was just getting into c++ and I thought it would be cool to learn but now I'm stuck and I don't know what to do.
So basically I am not using the microsoft version of VScode, I am using your basic VScode application.
I install MinGw and added it to the path.
and i created a folder, in that file i created a main.cpp file and downloaded the source folder (source package) of gfwl from the main page
and I tried different ways of including it into my cpp file
i tried
the path of gfwl from the system
<GFWL/gfwl3.h>
the files directory to gfwl3.h
and none of them seem to work, I either get a "directory or file path invalid" or errors on it failing to import its functions like gfwlinit
how could i make this work?
Make sure to add it to the path and use a MakeFile to compile and to connect everything!

How can I get "go to definition" working in a JUCE project?

I'm trying to get "go to definition" working for a JUCE project created with Projucer. I've tried both CLion and Visual Studio Code, but they can't seem to find definitions that live in the JUCE libraries.
I'm on Ubuntu. Is there a blessed path for this? I'm normally a vim user, but I'm willing to try any IDE.
I've just figured this out!
In VS Code go View and Command Palette and type C/C++: Edit Configurations (UI) which will take to the IntelliSense Configurations page. Under Include path, on a new line, specify the path to JUCE e.g. ~/JUCE/**.
Note: The two stars are needed to tell VS Code to look through subdirectories.
This will create a hidden folder .vscode in your project folder with this configuration.
You will need to repeat these steps for each project you make.
Definitions and code completion should now work.
To compile your code, in your project folder go Builds then LinuxMakefile and in a terminal run the command make. Finally, go to the builds folder and run your project ./exampleProject.
You need to add the JUCE/modules folder to your search path, not the top-level JUCE/ folder!
If you're using the Projucer, you'll also need to add the JuceLibrarySource/ folder to your search path.
What I ended up doing was using FRUT to convert my project from a Projucer project to a CMake project. CLion was able to understand the CMake project, and thus, the "go to definition" and autocomplete features started working.

Cannot "Mark Directory as" anything but a python namespace package in CLion 2020.3

I am working with CLion and when loading a project from a valid CMakeLists file I get the warning that none of the files belong to any project target. This is annoying and I found a solution here that seems to work for most people.
In CLion, header only library: file "does not belong to any project target, code insight features might not work properly"
However when I try and mark an include directory as part of the project there is not an option. The only options is to mark it has a python namespace package. Googling for this issue didn't seem to turn anything up. Does anyone know why that option would not be there?
You can remove the CLion configuration in the containing folder then reopen the project.
rm -rf .idea
It did work for me.

QtCreator No Executable Specified

I've searched this for a while and haven't found anything answered anywhere:
I have a project in QtCreator that has no compilation errors, and runs fine as a normal C++ project in Eclipse.
However, when I try to run it as a Qt app, it says it could not find an executable and I need to specify one.
As many other sites have suggested, I have searched the directories for the .exe that QtCreator was supposed to make (according to the other sites), but I am yet to find anything.
I'm in no rush, but have spent a long time on this and would like to move on to actually writing the Qt part.
Thanks in advance.
Are you still struggling with the solution ? The most easy solution is, restore default setting by deleting file QtCreator.ini. After that configure project once again by giving build directory path. If you are working on Linux system, run following command to find QtCreator.ini file.
$ locate QtCreator.ini
It will give ouput like this
/home/tan/.config/QtProject/QtCreator.ini
Then delete the file on obtained path using following command
$ sudo rm -f /home/tan/.config/QtProject/QtCreator.ini
Now open project once again and configure with your desired build and run settings.
Upvote if above solution helps you. Btw if I've made any grammatical mistakes, I am sorry for my english. :)
Best luck !!
I'm not sure I understand what you mean by having a QtCreator project and running it in Eclipse or running it as a Qt App but if you are looking for an exe file, QtCreator is probably configured to do shadow builds for your project. This means that build output is sent to a directory outside of your project source directory. If your project is in a directory called MyApp, then look for a directory beside it called MyApp-build-desktop. You should find your executable in there.