I'm writing an extension to mosquitto, however I'm having the issue that only changes that I make in the src folder are actually reflected in the final mosquitto server and mosquitto_pub/mosquitto_sub clients. I originally set it up with CMake and compiled all of that, and now to rebuild the clients/server I run make clean and then make in the src and client folders. They compile fine and new clients are built, however no changes I made in the c files in the client/lib folders are actually in the compiled programs. Anyone know what is going on? Am I misunderstanding something about how to compile it or how it runs?
eg. I modified _mosquitto_handle_connack() in lib/read_handle_client.c to print a different message at line 32 (_mosquitto_log_printf(mosq, MOSQ_LOG_DEBUG, "Client %s received CONNACK", mosq->id);) however no matter what I change the text to it still displays the original text. I even modified _mosquitto_packet_handle() in lib/read_handle.c so that when it receives a CONNACK it doesn't do anything, but when I compile and re-run it still handles the CONNACK like in the standard mosquitto.
Edit: I've done a little bit more testing of the issue and I've found something weird. If I delete an entire method in one of the files, compilation will fail because the method doesn't exist. If I just delete everything inside the method, compilation will succeed and the program will act as if everything I've just deleted is still there.
I realised that the problem is simple, I was running the clients without a ./ in front of them, so it was running the mosquitto clients I had installed (and completely forgotten about) 8 months earlier rather than the clients in the folder I was in.
Related
i'm working with renesas MCU RX65N, i want to make a serial connection with other board and also display an HMI i designed on Appwizard, i followed the steps they offer on their manuals but won't work either. Then found more information about how to solve it, and the code works by itself, but when i try to merge both programs just keeps giving me errors (problems that doesn't appear on individual projects), this is the error i got now, and don't know what to do because apparently it is included for my project but won't open no matter what i try, anyone knows how to solve it or what to do?
It sounds like when you include the file in one project, it works, but when you include it in another project, it doesn't? It sounds like there is a configuration difference between your projects. Try creating a new file in a project, then just put #include "r_bsp_config.h" in it, or however you wrote it (it may need to be #include <r_bsp_config.h>). See if you get the same error (you will probably get an error, something about missing main(), but the question is whether you get the same error). If you don't, cut and paste the code from the problematic project in, and also make sure the project configuration is adjusted to match, and see if it works now. If you do get the same error, then see if you can copy the project configuration from the working project to the new project, and see if you get the error this time.
I am a beginner and started learning C using VS Codium in Ubuntu. So I have a file named "programm1". And every time I try to run it in terminal with "./programm1" it doesnt recognise changes I made, unless I type "make programm1"
Is it supposed to be like this? Or is there ways to make it automatic, so I dont have to save every change I make with "make programm1"?
Your binary, programm1 doesn't know how it is build. Your build system, in this case, make specifies how to build your binary. As you found that you can execute a build manually. This is how I prefer to work (and in nvim I have the plugin ale enabled for real-time feedback).
Linux has a mechanism called inodify that allows a program to be notified of file system changes. You may want to check out wrappers for the API including the packages entr, inotify-hookable and inotify-tools.
Another option is to configure your editor to run make for you when you save a file.
There is an application on remote machine with Linux OS(Fedora), writing to the log file when certain events occur. Some time ago I changed format of the message being written to the log file. But recently it turned out that for some reason in some seldom cases log files with old format messages appear there. I know for sure that none part of my code can write such strings. Also there is no instance of the old application running. Does anyone have some ideas why it can happen? It's not possible to check which process writes those files because anything like auditctl is not installed there, and neither package manager or yum to get it or install. Application is written in C language.
you can use fuser command to find out all the processes that are using that file
`fuser file.log`
I'm trying to migrate some C programs from Windows Server to Linux. To edit the code, I'm using Eclipse-Indigo. The machine on which I'm working has WinXP on it (not my choice, so no comments please). My eclipse workarea is on a samba shared drive which is in my home directory on the Linux server.
Each C program is in a separate makefile project. I have specified the cygwin gcc compiler/parser in the settings for new CDT Projects and selected all relevant error parsers in the makefile project settings.
There are no syntax errors showing and the errors that are listed seem somewhat bizarre. The first error states:
make: *** No rule to make target `../../../../../fiscus/vo/src/mk/e12_.mk'. Stop.
The make script at the end is wrong. There is a value in the name which comes from an environment variable. The path is correct exactly as shown but the script name has hte variable $(WA_PLATFORM) in it. This is not being resolved although I have specified the value in the build environment variables.
The subsequent errors are even weirder. For each subsequent project I get the message:
Program "make" is not found in PATH
This makes me wonder how the first message was generated. Besides, the path on my winXP environment, which I assume is the relevant one here, does indeed have the directory with the make program in it.
Where have I mucked it up? Any hints?
One last piece of information. When I shut down eclipse I get access violation errors for the following:
<workarea-path>\.metadata\plugins\org.eclipse.debug.ui\launchConfigurationHistory.xml
<workarea-path>\.metadata\plugins\org.eclipse.jdt.core\variablesAndContainers.dat
I find this to be suspicious...
The problem appears to lie in the fact that I was using the samba share as my workarea. Apparently the regular backups made on the server changed something (don't know exactly what, though). The projects were no longer being recognised as makefile projects and certain essential metadata files were not accessible. The permissions certainly were not the problem, since I checked those on the server (everything was set to rwxrwxrwx).
To solve the problem I copied the entire workarea to my local hard drive. I then pointed eclipse at this new workarea. The next step was a bit of a pain, because I had to delete each project (without deleting the source, of course) and then import "Existing code as Makefile Project". This can be done with "File->import..." or with a right-click in the package explorer and select "import...".
The last requirement is to specify the required "include" directories. This can be done with "Project-> Properties-> C/C++ General-> Paths and Symbols". Select the "Includes" tab, choose the language (in this case "GNU C") and add the directories where the headers are defined.
Now it works properly again.
I'm creating an update setup files. In my initial installation, I have an EXE file which is called in [UninstallRun]. In the update, I want to permanently remove this EXE file but it seems to always throw the error "Some elements could not be removed" when I uninstall after the update.
To delete the EXE, I've tried deleting it during the update's [InstallDelete]. This deletes the file, but the error message is still thrown when its uninstalled (even though all files have definitely been removed).
I tried replacing the EXE in the update and using the deleteafterinstall flag, but that didn't make a difference.
If I don't do anything, and just install it, when I run the uninstaller, the EXE file is called, even though the update no longer contains the [UninstallRun] section. So it looks like the initial installation's setup file is being used for the uninstallation part.
For the purposes of this project, I can't change the initial installation, so everything has to be done from the update installation. Is there a way to delete an existing file that was placed in an UninstallRun section?
The issue is that the [UninstallRun] entry from the prior install has already been registered in the uninstall log, so simply removing it from your script won't stop it taking effect, and deleting the file will by default make it generate that error since (presumably) some required uninstall task didn't happen since the file was missing.
Did you remember to put a RunOnceId on the [UninstallRun] entry in the original installer? If so, you can put a "replacement" entry using the same id. You'll still have to make it point at an exe, but you can make it a no-op one, or (better) use Flags: skipifdoesntexist and point it at the one you've removed.
If you didn't use a RunOnceId, then there isn't any way to override the previous entry. You'll just have to put in a dummy exe file that does nothing.