salut
j'essai de creer ma library(.lib), le probleme c'est quand je veux utilise ma .lib sous vc 6 ou vc 2008 ça marche pas.
vc 6 me donne ce probleme:
Linking...
LINK : fatal error LNK1196: invalid or corrupt import object: unknown version
Error executing link.exe.
vc 2008 me donne ce probleme:
Linking...
bbb.obj : error LNK2028: unresolved token (0A000014) "void __cdecl gotoxy(int,int)" (?gotoxy@@$$FYAXHH@Z) referenced in function "int __clrcall main(cli::array<class system="">^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
bbb.obj : error LNK2019: unresolved external symbol "void __cdecl gotoxy(int,int)" (?gotoxy@@$$FYAXHH@Z) referenced in function "int __clrcall main(cli::array<class system="">^)" (?main@@$$HYMHP$01AP$AAVString@System@@@Z)
sachant que le code est le meme.
voici mon exemple:
sur mon header :
#ifndefine lib
#define lib
int calcul(int a,int b);
#endif
sur mon .cpp
int calcul(int a,int b)
{
return a+b;
}
dans mon main.cpp
#include <stdio.h>
#include <lib.h>
#pragma comment(lib,"lib.lib")
int main()
{
printf("%d",calcul(1,3);
return 0;
}
qu'est ce qu'il me manque ?
merci avance</lib.h></stdio.h></class></class>