How to compile `Hello, World!` Linux kernel module in Eclipse CDT? - linux-kernel

I want to develop Linux kernel module by Eclipse IDE, any one could help how configure Eclipse CDT to compile and run this kernel module ?

#Khajavi, Please follow the steps below,
1) Go to File --> New --> Project --> A dialog box pops up, then
2) Under C/C++ --> Select "Makefile Project with Existing Code" and select "Next"
3) Fill Project Name, Language and Toolchain used, browse and select the location where
your kernel source --- select "OK" and select "Finish"
4) Project will be created and shown on the left hand side of Eclipse IDE. Right click on
the project folder and select "Properties"
5) Select C/C++ Build option, find tabs such as "Builder Settings" "Behavior" on the RHS
dialog. Let the Builder settings be as it is, but in the Behavior tab delete "all"
part of "Build (Incremental Build)", apply and exit.
If you want your kernel module to be cross compiled, then configure the "Builder Settings" as below
Thus eclipse settings are configured and can compile or clean your module :-)

Related

After build and install MySql driver for Qt it's unable to load the MySql Drive

I'm already build and install the MySql drive like here.. But still I got the error message QMYSQL driver not loaded. Now it;s say MySql as a available driver. I'm using 64bit windows, Qt creator version 32-bit, mingw81_64 and MySql 64 bit Error is,
" QMYSQL driver not loaded. available drivers: QSQLITE QMARIADB QMYSQL QMYSQL3 QODBC QODBC3 QPSQL QPSQL7"
This question is already answered here. Enough details are provided there.
In brief:
Download proper libmysql.lib based on your Qt creator version (32-bit?)
Put that dll in your build directory (to see your project's build directory, click the "Projects" button on the left menu bar on Qt creator and see the "Build directory")
Build and run
Edit 1:
One more thing: when you download different versions of libmysql.dll, do as follows:
Right click on your application project and select "Add Library"
A dialog opens. Select "External library" radio button and click "Next"
For the "Library file", brows for your libmysql.lib and select it
In the "Platform" section, select the proper platform (windows, linux, ...)
If you are a windows user, make sure to check the "Library inside "debug" or "release" subfolder" checkbox
Click next
This is the most reliable way to add a library to your project. Hope this helps.
Probably you don't have the libmysql.dll (or libmariadb.dll) in your path. The mechanism is that the MySQL database plugin dll is dynamically loaded runtime, and even if the database plugin itself is present (therefore listed as available), it might fail to load if the libmysql.dll (or libmariadb.dll) is not found.

How to add "lwIP library" to Eclipse XSDK Zynq Application Project?

How to add "lwIP library" to Eclipse XSDK Zynq Application Project?
I tried following the instructions in "Xilinx Standalone Library
Documentation" for Zynq-7000 CPU under the chapter for "lwIP" library.
So basically, I create a FreeRTOS application project
Then the instructions say open the "The Board Support Package Settings window"... which I can't find... and then:
(e) Select the lwip202 library with version 1_1 .
On the left side of the SDK window, lwip202_v1_1 appears in the list of libraries to be compiled.
(f) Select lwip202 in the Project Explorer view.
The configuration options for lwIP are listed.
(g) Configure the lwIP and click OK.
The board support package automatically builds with lwIP included in it.
How to find the BSP settings windows in XSDK?
How to adding lwIP library to XSDK project.
Create Application project named with FreeRTOS option selected.
Right click _bsp and select "Board Support Package Settings"
Click Check box "lwip"
click ok.

VS2017- Solution Configuration won't apply changes - Does not build the selected configuration

I have a solution with one project and 3 solution configurations:
Debug
Release
Staging
When I for example choose "Release" in the quick menu toolbar to change the active solution configuration and Hit F5 I expect the solution to be compiled in Release mode, but whoooo it's still debug (Output window). Ok, let's go to the configuration settings and clear it up.
But the IDE will not apply my changes...? What's wrong here?
When I go to solution -> properties -> All Configurations I expected all my configurations to be visible that I have configured. As I have only one project, I expect "Release", "Debug" and "Staging (added by me)" to be present.
But they are all set to debug...
If you open the "Configuration Manager" via the Build entry.
It opens the same "Configuration Manager" when going the route: Right-click Solution --> Properties --> Configuration Manager.
Now you can choose the Active solution configuration for example "Release" and check if the projects configuration is also set to Release, if not change it.
Click Close and rebuild your solution. Now it should build the chosen configuration. You have to repeat these steps for every configuration: Debug|Test|Staging ...etc.
This time it will remember the settings!
When going solution- -> properties it will not, at least in my case.
(1) Make sure your solution file has a configuration set for the release mode you want.
To do this, right-click the solution in Visual Studio and choose Properties. Then use the "Configuration Manager..." button. In the dialog box that appears, for the project you want to add a configuration for, choose the drop down in the Configuration column.
(2) Right-click your project file in Visual Studio and choose Properties. Select the 'Build' tab. Make sure the 'Configuration' drop down menu has the build configuration you want to use and that you have a corresponding 'Conditional compilation symbols:' entry set that matches. See screen shot below.
(3) In your code behind file (.cs for C#). You'll should see the
#if VALIDATION
// Your code when building for VALIDATION
#elif PRODUCTION
// Your code when building for PRODUCTION
#endif
By changing the drop down at the top of the screen, each of the conditions you've coded for should be enabled/disabled (visually by shading of the text) based on the configuration selected.

How to change Xcode build setup without modifying project files?

I would like to know if it is possible to change compile settings without modifying the xcode projects.
Example, adding -Wno-unused-parameter to CFLAGS in such way that it will be used by Xcode when building projects.
This has to work in both case: build made from xcode in GUI or from the console.
If someone asks about why, let's say that the number of projects is quite big and that you may want to alter the options only temporary.
Put the compiler settings you want to change in a configuration settings file. You can create a new one by choosing File > New > New File. The configuration settings file is in the Other group under both iOS and Mac OS X.
To tell an Xcode project to use the configuration settings file, select the project file from the project navigator to open the project editor. Select the project from the left side of the editor. Click the Info button at the top of the editor. You should see a list of build configurations in the editor. Click the disclosure triangle next to a build configuration to have it use a configuration settings file.

Xcode : Adding a project as a build dependency

Im playing around with the soundcloud api, in its instructions it says to
drag SoundCloudAPI.xcodeproj into your project
add it as a build dependency
I can drag the project in pretty easily, but how does one accomplish the next step?
To add it as a dependency do the following:
Highlight the added project in your file explorer within xcode. In the directory browser window to the right it should show a file with a .a extension. There is a checkbox under the target column (target icon), check it.
Right-Click on your Target (under the targets item in the file explorer) and choose Get Info
On the general tab is a Direct Dependencies section. Hit the plus button
Choose the project and click Add Target
Select your project in the navigator on left.
Open up the drawer in the middle pane and select your target.
Select Build Phases
Target Dependencies is an option at that point.
Tough one for a newbie like me - here is a screenshot that describes it.
Xcode 10.2.1
Under TARGETS in your project, right-click on your project target (should be the same name as your project) and choose GET INFO, then on GENERAL tab you will see DIRECT DEPENDENCIES, simply click the [+] and select SoundCloudAPI.
Just close the Project you want to add , then drag and drop the file .
Xcode add a project as a dependency
Xcode 10
drag-n-drop a project into another project - is called cross-project references[About]
add the added project as a build dependency - is called Explicit dependency[About]
//Xcode 10
Build Phases -> Target Dependencies -> + Add items
//Xcode 11
Build Phases -> Dependencies -> + Add items
In Choose items to add: dialog you will see only targets from your project and the sub-project
Today I faced with the same problem.
As the result of the first run I got next error:
Lexical or Preprocessor Issue: 'SDKProjectName*/*SDKProjectName.h'
file not found.
But before running, I, obviously, added my SDK into the demo project, just drag&drop .xcodeproj file into my test project's source tree. After that, I moved into Build Phases tab in setting of the main xcodeproj file (of the demo) and added my SDK as target dependency and embed framework into corresponding tabs.
But at the result, I got an error above!
So, the problem was into empty line on the Header Search Paths option. I just wrote "../**" as value for this key and project compiled successfully. So, after that, you can add #include <SDKName/SDKName.h> into any project, which includes this SDK.
ps. My test app was created into root SDK folder.

Resources