Ao incluir uma biblioteca C está dando esse erro ao tentar compilar
||=== Build: Release in iup (compiler: GNU GCC Compiler) ===| obj\Release\main.o:main.cpp|| multiple definition of `WindowProcedure(HWND__*, unsigned int, unsigned int, long)@16'| obj\Release\main.o:main.cpp|| first defined here| obj\Release\main.o:main.cpp|| multiple definition of `WinMain@16'| obj\Release\main.o:main.cpp|| first defined here| ld.exe||cannot find -lbgi| ld.exe||cannot find -liup| ld.exe||cannot find -liupcontrols| ld.exe||cannot find -lcd| ld.exe||cannot find -liupcd| ||=== Build failed: 9 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
Não é a primeira vez que tenho esse tipo de problema ao tentar usar bibliotecas nos meus programas. Configurei as pastas no linker/compilador, mas não está dando certo. Estou usando o Code Blocks, mas já tentei no Dev-C++ e Netbeans e também tive problemas.
A biblioteca que estou usando é essa e o programa que tentei compilar e esse:
#include <stdlib.h>
#include <iup.h>
int main(int argc, char **argv)
{
IupOpen(&argc, &argv);
IupMessage("Hello World 1", "Hello world from IUP.");
IupClose();
return EXIT_SUCCESS;
}
Atualização:
Estou utilizando o Windows 10 x64 com o compilador MingW.
Eu segui o passo-a-passo, coloquei a biblioteca na pasta do compilador e incluí o arquivo de cabeçalho tanto na hierarquia do projeto quanto na configuração do compilador. Apesar disso esta dando esse erro:
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf make.exe[1]: Entering directory `/c/Users/Carlos/Documents/NetBeansProjects/IUP' "/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/iup.exe make.exe[2]: Entering directory `/c/Users/Carlos/Documents/NetBeansProjects/IUP' mkdir -p dist/Debug/MinGW-Windows gcc -o dist/Debug/MinGW-Windows/iup build/Debug/MinGW-Windows/main.o -L/C/MinGW/lib -liup -liupcontrols -lcd -liupcd -lcomctl32 -lole32 -g -I/C/MinGW/include -include /C/MinGW/include/iup.h build/Debug/MinGW-Windows/main.o: In function `main': C:\Users\Carlos\Documents\NetBeansProjects\IUP/main.c:6: undefined reference to `IupOpen' C:\Users\Carlos\Documents\NetBeansProjects\IUP/main.c:8: undefined reference to `IupMessage' C:\Users\Carlos\Documents\NetBeansProjects\IUP/main.c:10: undefined reference to `IupClose' collect2.exe: error: ld returned 1 exit status make.exe[2]: *** [dist/Debug/MinGW-Windows/iup.exe] Error 1 make.exe[2]: Leaving directory `/c/Users/Carlos/Documents/NetBeansProjects/IUP' make.exe[1]: *** [.build-conf] Error 2 make.exe[1]: Leaving directory `/c/Users/Carlos/Documents/NetBeansProjects/IUP' make.exe": *** [.build-impl] Error 2