Necto Studio V2.0.0 - How to add installed package library into my project?

Cross-platform IDE for the rapid development of applications for the embedded world, available on Windows, Linux, and macOS.
Post Reply
Author
Message
chyun3
Posts: 1
Joined: 08 Aug 2022 07:06

Necto Studio V2.0.0 - How to add installed package library into my project?

#1 Post by chyun3 » 08 Aug 2022 10:43

Hi,
I'm new to the Necto Studio, currently using the version V2.0.0.

I have installed "Relay Click" & "TempHum 4 Click" in the Package Manager.

In my new created project, i add in #include "relay.h", #include "temphum4.h"

But after build it provide the following error,
error (C:\Users\gohic\Documents\MIKROE\Projects\test2\main.c,11): error: Can't open include file "relay.h" #include "relay.h"
error (C:\Users\gohic\Documents\MIKROE\Projects\test2\main.c,12): error: Can't open include file "temphum4.h" #include "temphum4.h" 2 errors in preprocessor.
ninja: build stopped: subcommand failed.

is there any step that i miss out?
Attachments
Capture2.PNG
Capture2.PNG (10.34 KiB) Viewed 1677 times
Capture1.PNG
Capture1.PNG (15.03 KiB) Viewed 1677 times

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Necto Studio V2.0.0 - How to add installed package library into my project?

#2 Post by filip » 12 Aug 2022 08:31

Hi,

Have you tried copying the header files to your new project ?

Regards,
Filip.

frank.malik
Posts: 96
Joined: 09 Apr 2021 20:37

Re: Necto Studio V2.0.0 - How to add installed package library into my project?

#3 Post by frank.malik » 12 Aug 2022 09:00

Hi chyun3,

I think this is a known issue of Necto 2.0 with the packages. Would you please post your Cmake file. Typically the wrong include directory is set.
At least this was the case in my case.
Kind regards
Frank

Fusion for STM32 v8, STM32F407ZG@168MHz, 4" TFT capacitive
mikromedia 3, PIC32MZ2048EFH100@200MHz, 3" TFT capacitive
NECTO Studio 3.0.0, mikroC AI for ARM/PIC32, mikroSDK v.2.7.2

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: Necto Studio V2.0.0 - How to add installed package library into my project?

#4 Post by IvanJeremic » 06 Sep 2022 09:07

Hi,

To convert memake project to Cmake, you need to do the following :

1. Create CMakeLists.txt file and put it in the folder where your memake file is (you don't have to delete the memake file) - see the CMakeLists.txt file below for the Balancer 4 click board :

Code: Select all

cmake_minimum_required(VERSION 3.21)
if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC")
    project(example_balancer4 LANGUAGES MikroC)
else()
    project(example_balancer4 LANGUAGES C ASM)
endif()

add_executable(example_balancer4
        main.c
)

find_package(MikroC.Core REQUIRED)
target_link_libraries(example_balancer4 PUBLIC MikroC.Core)
find_package(MikroSDK.Board REQUIRED)
target_link_libraries(example_balancer4 PUBLIC MikroSDK.Board)
find_package(MikroSDK.Log REQUIRED)
target_link_libraries(example_balancer4 PUBLIC MikroSDK.Log)
add_subdirectory(lib_balancer4)
target_link_libraries(example_balancer4 PUBLIC Click.Balancer4)
2. Open this file and replace each occurrence of the balancer4 string to click board you want to use (for example change the balancer4 to balancer2 for Balancer 2 click board).

3. After you done this, in the same folder make a subfolder (folder name should go something like lib_balancer4 if you are using the balancer 4 click).

4. Create a second CMakeLists.txt file and put it in this folder, it should look like this (again, change the click board name accordingly) :

Code: Select all

cmake_minimum_required(VERSION 3.21)
if (${TOOLCHAIN_LANGUAGE} MATCHES "MikroC")
    project(lib_balancer4 LANGUAGES MikroC)
else()
    project(lib_balancer4 LANGUAGES C ASM)
endif()

add_library(lib_balancer4 STATIC
        src/balancer4.c
        include/balancer4.h
)
add_library(Click.Balancer4  ALIAS lib_balancer4)

target_include_directories(lib_balancer4 PUBLIC 
        include
)

find_package(MikroC.Core REQUIRED)
target_link_libraries(lib_balancer4 PUBLIC MikroC.Core)
find_package(MikroSDK.Driver REQUIRED)
target_link_libraries(lib_balancer4 PUBLIC MikroSDK.Driver)
5. Inside the lib_balancer4 folder make 2 sub folders, one named include (this is where you will place already existing header file) an one named src (this is where you will place existing source file).

6. When you do all this go to Open Project in NECTO Studio and choose the first CMakeLists.txt file you made.

Regards,

Ivan.

Cachin Gimenez
Posts: 4
Joined: 30 Sep 2021 15:01

Re: Necto Studio V2.0.0 - How to add installed package library into my project?

#5 Post by Cachin Gimenez » 07 Dec 2022 13:55

Good morning.
I am in Argentina, the land of Leo Messi.
In this time of the World Cup I have time to try Necto Studio, which from what I read in this forum is very good. I use Windows 7. I have the problem that I can't download or install the software. I download Necto Studio-x64-online but when I run it it gives me a msg that it can't find the tree. In configuration I can select something from the proxy. I tried but I couldn't. I would like to try it so I can buy it.
If someone could help me. I sent filip a msg and he didn't reply.
Thank you

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: Necto Studio V2.0.0 - How to add installed package library into my project?

#6 Post by IvanJeremic » 08 Dec 2022 14:37

Hi,

For everyone having a similar issue as Cachin Gimenez, we are continuing this conversation on the forum in the link below:
viewtopic.php?f=237&t=79678&p=315906#p315906

Regards,

Ivan.

Post Reply

Return to “IDE”