Ciclonite
I'm new with asio, and i've a problem to compile example with ASIO STANDALONE. The project directory structure: ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ ├── cmake_install.cmake │ ├── include │ ├── Makefile │ └── netDaemon.cbp ├── CMakeLists.txt ├── include │ └── asio-1.18.1 └── main.cpp My main.cpp #include <iostream> #include "include/asio-1.18.1/include/asio.hpp" void print(const asio::error_code& /*e*/) { std::cout << "Hello, world!" << std::endl; } int main() { asio::io_context io; asio::steady_timer t(io, asio::chrono::seconds(5)); t.async_wait(&print); io.run(); return 0; } My Cmake cmake_minimum_required(VERSION 3.17) project(netDaemon) set(CMAKE_CXX_STANDARD 14) add_library(asio INTERFACE) target_compile_options(asio INTERFACE ASIO_STANDALONE) target_include_directories(asio INTERFACE /include/asio-1.18.1/include) target_link_libraries(asio INTERFACE pthread) # Using ASIO requires you link your final executable/library with your system's threading library (e.g. pthread on linux) add_executable(netDaemon main.cpp) Output error: in file included from /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio.hpp:18, from /home/ciclonite/CLionProjects/netDaemon/main.cpp:3: /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio/associated_allocator.hpp:18:10: fatal error: asio/detail/config.hpp: No such file or directory 18 | #include "asio/detail/config.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. I'm unable to find the problem. Any help is appreciated
Pavel
I'm new with asio, and i've a problem to compile example with ASIO STANDALONE. The project directory structure: ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ ├── cmake_install.cmake │ ├── include │ ├── Makefile │ └── netDaemon.cbp ├── CMakeLists.txt ├── include │ └── asio-1.18.1 └── main.cpp My main.cpp #include <iostream> #include "include/asio-1.18.1/include/asio.hpp" void print(const asio::error_code& /*e*/) { std::cout << "Hello, world!" << std::endl; } int main() { asio::io_context io; asio::steady_timer t(io, asio::chrono::seconds(5)); t.async_wait(&print); io.run(); return 0; } My Cmake cmake_minimum_required(VERSION 3.17) project(netDaemon) set(CMAKE_CXX_STANDARD 14) add_library(asio INTERFACE) target_compile_options(asio INTERFACE ASIO_STANDALONE) target_include_directories(asio INTERFACE /include/asio-1.18.1/include) target_link_libraries(asio INTERFACE pthread) # Using ASIO requires you link your final executable/library with your system's threading library (e.g. pthread on linux) add_executable(netDaemon main.cpp) Output error: in file included from /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio.hpp:18, from /home/ciclonite/CLionProjects/netDaemon/main.cpp:3: /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio/associated_allocator.hpp:18:10: fatal error: asio/detail/config.hpp: No such file or directory 18 | #include "asio/detail/config.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. I'm unable to find the problem. Any help is appreciated
Did you try this solution? https://stackoverflow.com/questions/34026873/asio-c-library-asio-detail-config-hpp-no-such-file-or-directory
christian
Anyone with the tutorial for installing VS code for C/C++?
Anonymous
JFC
christian
Thank you
olli
I'm new with asio, and i've a problem to compile example with ASIO STANDALONE. The project directory structure: ├── cmake-build-debug │ ├── CMakeCache.txt │ ├── CMakeFiles │ ├── cmake_install.cmake │ ├── include │ ├── Makefile │ └── netDaemon.cbp ├── CMakeLists.txt ├── include │ └── asio-1.18.1 └── main.cpp My main.cpp #include <iostream> #include "include/asio-1.18.1/include/asio.hpp" void print(const asio::error_code& /*e*/) { std::cout << "Hello, world!" << std::endl; } int main() { asio::io_context io; asio::steady_timer t(io, asio::chrono::seconds(5)); t.async_wait(&print); io.run(); return 0; } My Cmake cmake_minimum_required(VERSION 3.17) project(netDaemon) set(CMAKE_CXX_STANDARD 14) add_library(asio INTERFACE) target_compile_options(asio INTERFACE ASIO_STANDALONE) target_include_directories(asio INTERFACE /include/asio-1.18.1/include) target_link_libraries(asio INTERFACE pthread) # Using ASIO requires you link your final executable/library with your system's threading library (e.g. pthread on linux) add_executable(netDaemon main.cpp) Output error: in file included from /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio.hpp:18, from /home/ciclonite/CLionProjects/netDaemon/main.cpp:3: /home/ciclonite/CLionProjects/netDaemon/include/asio-1.18.1/include/asio/associated_allocator.hpp:18:10: fatal error: asio/detail/config.hpp: No such file or directory 18 | #include "asio/detail/config.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. I'm unable to find the problem. Any help is appreciated
Your problems seem to be CMake and not asio related target_include_directories( asio INTERFACE /include/asio-1.18.1/include) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ your include path looks wrong to me, there probably shouldn't be a leading / as you want to use the relative include directory within your project and not a "root" one. target_compile_options( asio INTERFACE -DASIO_STANDALONE) ^^ I had to specify -D as compile option you probably want to link your executable against the library target_link_libraries( netDaemon PRIVATE asio) #include "include/asio-1.18.1/include/asio.hpp" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ if you link against the library you should prefer #include <asio.hpp> After this changes it should work ollirz@dev-x1:~/source/asio-standalone/cmake-build-debug$ make -j Scanning dependencies of target netDaemon [ 50%] Building CXX object CMakeFiles/netDaemon.dir/main.cpp.o [100%] Linking CXX executable netDaemon [100%] Built target netDaemon ollirz@dev-x1:~/source/asio-standalone/cmake-build-debug$ ./netDaemon Hello, world!
Anonymous
Hello to all, i have ask question: it's possible include one class into another class? And do you have example? Or give me site web for example. Thank you
olli
Hello to all, i have ask question: it's possible include one class into another class? And do you have example? Or give me site web for example. Thank you
You can (among others) inherit from a non final class or use it as a member. Not sure what you're trying to do.
Anonymous
Assuming you have been contacted by a company so that you can prepare a training manual that they will use to run a company development a professionally done training manual on the following topics. 1) functions in C++ 2)Pointers in C++ 3) Standard template library (STL)
Eturnus
Can i get a program in which i can link any files from storage .please
Khan
is there any algorithm in brute force except string matching?
klimi
Like bruteforcing a password? Yes there is
A
hey i need help from anyone who has mac os with Qt in it
Eturnus
What?
I have a txt file in my laptop and i want it to display it in a compiler using a program ,is there any program by which i can display that file in compiler output
A
i have qt project that i created in windows i need a few screen shots of it runing in a mac os
A
anyone who can help me ill send u the project file
Zel
i would but I no longer have OSX availible to me
A
oh its okay
Igor🇺🇦
anyone who can help me ill send u the project file
This is easier https://www.hackint0sh.org/how-to-install-macos-on-virtualbox/
A
ill send u the projetc file
Igor🇺🇦
ill send u the projetc file
I don't have and I don't want to have it. You can have your own instance if you want to test.
A
Anyone who can help me
Anonymous
Anyone who can help me
No one can help You've been sent the article Follow the instructions And stop offtoping
Eturnus
Seems possible
Since i am new in c programming ,i dont have enough information so that i can create this programm myself
Revo
That was necessary!!
Anonymous
hii
Alijon Rakhimov
Hello everybody
Alijon Rakhimov
Where can I get information about the Unsigned mask in c ++?
Bordi
Hi
Bordi
I am looking for someone who can help me to doing a c# program
Igor🇺🇦
Revo
Warn!! Hi guys anyone can tell me what's that mean ??
Revo
?
Is that mean I'll be fired out if I made mistakes
klimi
Is that mean I'll be fired out if I made mistakes
yes.... if you spam here porn, advertisment without asking, or other things that break rules (which you should have read) you will be warned and banned
Revo
I didn't read rules
klimi
I didn't read rules
that's not mine or admins fault
Vitalii
p = start; struct Node * nextPtr = p->next; int swapped; double temp; do { swapped = 0; while (nextPtr->next != NULL) { if (p->rate > nextPtr->rate) { temp = p->rate; p->rate = nextPtr->rate; nextPtr->rate = temp; swapped = 1; } p = nextPtr; nextPtr = nextPtr->next } } while (swapped); p = start; printf("Sorted list:\n"); while(p->next!= NULL){ printf("%lf\n", (p->rate)); p = p->next; } Sorry, I have a list, in which "start" is starting pointer. I need to sort my list, but Idk why it doesn't change anything when I print this list. Can anybody help?
Pavel
It changed a little my list, but not that I wanted to see
I think you may skip the last element because of your check (nextPtr->next != NULL)
Pavel
Maybe you can always use p and not store nextPtr at all?
Vitalii
I can use (p->next) instead of nextPtr in each line, you're right. What I noticed: this program moves the biggest element to the end, but it doesn't take other elements. Maybe I'll check this moment
Anonymous
/ban @JM123STUDIO
JAGDEESH
Hello send me c programming notes in pdf plz
....
Here You also provide pdf notes?
Eturnus
/warn
Eturnus
/ban
Eturnus
Guys does graphic.h header file come in c programming or c++?
Eturnus
it is outdated
Means not in use in programming these days??
Igor🇺🇦
Guys does graphic.h header file come in c programming or c++?
It's part of https://en.wikipedia.org/wiki/Borland_Graphics_Interface. That is not being developed since 1997
Igor🇺🇦
Aawe noo i was excited about it and is been outdated.
Why were were you excited? What functionality do you need there? You can try http://libxbgi.sourceforge.net/#SDL_bgi. It's port of graphics.h to SDL backend
Anonymous
How can i write a programm that searches for a matrix in a larger matrix and, if found, returns the starting point of cell zero and zero in the larger matrix, otherwise the number -1 is printed.
klimi
In c
gcc would work just fine?
klimi
Yes
okay.
Anonymous
okay.
Can u?
klimi
can I what?
klimi
I probably can... but why would I? I don't understand what is your question
klimi
Why?
Anonymous
Why?
To explain the question