Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > С/С++: Кроссплатформенное программирование, Qt/Gtk+/wxWidgets > [wx] Перенос программы из Linux на Windows


Автор: shutffl 28.8.2009, 17:46
Доброго времени суток !!

Вчера написал простенькое, можно даже сказать тестовое, приложение с использованием wxWidgets. Написал, но не смог перевести его для Windows. Пробовал по-разному, но в итоге остановился на Code::Blocks для обеих систем, дабы быть уверенным, что скомпилируется. В итоге получилось, что компиляция стопориться на <wx/sizer.h> и подобных.  Шаманство с путями ни к чему не привели. Подскажите куда копать.

Спасибо.

Автор: andrew_121 28.8.2009, 18:54
Вывод компилятора покажи.

Автор: shutffl 29.8.2009, 00:00
Код

C:\codes\c\wxTest\wxTestMain.h|14|wx/sizer.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|15|wx/stattext.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|16|wx/textctrl.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|17|wx/button.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|18|wx/dialog.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|22|error: expected class-name before '{' token|
C:\codes\c\wxTest\wxTestMain.h|25|error: expected `)' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|31|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|31|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|32|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|32|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|33|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|33|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|34|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|34|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|35|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|35|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|36|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|36|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|37|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|37|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|38|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|38|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|39|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|39|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|40|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|40|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|41|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|41|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|42|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|42|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|43|error: `wxCommandEvent' has not been declared|
C:\codes\c\wxTest\wxTestMain.h|43|error: ISO C++ forbids declaration of `event' with no type|
C:\codes\c\wxTest\wxTestMain.h|63|error: ISO C++ forbids declaration of `wxButton' with no type|
C:\codes\c\wxTest\wxTestMain.h|63|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|64|error: ISO C++ forbids declaration of `wxButton' with no type|
C:\codes\c\wxTest\wxTestMain.h|64|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|65|error: ISO C++ forbids declaration of `wxStaticText' with no type|
C:\codes\c\wxTest\wxTestMain.h|65|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|66|error: ISO C++ forbids declaration of `wxStaticText' with no type|
C:\codes\c\wxTest\wxTestMain.h|66|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|67|error: ISO C++ forbids declaration of `wxStaticText' with no type|
C:\codes\c\wxTest\wxTestMain.h|67|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|68|error: ISO C++ forbids declaration of `wxButton' with no type|
C:\codes\c\wxTest\wxTestMain.h|68|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|69|error: ISO C++ forbids declaration of `wxButton' with no type|
C:\codes\c\wxTest\wxTestMain.h|69|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|70|error: ISO C++ forbids declaration of `wxButton' with no type|
C:\codes\c\wxTest\wxTestMain.h|70|error: expected `;' before '*' token|
C:\codes\c\wxTest\wxTestMain.h|71|error: ISO C++ forbids declaration of `wxButton' with no type|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|



Сразу говорю, что именно этот код(проект) замечательно компилируется и запускается в Linux.

Автор: andrew_121 29.8.2009, 00:32
Не правильно собрал/установил, или не прописал пути к хидерам. Обычно таких проблем не возникает.

Добавлено через 1 минуту и 37 секунд
Цитата(shutffl @  29.8.2009,  00:00 Найти цитируемый пост)
C:\codes\c\wxTest\wxTestMain.h|14|wx/sizer.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|15|wx/stattext.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|16|wx/textctrl.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|17|wx/button.h: No such file or directory|
C:\codes\c\wxTest\wxTestMain.h|18|wx/dialog.h: No such file or directory|

Судя по этому, у тебя вообще не указанны пути.

Автор: shutffl 29.8.2009, 01:49
Хм.. Странно. Сборку и настройку под Windows делал по видео гайду. Просто приложение - пустое окно - скомпилилось нормально и запустилось. А перенесенное - нет. И, что странно, если делаю пустой проект с wxSmith, то он тоже не компилится. Выдает вот это:
Код

||=== testttttttt, Debug ===|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagjpeg.o)||In function `_Z14wx_jpeg_io_srcP22jpeg_decompress_structR13wxInputStream':|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|205|undefined reference to `_jpeg_resync_to_restart'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagjpeg.o)||In function `_ZN13wxJPEGHandler8LoadFileEP7wxImageR13wxInputStreambi':|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|238|undefined reference to `_jpeg_std_error'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|252|undefined reference to `_jpeg_destroy_decompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|257|undefined reference to `_jpeg_CreateDecompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|259|undefined reference to `_jpeg_read_header'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|273|undefined reference to `_jpeg_start_decompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|277|undefined reference to `_jpeg_finish_decompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|278|undefined reference to `_jpeg_destroy_decompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|290|undefined reference to `_jpeg_read_scanlines'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|308|undefined reference to `_jpeg_finish_decompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|309|undefined reference to `_jpeg_destroy_decompress'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagjpeg.o)||In function `_ZN13wxJPEGHandler8SaveFileEP7wxImageR14wxOutputStreamb':|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|380|undefined reference to `_jpeg_std_error'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|394|undefined reference to `_jpeg_destroy_compress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|398|undefined reference to `_jpeg_CreateCompress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|405|undefined reference to `_jpeg_set_defaults'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|414|undefined reference to `_jpeg_set_quality'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|450|undefined reference to `_jpeg_start_compress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|456|undefined reference to `_jpeg_write_scanlines'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|458|undefined reference to `_jpeg_finish_compress'|
C:\wxWidgets\build\msw\..\..\src\common\imagjpeg.cpp|459|undefined reference to `_jpeg_destroy_compress'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_Z10TIFFwxOpenR13wxInputStreamPKcS2_':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|209|undefined reference to `_TIFFClientOpen'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_Z10TIFFwxOpenR14wxOutputStreamPKcS2_':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|221|undefined reference to `_TIFFClientOpen'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandlerC2Ev':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|232|undefined reference to `_TIFFSetWarningHandler'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|233|undefined reference to `_TIFFSetErrorHandler'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandlerC1Ev':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|232|undefined reference to `_TIFFSetWarningHandler'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|233|undefined reference to `_TIFFSetErrorHandler'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandler8LoadFileEP7wxImageR13wxInputStreambi':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|253|undefined reference to `_TIFFSetDirectory'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|258|undefined reference to `_TIFFClose'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|267|undefined reference to `_TIFFGetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|268|undefined reference to `_TIFFGetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|272|undefined reference to `_TIFFGetFieldDefaulted'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|280|undefined reference to `__TIFFmalloc'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|287|undefined reference to `_TIFFClose'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|298|undefined reference to `__TIFFfree'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|299|undefined reference to `_TIFFClose'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|307|undefined reference to `_TIFFReadRGBAImage'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|312|undefined reference to `__TIFFfree'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|314|undefined reference to `_TIFFClose'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|347|undefined reference to `__TIFFfree'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|349|undefined reference to `_TIFFClose'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandler13GetImageCountER13wxInputStream':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|364|undefined reference to `_TIFFReadDirectory'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|366|undefined reference to `_TIFFClose'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandler8SaveFileEP7wxImageR14wxOutputStreamb':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|383|undefined reference to `_TIFFSetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|384|undefined reference to `_TIFFSetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|385|undefined reference to `_TIFFSetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|386|undefined reference to `_TIFFSetField'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|387|undefined reference to `_TIFFSetField'|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o):C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|392|more undefined references to `_TIFFSetField' follow|
C:\wxWidgets\lib\gcc_lib\libwxmsw28ud_core.a(corelib_imagtiff.o)||In function `_ZN13wxTIFFHandler8SaveFileEP7wxImageR14wxOutputStreamb':|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|430|undefined reference to `_TIFFScanlineSize'|
C:\wxWidgets\build\msw\..\..\src\common\imagtiff.cpp|432|undefined reference to `_TIFFScanlineSize'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|


Автор: andrew_121 29.8.2009, 06:42
это ошибки линковки.

Добавлено через 1 минуту и 56 секунд
Цитата(shutffl @  29.8.2009,  01:49 Найти цитируемый пост)
Странно. Сборку и настройку под Windows делал по видео гайду.

Я в подобных случаях говорю - Во дворе стоит сарай. На нем написано х*. Но там дрова!

Автор: shutffl 29.8.2009, 17:34
А во существу?

Автор: taiven 29.8.2009, 17:37
Запускаешь Code::Blocks, открываешь свой проект. Дальше заходишь в меню Project->Build options... Далее вкладка Linker Settings. Там указываешь все либы, которые требуются для Debug и Release. У тебя это кажется libwxjpegd.a и libwxtiffd.a(это для Debug, для Release libwxjpeg.a и libwxtiff.a)

Автор: shutffl 30.8.2009, 00:42
Огромное спасибо! Попробую..

Автор: shutffl 30.8.2009, 01:10
Спасибо! Помогло!

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)