- Must have MSYS2 installed - click here to download MSYS2
- Needs GCC installed on your Linux:
- Command to install:
sudo apt-get update sudo apt-get install gcc
- To get permission:
chmod +x test_program.exe
- Command to install:
- To test the lib, navigate to the test folder:
bash $ cd test $ ./test_program #or #But for this case you need to have a csv file in the ./ of the lib. $ test/test_program
- To compile the lib if not already compiled:
bash $ make #compiles the lib $ make test #compiles the test program
-
cloning the lib:
bash mkdir libs cd libs $ git clone git@github.com:weliton1996/csv_to_txt.git
-
Example main file of the project consuming the lib:
#include "libs/csv_to_txt/include/csv_to_txt.h" #include <stdio.h> int main() { const char *input_filename = "./input.csv"; const char *output_filename = "output.txt"; // Call the library function to convert CSV to TXT csv_to_txt(input_filename, output_filename); printf("Conversion completed successfully!\n"); return 0; }
-
Testing integration of the lib in your project:
$ gcc -o meu_programa main.c libs/csv_to_txt/src/csv_to_txt.c -Ilibs/csv_to_txt/include -Llibs/csv_to_txt/lib -lcsv_to_txt $ ./meu_programa
- Ter instalado MSYS2 - click aqui para baixar o MSYS2
- Precisa ter GCC no seu linux:
- Comando para instalar:
sudo apt-get update sudo apt-get install gcc
- Para obter permissão:
chmod +x test_program.exe
- Comando para instalar:
- Para testar a lib, navegue até a pasta test:
bash $ cd test $ ./test_program #ou #Mas para esse caso você precisa ter um arquivo csv no ./ da lib. $ test/test_program
- Para compilar a lib caso não venha compilada:
bash $ make #compila a lib $ make test #compila o programa de teste
-
clonando a lib:
bash mkdir libs cd libs $ git clone git@github.com:weliton1996/csv_to_txt.git
-
Exemplo arquivo main do projeto de consumo da lib:
#include "libs/csv_to_txt/include/csv_to_txt.h" #include <stdio.h> int main() { const char *input_filename = "./input.csv"; const char *output_filename = "output.txt"; // Chame a função da biblioteca para converter o CSV para TXT csv_to_txt(input_filename, output_filename); printf("Conversão concluída com sucesso!\n"); return 0; }
-
Teste de integração da lib no seu projeto:
$ gcc -o meu_programa main.c libs/csv_to_txt/src/csv_to_txt.c -Ilibs/csv_to_txt/include -Llibs/csv_to_txt/lib -lcsv_to_txt $ ./meu_programa