Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when compiling under Windows #4

Open
silicode17 opened this issue Mar 18, 2023 · 1 comment
Open

Errors when compiling under Windows #4

silicode17 opened this issue Mar 18, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@silicode17
Copy link

silicode17 commented Mar 18, 2023

I have installed libcurl on Windows (in D:/curl) by following your instructions after I ran into "You might have difficulties handling libcurl where CMake throws Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)."

So I have copied curl.lib and libcurl.dll from the lib64/ and bin64/ folders of the libcurl-7.48.0-WinSSL-zlib-x86-x64.zip to D:/curl/lib.

Then I ran CMake:
cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DCURL_LIBRARY=D:/curl/lib/curl.lib -DCURL_INCLUDE_DIR=D:/curl/include

Everything went fine.

But when I ran:
cmake --build .

I got these errors:

00-showcase.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cdec
l openai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\00-showc
ase.vcxproj]
D:\openai-cpp\build\examples\Debug\00-showcase.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build\e
xamples\00-showcase.vcxproj]
01-model.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cdecl o
penai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\01-model.vc
xproj]
D:\openai-cpp\build\examples\Debug\01-model.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build\exam
ples\01-model.vcxproj]
02-completion.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cd
ecl openai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\02-com
pletion.vcxproj]
D:\openai-cpp\build\examples\Debug\02-completion.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build
\examples\02-completion.vcxproj]
03-edit.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cdecl op
enai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\03-edit.vcxp
roj]
D:\openai-cpp\build\examples\Debug\03-edit.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build\examp
les\03-edit.vcxproj]
04-image.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cdecl o
penai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\04-image.vc
xproj]
D:\openai-cpp\build\examples\Debug\04-image.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build\exam
ples\04-image.vcxproj]
05-embedding.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cde
cl openai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\05-embe
dding.vcxproj]
D:\openai-cpp\build\examples\Debug\05-embedding.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build
examples\05-embedding.vcxproj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_init referenced in function "public: void __cde
cl openai::_detail::Session::setMultiformPart(class std::basic_string<char,struct std::char_traits,class std::all
ocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)
" (?setMultiformPart@Session@_detail@openai@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0@Z)
[D:\openai-cpp\build\examples\06-file.vcxproj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cdecl op
enai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\06-file.vcxp
roj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_addpart referenced in function "public: void __
cdecl openai::_detail::Session::setMultiformPart(class std::basic_string<char,struct std::char_traits,class std::
allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const
&)" (?setMultiformPart@Session@_detail@openai@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0
@z) [D:\openai-cpp\build\examples\06-file.vcxproj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_name referenced in function "public: void __cde
cl openai::_detail::Session::setMultiformPart(class std::basic_string<char,struct std::char_traits,class std::all
ocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)
" (?setMultiformPart@Session@_detail@openai@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0@Z)
[D:\openai-cpp\build\examples\06-file.vcxproj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_data referenced in function "public: void __cde
cl openai::_detail::Session::setMultiformPart(class std::basic_string<char,struct std::char_traits,class std::all
ocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > const &)
" (?setMultiformPart@Session@_detail@openai@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0@Z)
[D:\openai-cpp\build\examples\06-file.vcxproj]
06-file.obj : error LNK2019: unresolved external symbol __imp_curl_mime_filedata referenced in function "public: void _
_cdecl openai::_detail::Session::setMultiformPart(class std::basic_string<char,struct std::char_traits,class std:
:allocator > const &,class std::basic_string<char,struct std::char_traits,class std::allocator > cons
t &)" (?setMultiformPart@Session@_detail@openai@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@
0@Z) [D:\openai-cpp\build\examples\06-file.vcxproj]
D:\openai-cpp\build\examples\Debug\06-file.exe : fatal error LNK1120: 6 unresolved externals [D:\openai-cpp\build\examp
les\06-file.vcxproj]
07-fine-tune.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cde
cl openai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\07-fine
-tune.vcxproj]
D:\openai-cpp\build\examples\Debug\07-fine-tune.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build
examples\07-fine-tune.vcxproj]
09-instances.obj : error LNK2019: unresolved external symbol __imp_curl_mime_free referenced in function "public: __cde
cl openai::_detail::Session::~Session(void)" (??1Session@_detail@openai@@qeaa@XZ) [D:\openai-cpp\build\examples\09-inst
ances.vcxproj]
D:\openai-cpp\build\examples\Debug\09-instances.exe : fatal error LNK1120: 1 unresolved externals [D:\openai-cpp\build
examples\09-instances.vcxproj]

@coin-au-carre
Copy link
Member

coin-au-carre commented Mar 24, 2023

I am not sure I understand your issue. It seems you have succeeded right ?
I suppose that the libraries are not in your PATH and that is why cmake --build . cannot work simply ?
If that is the case, I will refer to your issue for users on Windows that can be helpful thanks.

@coin-au-carre coin-au-carre added the documentation Improvements or additions to documentation label Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants